Skip to content

Commit 976ed6f

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 a469fa8 commit 976ed6f

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
@@ -684,7 +684,7 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling wi
684684
case formal1 :: rest1 =>
685685
formals2 match {
686686
case formal2 :: rest2 =>
687-
(isSameType(formal1.underlyingIfRepeated(isJava1), formal2.underlyingIfRepeated(isJava2))
687+
(isSameType(formal1, formal2)
688688
|| isJava1 && (formal2 isRef ObjectClass) && (formal1 isRef AnyClass)
689689
|| isJava2 && (formal1 isRef ObjectClass) && (formal2 isRef AnyClass)) &&
690690
matchingParams(rest1, rest2, isJava1, isJava2)

0 commit comments

Comments
 (0)