Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't assign Nil to an attribute from a role #2503

Open
lucasbuchala opened this issue Nov 20, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@lucasbuchala
Copy link
Collaborator

commented Nov 20, 2018

> role R[::T] { has T $!x }; class C does R[Any] { method m { $!x = Nil } }; C.new.m; say 'ok'
Died with X::TypeCheck::Assignment
  in method m at - line 1
  in block <unit> at - line 1

Bisectable pointed at: d3c5381

Context: https://colabti.org/irclogger/irclogger_log/perl6-dev?date=2018-11-20#l263

@lizmat

This comment has been minimized.

Copy link
Contributor

commented Dec 31, 2018

After a6d8858 , the error has become:

$ perl6 -e 'role R[::T] { has T $!x }; class C does R[Any] { method m { $!x = Nil } }; C.new.m'
Type check failed in assignment to $!x; expected Any but got T (?)
  in method m at -e line 1

which is a strange error, but perhaps more helpful in finding a solution to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.