Skip to content

Instantly share code, notes, and snippets.

@Altreus
Created February 14, 2020 21: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 Altreus/528c6172a673c0adef7dd7a3ace22b19 to your computer and use it in GitHub Desktop.
Save Altreus/528c6172a673c0adef7dd7a3ace22b19 to your computer and use it in GitHub Desktop.
To exit type 'exit' or '^D'
> role X { multi method moo (X:U:) { self.new.moo }; multi method moo (X:D:) { ... } }
(X)
> class A does X {}
===SORRY!=== Error while compiling:
Multi method 'moo' with signature :(X:D: *%_) must be implemented by A because it is required by a role
> role Y { multi method bar (::?CLASS:U:) { self.new.bar }; multi method bar (::?CLASS:D:) { ... } }
(Y)
> class B does Y {}
===SORRY!=== Error while compiling:
Multi method 'bar' with signature :(B:D: *%_) must be implemented by B because it is required by a role
> role Z { multi method bar (::?CLASS:U:) returns ::?CLASS { self.new.bar }; multi method bar (::?CLASS:D:) returns ::?CLASS { ... } }
(Z)
> class C does Z {}
===SORRY!=== Error while compiling:
No such method 'raku' for invocant of type '::?CLASS'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment