Skip to content

Commit 5c3ef81

Browse files
committed
Recover from TypeErrors in isErroneous
Fixes #15283 (hopefully)
1 parent 836ed97 commit 5c3ef81

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/src/dotty/tools/dotc/core/Types.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,8 @@ object Types {
353353
*
354354
*/
355355
def isErroneous(using Context): Boolean =
356-
widen.existsPart(_.isError, forceLazy = false)
356+
try widen.existsPart(_.isError, forceLazy = false)
357+
catch case ex: TypeError => true
357358

358359
/** Is this type unusable for implicit search or overloading resolution
359360
* since it has embedded errors that can match anything? This is weaker and more

0 commit comments

Comments
 (0)