Skip to content

Commit 55ecbfc

Browse files
committed
Use isProvisional instead of has LazyRef
1 parent c25edde commit 55ecbfc

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

compiler/src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2376,8 +2376,8 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
23762376
val bound2 = if tree.bound.isEmpty then
23772377
val lub = cases1.foldLeft(defn.NothingType: Type): (acc, case1) =>
23782378
if !acc.exists then NoType
2379-
else if case1.body.tpe.existsPart(_.isInstanceOf[LazyRef]) then NoType
2380-
else acc | TypeOps.avoid(case1.body.tpe, patVars(case1))
2379+
else if case1.body.tpe.isProvisional then NoType
2380+
else acc | case1.body.tpe
23812381
if lub.exists then TypeTree(lub, inferred = true)
23822382
else bound1
23832383
else bound1

tests/pos/Tuple.Drop.scala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import compiletime.ops.int.*
2+
3+
type Drop[T <: Tuple, N <: Int] <: Tuple = N match
4+
case 0 => T
5+
case S[n1] => T match
6+
case EmptyTuple => EmptyTuple
7+
case x *: xs => Drop[xs, n1]

tests/pos/Tuple.Elem.scala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import compiletime.ops.int.*
2+
3+
type Elem[T <: Tuple, I <: Int] = T match
4+
case h *: tail =>
5+
I match
6+
case 0 => h
7+
case S[j] => Elem[tail, j]

0 commit comments

Comments
 (0)