[#97086] [Ruby master Bug#16612] Enumerator::ArithmeticSequence#last with float range produces incorrect value — muraken@...
Issue #16612 has been updated by mrkn (Kenta Murata).
4 messages
2020/02/07
[#97095] [PATCH] Modify shebang of libexec/y2racc and libexec/racc2y. — Wang Mingyu <wangmy@...>
change /usr/local/bin/ruby to /usr/bin/env ruby.
3 messages
2020/02/08
[#97307] [Ruby master Feature#16663] Add block or filtered forms of Kernel#caller to allow early bail-out — headius@...
Issue #16663 has been reported by headius (Charles Nutter).
29 messages
2020/02/28
[ruby-core:97041] [Ruby master Bug#16599] did_you_mean is not activated for NameError and KeyError
From:
merch-redmine@...
Date:
2020-02-02 02:10:59 UTC
List:
ruby-core #97041
Issue #16599 has been updated by jeremyevans0 (Jeremy Evans).
Status changed from Open to Closed
As @zverok 's analysis shows, did_you_mean does activate for NameError and KeyError if it can find suggestions.
As for not suggesting `for` for `foo` in `NameError` but doing so for `NoMethodError`, I can't tell if that is a bug in did_you_mean. It doesn't seem to be general behavior for keywords, since did_you_mean recommends `while` for `whil` in both cases. If you think it is a bug in did_you_mean, you may want to file it upstream: https://github.com/ruby/did_you_mean/issues
----------------------------------------
Bug #16599: did_you_mean is not activated for NameError and KeyError
https://bugs.ruby-lang.org/issues/16599#change-84134
* Author: sawa (Tsuyoshi Sawada)
* Status: Closed
* Priority: Normal
* Assignee: yuki24 (Yuki Nishijima)
* ruby -v: 2.6, 2.7, perhaps for earlier versions too
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
[This document](https://www.rubydoc.info/gems/did_you_mean/) claims that the did_you_mean gem responds to NameError, NoMethodError, and KeyError, but it actually seems to only respond to NoMethodError.
```ruby
foo()
# >> NoMethodError: undefined method `foo' for main:Object
# >> Did you mean? for
foo
# >> NameError: undefined local variable or method `foo' for main:Object
Foo
# >> NameError: uninitialized constant Foo
{foo: 1}.fetch(:bar)
# >> KeyError: key not found: :bar
```
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>