Project

General

Profile

Actions

Bug #21776

open

Binding#local_variable_defined? still supports numbered parameters

Bug #21776: Binding#local_variable_defined? still supports numbered parameters

Added by zverok (Victor Shepelev) about 4 hours ago.

Status:
Open
Assignee:
-
Target version:
-
ruby -v:
ruby 4.0.0dev (2025-12-11T18:57:06Z master d02c971574) +PRISM [x86_64-linux]
[ruby-core:124157]

Description

On the freshest master:

[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:

[1].each { it; p binding.local_variable_defined?(:it) }
#=> false

No data to display

Actions

Also available in: PDF Atom