-
-
Save Altai-man/225947b79a209619c5199333e1d76490 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my $inner = Metamodel::ClassHOW.new_type(name => 'Inner'); | |
$inner.^compose; | |
my $outer = Metamodel::ClassHOW.new_type(name => 'Outer'); | |
my $attr = Attribute.new(name => '$!inner', type => $inner, package => $outer, :has_accessor); | |
$outer.^add_attribute($attr); | |
$outer.^compose; | |
say $inner.WHICH eq $outer.^attributes[0].type.WHICH; # True | |
say $inner === $outer.^attributes[0].type; # True | |
say $inner ~~ $outer.^attributes[0].type; # False ??? | |
# Type check failed in assignment to $!inner; expected Inner but got Inner.new ??? | |
say $outer.new(inner => $inner.new); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment