Skip to content

Commit 7df36a3

Browse files
committed
Revert following underlyingIfRepeated when matching
This was a left-over from a failed attempt to have OverridingPiars work exclusively by comparing signatures. If we do that then repeated and underlying do have the same signature and therefore are supposed to match. But as @retronym notes, this leads to problems. In any case, we no longer try to make overriding pairs work that way, because it fails for other reasons as well.
1 parent 122cef8 commit 7df36a3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/dotty/tools/dotc/core/TypeComparer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling wi
680680
case formal1 :: rest1 =>
681681
formals2 match {
682682
case formal2 :: rest2 =>
683-
(isSameType(formal1.underlyingIfRepeated(isJava1), formal2.underlyingIfRepeated(isJava2))
683+
(isSameType(formal1, formal2)
684684
|| isJava1 && (formal2 isRef ObjectClass) && (formal1 isRef AnyClass)
685685
|| isJava2 && (formal1 isRef ObjectClass) && (formal2 isRef AnyClass)) &&
686686
matchingParams(rest1, rest2, isJava1, isJava2)

0 commit comments

Comments
 (0)