Skip to content

Commit

Permalink
Recover from TypeErrors in isErroneous
Browse files Browse the repository at this point in the history
Fixes #15283 (hopefully)
  • Loading branch information
odersky committed Jun 14, 2022
1 parent 836ed97 commit 5c3ef81
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion compiler/src/dotty/tools/dotc/core/Types.scala
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,8 @@ object Types {
*
*/
def isErroneous(using Context): Boolean =
widen.existsPart(_.isError, forceLazy = false)
try widen.existsPart(_.isError, forceLazy = false)
catch case ex: TypeError => true

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

0 comments on commit 5c3ef81

Please sign in to comment.