Skip to content

Commit 16d1856

Browse files
committed
Propagate bound into nested match types
1 parent c51a2c0 commit 16d1856

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1317,7 +1317,9 @@ class Typer extends Namer
13171317
}
13181318

13191319
def typedMatchTypeTree(tree: untpd.MatchTypeTree, pt: Type)(implicit ctx: Context): Tree = {
1320-
val bound1 = typed(tree.bound)
1320+
val bound1 =
1321+
if (tree.bound.isEmpty && isFullyDefined(pt, ForceDegree.none)) TypeTree(pt)
1322+
else typed(tree.bound)
13211323
val sel1 = typed(tree.selector)
13221324
val pt1 = if (bound1.isEmpty) pt else bound1.tpe
13231325
val cases1 = tree.cases.mapconserve(typedTypeCase(_, sel1.tpe, pt1))

0 commit comments

Comments
 (0)