File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 25
25
#include " swift/AST/Import.h"
26
26
#include " swift/AST/LookupKinds.h"
27
27
#include " swift/AST/Type.h"
28
+ #include " swift/Basic/Assertions.h"
28
29
#include " swift/Basic/BasicSourceInfo.h"
29
30
#include " swift/Basic/Compiler.h"
30
31
#include " swift/Basic/Debug.h"
@@ -388,7 +389,7 @@ class ModuleDecl
388
389
void setBypassResilience () { BypassResilience = true ; }
389
390
390
391
ArrayRef<FileUnit *> getFiles () {
391
- assert (!Files.empty () || failedToLoad ());
392
+ ASSERT (!Files.empty () || failedToLoad ());
392
393
return Files;
393
394
}
394
395
ArrayRef<const FileUnit *> getFiles () const {
Original file line number Diff line number Diff line change @@ -1313,6 +1313,14 @@ ASTContext::synthesizeInvertibleProtocolDecl(InvertibleProtocolKind ip) const {
1313
1313
return proto;
1314
1314
1315
1315
ModuleDecl *stdlib = getStdlibModule ();
1316
+ if (stdlib && stdlib->failedToLoad ()) {
1317
+ stdlib = nullptr ; // Use the Builtin module instead.
1318
+
1319
+ // Ensure we emitted an error diagnostic!
1320
+ if (!Diags.hadAnyError ())
1321
+ Diags.diagnose (SourceLoc (), diag::serialization_load_failed, " Swift" );
1322
+ }
1323
+
1316
1324
FileUnit *file = nullptr ;
1317
1325
if (stdlib) {
1318
1326
file = &stdlib->getFiles ()[0 ]->getOrCreateSynthesizedFile ();
You can’t perform that action at this time.
0 commit comments