You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Rakudo version 2017.04.3 built on MoarVM version 2017.04-53-g66c6dda implementing Perl 6.c.
# Not constraining to a defined type works:
role R[::T] {
has T $.x = T.new(0);
method new() {return self.bless(:x(42e0));}
};
class C does R[Num] {};
C.new();
# Constraining to a defined type works if the type constraint is not parameterized.
role R {
has Num:D $.x = Num.new(0);
method new() {return self.bless(:x(42e0));}
};
class C does R {};
C.new();
# Both parameterizing and constraining to a defined type fails.
role R[::T] {
has T:D $.x = T.new(0);
method new() {return self.bless(:x(42e0));}
};
class C does R[Num] {};
C.new();
# OUTPUT: X::TypeCheck::Assignment exception produced no message
Migrated from rt.perl.org#131343 (status was 'new')
Searchable as RT131343$
The text was updated successfully, but these errors were encountered: