Skip to content

Instantly share code, notes, and snippets.

@Whateverable
Created June 7, 2019 07:04
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/1b8b1ea8c8bbb83676f5e8fb0a5c7f1e to your computer and use it in GitHub Desktop.
Save Whateverable/1b8b1ea8c8bbb83676f5e8fb0a5c7f1e to your computer and use it in GitHub Desktop.
bisectable6
role Foo { has Int $.foo; submethod BUILD(Int :$foo) { $!foo = $foo; }; class Bar does Foo { submethod TWEAK(:$foo = 1) { $!foo := $foo; } }; my Bar $bar .= new; say $bar.foo
Output on both points: «===SORRY!=== Error while compiling /tmp/xivJINgsKf
Cannot declare our-scoped class inside of a role
(the scope inside of a role is generic, so there is no unambiguous
package to install the symbol in)
at /tmp/xivJINgsKf:1
------> o) { $!foo = $foo; }; class Bar does Foo⏏ { submethod TWEAK(:$foo = 1) { $!foo :=
»
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment