Skip to content

Commit bf58e2b

Browse files
committed
Survive "cannot establish a reference" errors in TreeTypeMap
1 parent 9ba2c39 commit bf58e2b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/src/dotty/tools/dotc/ast/TreeTypeMap.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ class TreeTypeMap(
105105
tree1.withType(mapType(tree1.tpe)) match {
106106
case id: Ident =>
107107
if needsSelect(id.tpe) then
108-
ref(id.tpe.asInstanceOf[TermRef]).withSpan(id.span)
108+
try ref(id.tpe.asInstanceOf[TermRef]).withSpan(id.span)
109+
catch case ex: TypeError => super.transform(id)
109110
else
110111
super.transform(id)
111112
case sel: Select =>

0 commit comments

Comments
 (0)