From: "alanwu (Alan Wu) via ruby-core" Date: 2026-11-21T02:01:22+00:00 Subject: [ruby-core:127653] [Ruby Bug#22616] SystemStackError from `super` when refining a method from a module that appears twice in ancestry Issue #22616 has been reported by alanwu (Alan Wu). ---------------------------------------- Bug #22616: SystemStackError from `super` when refining a method from a module that appears twice in ancestry https://bugs.ruby-lang.org/issues/22616 * Author: alanwu (Alan Wu) * Status: Open * Backport: 3.3: DONTNEED, 3.4: DONTNEED, 4.0: DONTNEED ---------------------------------------- ```ruby class C0; end; class C1 < C0; end module M1; end c0 = C0.new c1 = C1.new.extend(M1) module R1; refine(M1) { def m = super }; end C0.prepend M1 p c1.singleton_class.ancestors # [#, M1, C1, M1, C0, ...] using R1 c1.m # SystemStackError; should be NoMethodError c0.m # SystemStackError too, but NoMethodError if the line above is removed ``` Bisected to commit:3a66844fa9 [Feature #22309], so trunk-only. -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/