Skip to content

Instantly share code, notes, and snippets.

@FROGGS
Created January 25, 2016 18:14
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save FROGGS/2dca7df3cb040da864a3 to your computer and use it in GitHub Desktop.
diff --git a/src/vm/moar/Perl6/Ops.nqp b/src/vm/moar/Perl6/Ops.nqp
index 2696e24..ef70972 100644
--- a/src/vm/moar/Perl6/Ops.nqp
+++ b/src/vm/moar/Perl6/Ops.nqp
@@ -605,6 +605,12 @@ $ops.add_hll_op('perl6', 'p6typecheckrv', -> $qastcomp, $op {
$type := $type.HOW.base_type($type);
}
+ # A type capture
+ if $type.HOW.archetypes.generic {
+ $type := $type.HOW.instantiate_generic($type, nqp::ctxcaller(nqp::ctx()));
+ nqp::say($type.HOW.name($type));
+ }
+
my @ops;
my $value_res := $qastcomp.as_mast($op[0], :want($MVM_reg_obj));
my $type_res := $qastcomp.as_mast(QAST::WVal.new( :value($type) ), :want($MVM_reg_obj));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment