Project

General

Profile

Actions

Bug #15891

closed

FrozenError when assigning frozen class to constant

Added by flori (Florian Frank) over 5 years ago. Updated over 5 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.7.0dev (2019-05-31 master 1457ad1ea7) [x86_64-darwin17]
[ruby-core:92911]

Description

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.


Related issues 1 (0 open1 closed)

Related to Ruby master - Feature #15765: [PATCH] Module#name without global constant searchClosedActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0