From: "bughit (bug hit)" Date: 2022-01-05T23:45:09+00:00 Subject: [ruby-core:106977] [Ruby master Feature#18461] closures are capturing unused variables Issue #18461 has been reported by bughit (bug hit). ---------------------------------------- Feature #18461: closures are capturing unused variables https://bugs.ruby-lang.org/issues/18461 * 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: