Skip to content

Instantly share code, notes, and snippets.

@peschwa
Created March 1, 2015 23:58
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 peschwa/ea19c808a7603e3fdddb to your computer and use it in GitHub Desktop.
Save peschwa/ea19c808a7603e3fdddb to your computer and use it in GitHub Desktop.
use v6;
sub eval-lives($code) {
my $res = check-exception($code);
say $res;
}
sub check-exception($code) {
try {
EVAL $code;
}
$!
}
role StubB { ... }; role StubB { method foo { } };
say "ok";
eval-lives 'role StubB { ... }; role StubB { method foo { } };';
say "ded :(";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment