File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
src/main/ruby/truffleruby/core Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -402,20 +402,21 @@ def values_at(*args)
402
402
# are methods to read them
403
403
404
404
def self . _specialize ( attrs )
405
- # Because people are crazy, they subclass Struct directly, ie.
406
- # class Craptastic < Struct
405
+ # People want to subclass Struct directly, ie.
407
406
#
408
- # NOT
407
+ # class MyCoolStruct < Struct
409
408
#
410
- # class Fine < Struct.new(:x, :y)
409
+ # rather than
411
410
#
412
- # When they do this craptastic act, they'll sometimes define their
413
- # own #initialize and super into Struct#initialize.
411
+ # class MyCoolStruct < Struct.new(:x, :y)
414
412
#
415
- # When they do this and then do Craptastic.new(:x, :y), this code
413
+ # They sometimes then define their own #initialize and super into
414
+ # Struct#initialize.
415
+ #
416
+ # When they do this and then do MyCoolStruct.new(:x, :y), this code
416
417
# will accidentally shadow their #initialize. So for now, only run
417
418
# the specialize if we're trying new Struct's directly from Struct itself,
418
- # not a craptastic Struct subclass.
419
+ # not a Struct subclass.
419
420
420
421
return unless superclass . equal? Struct
421
422
You can’t perform that action at this time.
0 commit comments