From rakudo/rakudo#6097:
role A {
has %types;
%types{::?CLASS.^name} = ::?CLASS;
method dump-types {
dd %types
}
}
===SORRY!=== Error while compiling foo
Variable %!types used where no 'self' is available
at foo:3
------> %types⏏{::?CLASS.^name} = ::?CLASS;
I think that the use of has $foo without a sigil should be forbidden exactly because the expectations that it brings, and the puzzling error messages that it may create.
From rakudo/rakudo#6097:
I think that the use of
has $foowithout a sigil should be forbidden exactly because the expectations that it brings, and the puzzling error messages that it may create.