Issue #15575 has been updated by Eregon (Benoit Daloze).


ko1 (Koichi Sasada) wrote:
> We can break from `class` syntax.
> I hope nobody use it :(

At least TruffleRuby doesn't implement it, and we had no bug report about this, so hopefully not used.
Agreed it should be deprecated/removed as it's confusing at best.

----------------------------------------
Feature #15575: Prohibit to pass a block singleton class
https://bugs.ruby-lang.org/issues/15575#change-76594

* 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: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>