Skip to content

Instantly share code, notes, and snippets.

@Whateverable
Created April 17, 2019 17:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Whateverable/296a38e467d7941a9a0f863f287d54b2 to your computer and use it in GitHub Desktop.
Save Whateverable/296a38e467d7941a9a0f863f287d54b2 to your computer and use it in GitHub Desktop.
evalable6
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
(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