Skip to content

Commit 1629f61

Browse files
committed
Merge pull request scala#4706 from VladUreche/issue/tree-checker
Re-enable tree checkers
2 parents 8292bb3 + 9d73937 commit 1629f61

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/compiler/scala/tools/nsc/typechecker/TreeCheckers.scala

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,14 @@ abstract class TreeCheckers extends Analyzer {
262262
checkedTyped(tree, mode, pt)
263263
)
264264
private def checkedTyped(tree: Tree, mode: Mode, pt: Type): Tree = {
265-
val typed = wrap(tree)(super.typed(tree, mode, pt))
265+
val typed = wrap(tree)(super.typed(tree.clearType(), mode, pt))
266+
267+
// Vlad: super.typed returns null for package defs, why is that?
268+
if (typed eq null)
269+
return tree
270+
271+
if (typed.tpe ne null)
272+
assert(!typed.tpe.isErroneous, "Tree has erroneous type: " + typed)
266273

267274
if (tree ne typed)
268275
treesDiffer(tree, typed)

0 commit comments

Comments
 (0)