Skip to content

Commit bf026ad

Browse files
authored
Merge pull request #15442 from dotty-staging/fix-15293
Recover from TypeErrors in isErroneous
2 parents b3725e5 + 5c3ef81 commit bf026ad

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
@@ -354,7 +354,8 @@ object Types {
354354
*
355355
*/
356356
def isErroneous(using Context): Boolean =
357-
widen.existsPart(_.isError, forceLazy = false)
357+
try widen.existsPart(_.isError, forceLazy = false)
358+
catch case ex: TypeError => true
358359

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

0 commit comments

Comments
 (0)