Skip to content

Instantly share code, notes, and snippets.

Created October 25, 2016 12:00
What would you like to do?
use v6;
use lib '.';
# - require will return the class with the same name as the module name
# - all lookups of modules loaded via required have to be dynamic
# - type names are imported at runtime and are not available for normal type checks
# - smart match between type objects and dynamic lookups works
subset C where ::('M::C');
my C $context = try {
CATCH { default { .note } };
require ::('M');
dd $context.HOW.^methods.elems;
dd $context.HOW.shortname($context);
unit module M;
class C is export { method m { 'method C::m' } };
class D is export { method m { 'method D::m' } };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment