Skip to content

Instantly share code, notes, and snippets.

@lizmat
Created September 23, 2019 08:24
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 lizmat/6b1fd58385a522886253ecb095edc323 to your computer and use it in GitHub Desktop.
Save lizmat/6b1fd58385a522886253ecb095edc323 to your computer and use it in GitHub Desktop.
Make Proxy honour subclassing
$ git diff
diff --git a/src/Perl6/bootstrap.c/BOOTSTRAP.nqp b/src/Perl6/bootstrap.c/BOOTSTRAP.nqp
index a26697224..17b8dc3e7 100644
--- a/src/Perl6/bootstrap.c/BOOTSTRAP.nqp
+++ b/src/Perl6/bootstrap.c/BOOTSTRAP.nqp
@@ -1749,7 +1749,7 @@ BEGIN {
nqp::getattr($cont, Proxy, '&!STORE')($var, $val)
})));
Proxy.HOW.add_method(Proxy, 'new', nqp::getstaticcode(sub ($type, :$FETCH!, :$STORE!) {
- my $cont := nqp::create(Proxy);
+ my $cont := nqp::create($type);
nqp::bindattr($cont, Proxy, '&!FETCH', $FETCH);
nqp::bindattr($cont, Proxy, '&!STORE', $STORE);
$cont
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment