From: "kddnewton (Kevin Newton) via ruby-core" Date: 2024-12-21T18:47:21+00:00 Subject: [ruby-core:120356] [Ruby master Bug#20970] `it /1/i` raises undefined method 'it' for main (NoMethodError) even if binding.local_variables includes `it` Issue #20970 has been updated by kddnewton (Kevin Newton). I'm not sure if I'm reading this correctly or not. Is there any action required on Prism's side as of right now? Happy to make changes, though we are getting close to the release. ---------------------------------------- Bug #20970: `it /1/i` raises undefined method 'it' for main (NoMethodError) even if binding.local_variables includes `it` https://bugs.ruby-lang.org/issues/20970#change-111135 * Author: tompng (tomoya ishida) * Status: Open * ruby -v: ruby 3.4.0dev (2024-12-19T07:16:12Z master 335bba0fde) +PRISM [x86_64-linux] * Backport: 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONTNEED ---------------------------------------- `it` parameter became a local variable with #20965, but it does not behave like local variable with `--parser=prism` ~~~ruby i=2 42.tap do p it # 42 p local_variables # [:it, :i] p it /1/i # should be 21, got NoMethodError end ~~~ It prints `42`, `[:it, :i], `21` with `--parser=parse.y` -- 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/