Created
April 17, 2019 17:57
-
-
Save Whateverable/296a38e467d7941a9a0f863f287d54b2 to your computer and use it in GitHub Desktop.
evalable6
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
class A { submethod TWEAK(|) { "A.TWEAK".say; }; }; class B is A { submethod TWEAK(|) { "B.TWEAK".say; } }; A.^can("TWEAK")[0].wrap(-> (|) { say self.^name; }); B.new; # dies with self not available in the wrapped TWEAK |
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
(exit code 1) | |
===SORRY!=== Error while compiling /tmp/2HvwV476qk | |
'self' used where no object is available | |
at /tmp/2HvwV476qk:1 | |
------> }; A.^can("TWEAK")[0].wrap(-> (|) { say ⏏self.^name; }); B.new; # dies with self | |
expecting any of: | |
argument list | |
term |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment