From 1c185414794282e6ff545d695ca938cde4aa7492 Mon Sep 17 00:00:00 2001 From: Hamish Knight Date: Fri, 10 Oct 2025 12:13:33 +0100 Subject: [PATCH] [AST] Simplify `Type::isBareErrorType` Missed this when I changed `ErrorType::get` to flatten nested ErrorTypes on construction, we no longer need to check for the recursive case here. --- include/swift/AST/Types.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/include/swift/AST/Types.h b/include/swift/AST/Types.h index bf44de8fd514b..48427618f870c 100644 --- a/include/swift/AST/Types.h +++ b/include/swift/AST/Types.h @@ -8132,13 +8132,7 @@ inline ASTContext &TypeBase::getASTContext() const { inline bool TypeBase::isBareErrorType() const { auto *errTy = dyn_cast(this); - if (!errTy) - return false; - - // FIXME: We shouldn't need to check for a recursive bare error type, we can - // remove this once we flatten them. - auto originalTy = errTy->getOriginalType(); - return !originalTy || originalTy->isBareErrorType(); + return errTy && !errTy->getOriginalType(); } // TODO: This will become redundant once InOutType is removed.