Skip to content

Commit c0c5bb0

Browse files
committed
Fix a nasty NQP bug where the REPL and code run immediately rather than pre-compiled didn't properly see the setting.
1 parent a375e18 commit c0c5bb0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/NQP/SymbolTable.pm

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,18 @@ class NQP::SymbolTable is HLL::Compiler::SerializationContextBuilder {
3636
)
3737
)));
3838
}
39+
else {
40+
# Needs fixup.
41+
self.add_event(:fixup_past(PAST::Op.new(
42+
:pasttype('callmethod'), :name('set_outer_ctx'),
43+
PAST::Var.new( :name('block'), :scope('register') ),
44+
PAST::Op.new(
45+
:pasttype('callmethod'), :name('load_setting'),
46+
PAST::Var.new( :name('ModuleLoader'), :namespace([]), :scope('package') ),
47+
$setting_name
48+
)
49+
)));
50+
}
3951

4052
return pir::getattribute__PPs($setting, 'lex_pad');
4153
}

0 commit comments

Comments
 (0)