File tree 3 files changed +16
-2
lines changed
compiler/src/dotty/tools/dotc/typer
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
2376
2376
val bound2 = if tree.bound.isEmpty then
2377
2377
val lub = cases1.foldLeft(defn.NothingType : Type ): (acc, case1) =>
2378
2378
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
2381
2381
if lub.exists then TypeTree (lub, inferred = true )
2382
2382
else bound1
2383
2383
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