Closed hachi8833 closed 6 years ago
I found that current Class#singleton_class causes panic when applying to objects other than classes:
Class#singleton_class
Goby 0.1.7 😍 😺 🤤 » "a".singleton_class panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x43d1b35] goroutine 1 [running]: github.com/goby-lang/goby/vm.(*RClass).toString(0x0, 0xc4201c2a80, 0xffffffffffffffff) /Users/hachi8833/deve/golang/gopath/sys/src/github.com/goby-lang/goby/vm/class.go:1205 +0x5 github.com/goby-lang/goby/vm.(*VM).GetREPLResult(0xc4200a6820, 0xc42000ea88, 0x1) /Users/hachi8833/deve/golang/gopath/sys/src/github.com/goby-lang/goby/vm/repl.go:73 +0x4e github.com/goby-lang/goby/igb.StartIgb(0x4577b0d, 0x5) /Users/hachi8833/deve/golang/gopath/sys/src/github.com/goby-lang/goby/igb/repl.go:233 +0xd34 main.main() /Users/hachi8833/deve/golang/gopath/sys/src/github.com/goby-lang/goby/goby.go:29 +0x954
According to http://devdocs.io/ruby~2.5/object#method-i-singleton_class:
Returns the singleton class of obj. This method creates a new singleton class if obj does not have one.
The feature to create a new singleton class is missing in current Goby.
@hachi8833 thanks for reporting. Does this blocks anything?
Not yet so far.
@saveriomiroddi Can you help me on this?
I think I'm going to be pretty busy for a while with a separate Ruby project :cry:
I found that current
Class#singleton_class
causes panic when applying to objects other than classes:According to http://devdocs.io/ruby~2.5/object#method-i-singleton_class:
The feature to create a new singleton class is missing in current Goby.