From: "bughit (bug hit)" Date: 2022-01-06T16:26:14+00:00 Subject: [ruby-core:106984] [Ruby master Feature#18461] closures are capturing unused variables Issue #18461 has been updated by bughit (bug hit). > But, maybe we could deprecate Proc#binding and remove it, I think that would be a good start. There's no such need. If the capture is optimized then Proc#binding will continue giving access to what has been captured, rather than everything that could be captured. ---------------------------------------- Feature #18461: closures are capturing unused variables https://bugs.ruby-lang.org/issues/18461#change-95815 * Author: bughit (bug hit) * Status: Open * Priority: Normal ---------------------------------------- ```rb def foo a = 1 ->{} end p foo.binding.local_variables # [:a] ``` Shouldn't `a` be optimized away? Like v8 does (https://bugs.chromium.org/p/v8/issues/detail?id=3491) -- https://bugs.ruby-lang.org/ Unsubscribe: