summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--mrblib/string.rb1
-rw-r--r--src/codegen.c1
-rw-r--r--test/t/syntax.rb13
3 files changed, 13 insertions, 2 deletions
diff --git a/mrblib/string.rb b/mrblib/string.rb
index 0b995f9ca..43dda16e5 100644
--- a/mrblib/string.rb
+++ b/mrblib/string.rb
@@ -133,7 +133,6 @@ class String
def []=(pos, value)
b = self[0, pos]
a = self[pos+1..-1]
- p [b, value, a].join('')
self.replace([b, value, a].join(''))
end
end
diff --git a/src/codegen.c b/src/codegen.c
index ca2269d85..82e80ee41 100644
--- a/src/codegen.c
+++ b/src/codegen.c
@@ -635,7 +635,6 @@ scope_body(codegen_scope *s, node *tree)
genop(scope, MKOP_A(OP_STOP, 0));
}
else {
- pop_(scope);
if (scope->nregs == 0) {
genop(scope, MKOP_A(OP_LOADNIL, 0));
genop(scope, MKOP_AB(OP_RETURN, 0, OP_R_NORMAL));
diff --git a/test/t/syntax.rb b/test/t/syntax.rb
index 7898a0b7d..47221d425 100644
--- a/test/t/syntax.rb
+++ b/test/t/syntax.rb
@@ -45,3 +45,16 @@ assert('Abbreviated variable assignment', '11.4.2.3.2') do
c += 2
a == 1 and b == nil and c == 3
end
+
+assert('Nested const reference') do
+ module Syntax4Const
+ CONST1 = "hello world"
+ class Const2
+ def const1
+ CONST1
+ end
+ end
+ end
+ Syntax4Const::CONST1 == "hello world" and
+ Syntax4Const::Const2.new.const1 == "hello world"
+end