From: matz@... Date: 2019-01-31T08:02:10+00:00 Subject: [ruby-core:91352] [Ruby trunk Feature#15575] Prohibit to pass a block singleton class Issue #15575 has been updated by matz (Yukihiro Matsumoto). Agreed to prohibit. Disagree to change the scoping rule (@alanwu). Matz. ---------------------------------------- Feature #15575: Prohibit to pass a block singleton class https://bugs.ruby-lang.org/issues/15575#change-76604 * Author: ko1 (Koichi Sasada) * Status: Open * Priority: Normal * Assignee: matz (Yukihiro Matsumoto) * Target version: ---------------------------------------- The following code works now: ``` def foo class << Object.new yield end end foo{ p :ok } #=> :ok ``` but I think this feature is very strange because local variables are not active in singleton class. How about to prohibit this feature? plan: warning at ruby 2.7 and prohibit it in ruby 3. -- https://bugs.ruby-lang.org/ Unsubscribe: