File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -2902,14 +2902,19 @@ static void maybeEmitFallbackConformanceDiagnostic(
29022902 if (diagnostics.HadError )
29032903 return ;
29042904
2905- diagnostics.HadError = true ;
2906-
29072905 auto *proto = conformance->getProtocol ();
29082906 auto *dc = conformance->getDeclContext ();
29092907 auto *sf = dc->getParentSourceFile ();
2908+
2909+ // FIXME: There should probably still be a diagnostic even without a file.
2910+ if (!sf)
2911+ return ;
2912+
29102913 auto *mod = sf->getParentModule ();
29112914 assert (mod->isMainModule ());
29122915
2916+ diagnostics.HadError = true ;
2917+
29132918 // If we have at least one primary file and the conformance is declared in a
29142919 // non-primary file, emit a fallback diagnostic.
29152920 if ((!sf->isPrimary () && !mod->getPrimarySourceFiles ().empty ()) ||
You can’t perform that action at this time.
0 commit comments