Issue #15891 has been reported by flori (Florian Frank).

----------------------------------------
Bug #15891: FrozenError when assigning frozen class to constant
https://bugs.ruby-lang.org/issues/15891

* Author: flori (Florian Frank)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.7.0dev (2019-05-31 master 1457ad1ea7) [x86_64-darwin17]
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
This code used to work in Ruby 2.6 and before: `C = Class.new.freeze`. Now it raises a FrozenError for class and module instances, while other frozen things seem to still work.

I am not sure if this is a bug or an intentional change. A possible workaround is

```
C = Class.new
C.freeze
```

which works fine.




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