Skip to content

Commit 47cb24c

Browse files
Backport "Don't dealias when deciding which arguments to defer" to LTS (#21041)
Backports #20116 to the LTS branch. PR submitted by the release tooling. [skip ci]
2 parents e1524d6 + acda88c commit 47cb24c

File tree

5 files changed

+10
-2
lines changed

5 files changed

+10
-2
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -1630,8 +1630,8 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
16301630
* comparison will instantiate or constrain type variables first.
16311631
*/
16321632
def isIncomplete(arg1: Type, arg2: Type): Boolean =
1633-
val arg1d = arg1.strippedDealias
1634-
val arg2d = arg2.strippedDealias
1633+
val arg1d = arg1.stripped
1634+
val arg2d = arg2.stripped
16351635
(v >= 0) && (arg1d.isInstanceOf[AndType] || arg2d.isInstanceOf[OrType])
16361636
||
16371637
(v <= 0) && (arg1d.isInstanceOf[OrType] || arg2d.isInstanceOf[AndType])
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
public abstract class AbstractShapeBuilder<B extends AbstractShapeBuilder<B, S>, S extends Shape> {
2+
abstract public B addTrait(Trait trait);
3+
}

tests/pos/i20078/Shape.java

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
public interface Shape {}

tests/pos/i20078/Test.scala

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@main def Test =
2+
val builder: AbstractShapeBuilder[? <: AbstractShapeBuilder[?, ?], ? <: Shape] = ???
3+
List.empty[Trait].foreach(builder.addTrait(_))

tests/pos/i20078/Trait.java

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
public interface Trait {}

0 commit comments

Comments
 (0)