As a status update: This behaves differently now.

$ perl6-m -e 'role Foo[::T] { has T @.a = [T] }; class Bar {}; say 
Foo[Bar].new.a[0]'
Type check failed in assignment to '@!a'; expected 'Bar' but got 'Array'
  in method REIFY at src/gen/m-CORE.setting:9935
  in method reify at src/gen/m-CORE.setting:8543
  in method gimme at src/gen/m-CORE.setting:9024
  in method sink at src/gen/m-CORE.setting:9513
  in method BUILDALL at src/gen/m-CORE.setting:1043
  in method bless at src/gen/m-CORE.setting:961
  in method new at src/gen/m-CORE.setting:947
  in any  at src/gen/m-Metamodel.nqp:1510
  in block <unit> at -e:1

$ perl6-m -e 'my $r = role Foo[::T] { has T @.a }; 
$r.HOW.attributes($r).perl.say'
(Attribute.new(),)

$ perl6-m -e 'my $r = role Foo[::T] { has T @.a }; $r.HOW.attributes($r, 
:local).[0].type.HOW.archetypes.generic.say'
1

Reply via email to