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

Support Struct#[] and Struct#[]= typo #73

Merged
merged 1 commit into from Mar 25, 2016
Merged

Conversation

ksss
Copy link
Contributor

@ksss ksss commented Mar 6, 2016

Actually, We cannot suggest from did_you_mean when typo at Struct#[] and Struct#[]= key.

Foo = Struct.new(:foo)
Foo.new[:fooo]
#=> NameError: no member 'fooo' in struct

I want to save this case.

Foo = Struct.new(:foo)
Foo.new[:fooo]
#=> NameError: no member 'fooo' in struct
Did you mean?  foo
               foo=

Now, "no member ..." message only make from here https://github.com/ksss/ruby/blob/cee9c58ef214cbbf10aedacd79c3b796eb5bba8e/struct.c#L868

@yuki24 yuki24 merged commit 0034ae6 into ruby:master Mar 25, 2016
@yuki24
Copy link
Member

yuki24 commented Mar 25, 2016

Thanks!

@ksss ksss deleted the support-struct branch March 25, 2016 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants