diff --git a/lib/virtual/compiled_method_info.rb b/lib/virtual/compiled_method_info.rb index b222666d..c8c35912 100644 --- a/lib/virtual/compiled_method_info.rb +++ b/lib/virtual/compiled_method_info.rb @@ -46,7 +46,7 @@ module Virtual method_name = Virtual.new_word(method_name) if method_name.is_a? String clazz = Machine.instance.space.get_class_by_name class_name raise "No such class #{class_name}" unless clazz - method = clazz.create_instance_method(method_name , Virtual.new_list(args)) + method = clazz.create_instance_method( method_name , Virtual.new_list(args)) method.info = CompiledMethodInfo.new method end diff --git a/lib/virtual/compiler/basic_expressions.rb b/lib/virtual/compiler/basic_expressions.rb index 9f85a20e..f6dbfe07 100644 --- a/lib/virtual/compiler/basic_expressions.rb +++ b/lib/virtual/compiler/basic_expressions.rb @@ -45,7 +45,7 @@ module Virtual # otherwise it's a method without args and a send is issued. # whichever way this goes the result is stored in the return slot (as all compiles) def self.compile_name expression , method - return Self.new( Mystery ) if expression.name == :self + return Self.new( Reference.new(method.for_class)) if expression.name == :self name = Virtual.new_word expression.name.to_s if method.has_var(name) # either an argument, so it's stored in message diff --git a/test/virtual/test_hello.rb b/test/virtual/test_hello.rb index e0712fd1..fbc0887e 100644 --- a/test/virtual/test_hello.rb +++ b/test/virtual/test_hello.rb @@ -25,7 +25,7 @@ HERE def test_puts_string @string_input = <