Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$ cat singleton_class.mrb class Klass def self.meth :result end end o = Klass.new # o.singleton_class.singleton_class p o.singleton_class.meth
Running this raises an error:
$ ./mruby singleton_class.mrb trace: [0] singleton_class.mrb:10 NoMethodError: undefined method 'meth' for #<Class:#<Klass:0x213e350>>
Explicitly accessing the singleton class of the singleton class (uncommenting the commented line in singleton_class.mrb) prevents the issue and prints :result.
:result
The text was updated successfully, but these errors were encountered:
fa502b4
No branches or pull requests
christopheraue commentedMar 14, 2017
Running this raises an error:
Explicitly accessing the singleton class of the singleton class (uncommenting the commented line in singleton_class.mrb) prevents the issue and prints
:result
.The text was updated successfully, but these errors were encountered: