Skip to content
New issue

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

Cannot set instance variables in NilClass #438

Closed
masuidrive opened this issue Aug 22, 2012 · 1 comment
Closed

Cannot set instance variables in NilClass #438

masuidrive opened this issue Aug 22, 2012 · 1 comment

Comments

@masuidrive
Copy link
Contributor

Cannot set instance variables in NilClass.

class NilClass
    def set_a
        @a = 0
    end
end
nil.set_a
=> ArgumentError: cannot set instance variable
@matz
Copy link
Member

matz commented Aug 22, 2012

It's a limitation of mruby, unlike CRuby, immediate values cannot have instance variables.
If the real problem is instance variables at top-level, it will be addressed by #327.

@matz matz closed this as completed Aug 22, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants