From 5c3ef810d1e8e3fdde3cfc115a850748a95dbbdf Mon Sep 17 00:00:00 2001 From: odersky Date: Tue, 14 Jun 2022 14:29:14 +0200 Subject: [PATCH] Recover from TypeErrors in isErroneous Fixes #15283 (hopefully) --- compiler/src/dotty/tools/dotc/core/Types.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/src/dotty/tools/dotc/core/Types.scala b/compiler/src/dotty/tools/dotc/core/Types.scala index 6a5d48866158..838754d13299 100644 --- a/compiler/src/dotty/tools/dotc/core/Types.scala +++ b/compiler/src/dotty/tools/dotc/core/Types.scala @@ -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