From: "zverok (Victor Shepelev) via ruby-core" Date: 2025-12-11T20:01:37+00:00 Subject: [ruby-core:124157] [Ruby Bug#21776] Binding#local_variable_defined? still supports numbered parameters Issue #21776 has been reported by zverok (Victor Shepelev). ---------------------------------------- Bug #21776: Binding#local_variable_defined? still supports numbered parameters https://bugs.ruby-lang.org/issues/21776 * Author: zverok (Victor Shepelev) * Status: Open * ruby -v: ruby 4.0.0dev (2025-12-11T18:57:06Z master d02c971574) +PRISM [x86_64-linux] * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- On the freshest `master`: ```ruby [1].each {_1; p binding.local_variable_defined?(:_1) } #=> true ``` It is inconsistent with changes in `#local_variables`/`#local_variable_get`/`#local_variable_set`. And inconsistent with handling of `it`: ```ruby [1].each { it; p binding.local_variable_defined?(:it) } #=> false ``` -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/