From 51924175e9ae1d9716b37e4387144eef126900f6 Mon Sep 17 00:00:00 2001 From: Stefan O'Rear Date: Sun, 20 May 2012 23:24:53 -0700 Subject: [PATCH] Make self available in initializer thunks, fixes #93 --- lib/Kernel.cs | 2 +- src/NieczaActions.pm6 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Kernel.cs b/lib/Kernel.cs index 6bff6e21..3c340b4b 100644 --- a/lib/Kernel.cs +++ b/lib/Kernel.cs @@ -5356,7 +5356,7 @@ internal class MMDCandidate : MultiCandidate { } else { P6any init = prog[i].init; th.lexi0 = i; - return init.Invoke(th, Variable.None, null); + return init.Invoke(th, new [] { NewROScalar(n) }, null); } value: vx = (Variable) th.resultSlot; diff --git a/src/NieczaActions.pm6 b/src/NieczaActions.pm6 index 67048535..0906e812 100644 --- a/src/NieczaActions.pm6 +++ b/src/NieczaActions.pm6 @@ -2792,7 +2792,7 @@ method do_initialize($/, $parcel?) { $ll]) }); } elsif $lhs.^isa($OpAttribute) { - my $init = self.thunk_sub($rhs, + my $init = self.thunk_sub($rhs, :params(['self']), :name($lhs.initializer.name ~ " init")); $init.set_outervar(my $ov = self.gensym); $*CURLEX.add_my_sub($ov, $init);