Project

General

Profile

Actions

Feature #18461

closed

closures are capturing unused variables

Added by bughit (bug hit) almost 3 years ago. Updated over 2 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
[ruby-core:106977]

Description

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)

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0