Skip to content

Commit f5972c7

Browse files
committed
Fix testing in tree checker.
Tree checker typed always dropped the expected type and replaced it by a wildcard. This meant that type checking dor -Ycheck was much weaker than it should be. A class of GADT problems is only diagnosed once the expected type is proberly propagated.
1 parent b300542 commit f5972c7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/dotty/tools/dotc/transform/TreeChecker.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ class TreeChecker extends Phase with SymTransformer {
258258
}
259259

260260
override def typed(tree: untpd.Tree, pt: Type = WildcardType)(implicit ctx: Context): tpd.Tree = {
261-
val tpdTree = super.typed(tree)
261+
val tpdTree = super.typed(tree, pt)
262262
checkIdentNotJavaClass(tpdTree)
263263
tpdTree
264264
}

0 commit comments

Comments
 (0)