[ruby-core:101937] [Ruby master Bug#17193] Endless method definition doesn't work with lambdas in IRB
From:
aycabta@...
Date:
2021-01-05 19:43:02 UTC
List:
ruby-core #101937
Issue #17193 has been updated by aycabta (aycabta .).
Status changed from Open to Closed
As @taiyoslime said, I confirmed that it was fixed in https://github.com/ruby/irb/pull/131.
----------------------------------------
Bug #17193: Endless method definition doesn't work with lambdas in IRB
https://bugs.ruby-lang.org/issues/17193#change-89785
* Author: kodnin (David Boot)
* Status: Closed
* Priority: Normal
* ruby -v: ruby 3.0.0preview1 (2020-09-25 master 0096d2b895) [x86_64-darwin19]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
Endless method definition doesn't work with lambdas. Please check the attached screenshot.
``` ruby
def foo() = 123
# => :foo
foo
# => 123
def bar() = lambda { |x| x * x }
# I expected the method to be defined.
def bar() = ->(x) { x * x }
# Same issue.
```
Nice to have:
``` ruby
def bar = lambda { |x| x * x }
def bar = ->(x) { x * x }
```
---Files--------------------------------
Screenshot 2020-09-26 at 09.19.24.png (714 KB)
--
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>