diff --git a/lib/Frontend/DiagnosticVerifier.cpp b/lib/Frontend/DiagnosticVerifier.cpp index 2cf53f226cf9a..6720247c5fb46 100644 --- a/lib/Frontend/DiagnosticVerifier.cpp +++ b/lib/Frontend/DiagnosticVerifier.cpp @@ -15,6 +15,7 @@ //===----------------------------------------------------------------------===// #include "swift/Frontend/DiagnosticVerifier.h" +#include "swift/AST/DiagnosticsFrontend.h" #include "swift/Basic/Assertions.h" #include "swift/Basic/ColorUtils.h" #include "swift/Basic/SourceManager.h" @@ -1264,6 +1265,10 @@ void DiagnosticVerifier::printRemainingDiagnostics() const { /// file. void DiagnosticVerifier::handleDiagnostic(SourceManager &SM, const DiagnosticInfo &Info) { + // Ignore "fatal error encountered while in -verify mode" errors, + // because there's no reason to verify them. + if (Info.ID == diag::verify_encountered_fatal.ID) + return; SmallVector fixIts; for (const auto &fixIt : Info.FixIts) { fixIts.emplace_back(SM, fixIt); diff --git a/test/Frontend/DiagnosticVerifier/expect-the-expected.swift b/test/Frontend/DiagnosticVerifier/expect-the-expected.swift new file mode 100644 index 0000000000000..b026dfebf1806 --- /dev/null +++ b/test/Frontend/DiagnosticVerifier/expect-the-expected.swift @@ -0,0 +1,3 @@ +// RUN: %target-typecheck-verify-swift + +import Expected // expected-error {{no such module 'Expected'}}