Skip to content

Instantly share code, notes, and snippets.

@lizmat
Created September 26, 2017 08:15
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/e67ae4d93c3411b29be6bcd7f77571b2 to your computer and use it in GitHub Desktop.
Save lizmat/e67ae4d93c3411b29be6bcd7f77571b2 to your computer and use it in GitHub Desktop.
Trying to give auto-generated accessors a :D invocant signature
diff --git a/src/Perl6/World.nqp b/src/Perl6/World.nqp
index 5e56702..e8aff9d 100644
--- a/src/Perl6/World.nqp
+++ b/src/Perl6/World.nqp
@@ -2994,15 +2994,17 @@ class Perl6::World is HLL::World {
$!w.cur_lexpad()[0].push($block);
my $sig;
- if $package_type =:= $!acc_sig_cache_type {
+ my $invocant_type :=
+ $!w.create_definite_type( $!w.find_symbol(['Perl6','Metamodel','DefiniteHOW']), $package_type, 1 );
+ if $invocant_type =:= $!acc_sig_cache_type {
$sig := $!acc_sig_cache;
}
else {
my %sig_info := nqp::hash('parameters', []);
$sig := $!w.create_signature_and_params(NQPMu, %sig_info,
- $block, 'Any', :method, invocant_type => $package_type);
+ $block, 'Any', :method, :$invocant_type);
$!acc_sig_cache := $sig;
- $!acc_sig_cache_type := $package_type;
+ $!acc_sig_cache_type := $invocant_type;
}
my $code := $!w.create_code_object($block, 'Method', $sig);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment