Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip freezing check on setting temporary class path [Bug #17563] #4101

Merged
merged 1 commit into from
Jan 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions test/ruby/test_class.rb
Original file line number Diff line number Diff line change
Expand Up @@ -730,4 +730,11 @@ def (Array.singleton_class).bla; :bla; end
end;

end

def test_assign_frozen_class_to_const
c = Class.new.freeze
assert_same(c, Module.new.module_eval("self::Foo = c"))
c = Class.new.freeze
assert_same(c, Module.new.const_set(:Foo, c))
end
end
2 changes: 1 addition & 1 deletion variable.c
Original file line number Diff line number Diff line change
Expand Up @@ -3058,7 +3058,7 @@ rb_const_set(VALUE klass, ID id, VALUE val)
set_namespace_path(val, build_const_path(parental_path, id));
}
else if (!parental_path_permanent && NIL_P(val_path)) {
rb_ivar_set(val, tmp_classpath, build_const_path(parental_path, id));
ivar_set(val, tmp_classpath, build_const_path(parental_path, id));
}
}
}
Expand Down