As a status update: This currently fails with: $ perl6-m -e 'class A { has str $.x; method BUILD(:$!x) { } }; say A.new(:x<foo>).x' Cannot modify an immutable str in method BUILD at -e:1 in method BUILDALL at src/gen/m-CORE.setting:983 in method bless at src/gen/m-CORE.setting:966 in method new at src/gen/m-CORE.setting:952 in block <unit> at -e:1
$ perl6-j -e 'class A { has str $.x; method BUILD(:$!x) { } }; say A.new(:x<foo>).x' java.lang.RuntimeException: Cannot access a native attribute as a reference attribute in method BUILD at -e:1 in method BUILDALL at gen/jvm/CORE.setting:965 in method bless at gen/jvm/CORE.setting:948 in method new at gen/jvm/CORE.setting:934 in block <unit> at -e:1 $ perl6-m --version This is perl6 version 2015.02-151-g669f482 built on MoarVM version 2015.02-17-g86d0c68