File tree Expand file tree Collapse file tree 3 files changed +16
-2
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 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]
Original file line number Diff line number Diff line change 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]
You can’t perform that action at this time.
0 commit comments