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

lucasbuchala opened this issue Nov 20, 2018 · 1 comment


None yet
2 participants
Copy link

commented Nov 20, 2018

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

Bisectable pointed at: d3c5381



This comment has been minimized.

Copy link

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 } };'
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.