Skip to content

Commit 432889e

Browse files
Refactoring
1 parent 21820c2 commit 432889e

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

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

+3-4
Original file line numberDiff line numberDiff line change
@@ -1993,7 +1993,7 @@ class TypeComparer(initctx: Context) extends ConstraintHandling[AbsentContext] {
19931993
covariantIntersecting(arg1, arg2, tparam) && (isSameType(arg1, arg2) || {
19941994
// We can only trust a "no" from `isSameType` when both
19951995
// `arg1` and `arg2` are fully instantiated.
1996-
val fullyInstantiated = new TypeAccumulator[Boolean] {
1996+
def fullyInstantiated(tp: Type): Boolean = new TypeAccumulator[Boolean] {
19971997
override def apply(x: Boolean, t: Type) =
19981998
x && {
19991999
t match {
@@ -2002,9 +2002,8 @@ class TypeComparer(initctx: Context) extends ConstraintHandling[AbsentContext] {
20022002
case _ => foldOver(x, t)
20032003
}
20042004
}
2005-
}
2006-
!(fullyInstantiated.apply(true, arg1) &&
2007-
fullyInstantiated.apply(true, arg2))
2005+
}.apply(true, tp)
2006+
!(fullyInstantiated(arg1) && fullyInstantiated(arg2))
20082007
})
20092008
}
20102009
case (tp1: HKLambda, tp2: HKLambda) =>

library/src-bootstrapped/scala/compiletime/package.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ package object compiletime {
1111
inline def constValue[T]: T = ???
1212

1313
type S[X <: Int] <: Int
14-
}
14+
}

tests/run/tuples1.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,4 @@ object Test extends App {
9494
val us0: 0 = size(())
9595
val x3s1: 3 = size0(x3)
9696
val us1: 0 = size0(())
97-
}
97+
}

0 commit comments

Comments
 (0)