[#101179] Spectre Mitigations — Amel <amel.smajic@...>
Hi there!
5 messages
2020/12/01
[#101694] Ruby 3.0.0 Released — "NARUSE, Yui" <naruse@...>
V2UgYXJlIHBsZWFzZWQgdG8gYW5ub3VuY2UgdGhlIHJlbGVhc2Ugb2YgUnVieSAzLjAuMC4gRnJv
4 messages
2020/12/25
[ruby-core:101209] [Ruby master Feature#17361] lambda(&block) does not warn with lazy proc allocation
From:
zn@...
Date:
2020-12-03 02:45:24 UTC
List:
ruby-core #101209
Issue #17361 has been reported by znz (Kazuhiro NISHIYAMA).
----------------------------------------
Feature #17361: lambda(&block) does not warn with lazy proc allocation
https://bugs.ruby-lang.org/issues/17361
* Author: znz (Kazuhiro NISHIYAMA)
* Status: Open
* Priority: Normal
----------------------------------------
In NEWS,
```
* Kernel#lambda now warns if called without a literal block.
[[Feature #15973]]
```
But the following code from https://docs.ruby-lang.org/ja/latest/method/Kernel/m/lambda.html (<https://github.com/rurema/doctree/blob/495868c466c97c9bcca28d64d6ce0d68350de3e2/refm/api/src/_builtin/functions#L2436-L2441>) does not warn.
```ruby
def foo &block
lambda(&block)
end
it = foo{p 12}
it.call #=> 12
```
Once block assign to a local variable, it warns.
```ruby
def foo &block
b = block
lambda(&b)
end
it = foo{p 12}
it.call #=> 12
```
--
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>