diff --git a/kernel/core/context.rb b/kernel/core/context.rb index 27f8c72..130d7d4 100644 --- a/kernel/core/context.rb +++ b/kernel/core/context.rb @@ -233,6 +233,11 @@ class MethodContext scope = MethodContext.current.sender.current_scope scope.__send__(:alias_method, name, original) end + + def __const_set__(name, value) + scope = MethodContext.current.sender.current_scope + scope.__send__(:__const_set__, name, value) + end end ## diff --git a/lib/compiler/bytecode.rb b/lib/compiler/bytecode.rb index 59db854..b02816b 100644 --- a/lib/compiler/bytecode.rb +++ b/lib/compiler/bytecode.rb @@ -1204,7 +1204,7 @@ class Node elsif @from_top g.push_cpath_top else - g.push :self + g.push_context end g.send :__const_set__, 2