ruby/lib/rdoc/code_object
Mike Dalessio 4cce246d86 [ruby/rdoc] ClassModule#superclass= accepts a ClassModule as an
argument
(https://github.com/ruby/rdoc/pull/1222)

It is necessary for ClassModule's instance variable @superclass to
always be a String (or nil) so that the class can be saved with
`#marshal_dump` and loaded with `#marshal_load`.

However, there's no type checking being done, which allows a bug like
the one reported in #1221 (which was introduced in #1217) that sets
superclass to a ClassModule. That bug requires:

- setting a superclass to a NormalClass
- marshal_save
- marshal_load (which raises an exception)

With this change, passing a ClassModule to ClassModule#superclass= is
explicitly allowed by saving the full name of the ClassModule in the
@superclass instance variable.

9ced6d534c
2024-12-02 22:07:31 +00:00
..
context
alias.rb
anon_class.rb
any_method.rb
attr.rb
class_module.rb [ruby/rdoc] ClassModule#superclass= accepts a ClassModule as an 2024-12-02 22:07:31 +00:00
constant.rb
context.rb
extend.rb
ghost_method.rb
include.rb
meta_method.rb
method_attr.rb [ruby/rdoc] Methods are sorted symbols-first 2024-11-30 16:06:54 +00:00
mixin.rb
normal_class.rb
normal_module.rb
require.rb
single_class.rb
top_level.rb