dbremner / rubydotnetcompiler

Automatically exported from code.google.com/p/rubydotnetcompiler
0 stars 0 forks source link

"obj.meth ||= x" fails #25

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
First reported by Seo Sanghyeon.

Quickest testcase is "String.blah ||= 1" (expecting NoMethodError), but it
works for any object.

Note that there are also weird edge cases like "Object.new ||= 'Hello'"
which MRI seems to be OK with (what does that mean? Object.new= doesn't exist).

---

> bin\ruby -e "String.blah ||= 1"

Unhandled Exception: System.NullReferenceException: Object reference not
set to an instance of an object.
   at Ruby.Compiler.AST.METHOD_CALL.GenCode0(CodeGenContext context)
   at Ruby.Compiler.AST.Node.GenCode(CodeGenContext context)
   at Ruby.Compiler.CodeGenContext.PreCompute(Node node, String name, Type
type, Boolean& created)
   at Ruby.Compiler.CodeGenContext.PreCompute(Node node, String name,
Boolean& created)
   at Ruby.Compiler.AST.METHOD_CALL.GenCode0(CodeGenContext context)
   at Ruby.Compiler.CodeGenContext.PreCompute0(Node node, String name,
Boolean& created)
   at Ruby.Compiler.AST.ARGS.GenFixedArgs(CodeGenContext context, List`1&
created)
   at Ruby.Compiler.AST.METHOD_CALL.GenCode0(CodeGenContext context)
   at Ruby.Compiler.AST.Node.GenCode(CodeGenContext context)
   at Ruby.Compiler.AST.OP_ASGN2.GenCode0(CodeGenContext context)
   at Ruby.Compiler.AST.Node.GenCode(CodeGenContext context)
   at Ruby.Compiler.AST.Scope.AddScopeBody(CodeGenContext context)
   at Ruby.Compiler.AST.SOURCEFILE.GenerateClassForFile(CodeGenContext
context, String file_name, Boolean autoLoad, List`1 files)
   at Ruby.Compiler.AST.SOURCEFILE.GenerateCode(String fullFileName, String
dll_or_exe, List`1 runtime_options)
   at Ruby.Compiler.RubyEntry.Process(String[] args)
   at RubyMain.Main(String[] args) in C:\ruby.net\src\Ruby\Main.cs:line 5

Original issue reported on code.google.com by sason...@gmail.com on 13 Sep 2007 at 1:37

GoogleCodeExporter commented 8 years ago

Original comment by DrWayneK...@gmail.com on 14 Sep 2007 at 6:12