Skip to content

freeze does not freeze singleton_class #2093

@marcandre

Description

@marcandre
o = Object.new
o.singleton_class # needed for bug
o.freeze
def o.foo
  42
end # => succeeds, should raise `FrozenError`
p o.foo # => 42

Note that calling singleton_class is necessary to create the bug, I presume because it forces the creation of the singleton_class before freezing.

$ ruby -v
truffleruby 20.3.0-dev-80339253, like ruby 2.6.6, GraalVM CE Native [x86_64-darwin]

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions