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 # [#<singleton>, 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/