Created
November 22, 2020 20:29
-
-
Save vrurg/caeac11d7a2cb5f2c87d910a2df96c30 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
role R[::T] { | |
my subset RS of T where { note "VALIDATING ", $_, ", T:", T.^name; True }; | |
method the-subset { RS } | |
method foo(RS $vrs) { | |
pass "got value " ~ $vrs.raku | |
} | |
} | |
class C1 does R[Int] { } | |
my $obj = C1.new; | |
my $meth = $obj.^lookup('foo'); | |
note "::: method parameter type: ", $meth.signature.params[1].type.^refinee.^name; | |
$obj.foo(12); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment