sorear/niecza

has $.foo = $.bar needlessly rejected

Closed this issue · 1 comments

02:37 < moritz> niecza: class A { has $.a; has $.b = $.a }
02:37 <+p6eval> niecza v12-66-g5abbd8a: OUTPUT«===SORRY!===␤␤Variable $.a used 
                where no 'self' is available at /tmp/KLDwQcyxJx line 1:␤------> 
                class A { has $.a; has $.b = ⏏$.a }␤␤Unhandled exception: Check 
                failed␤␤  at /home/p6eval/niecza/boot/lib/CORE.setting line…
02:38 < moritz> sorear: that error is questionable; when $.b is initialized, an 
                invocant needs to be somewhere, so you can just make it 
                available

More recent discussion has indicated that has $.b = $.a shouldn't be allowed, and you need to use has $.b = $!a. However, this ticket is still valid, since Niecza doesn't accept the latter form either.