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(
2902
2902
if (diagnostics.HadError )
2903
2903
return ;
2904
2904
2905
- diagnostics.HadError = true ;
2906
-
2907
2905
auto *proto = conformance->getProtocol ();
2908
2906
auto *dc = conformance->getDeclContext ();
2909
2907
auto *sf = dc->getParentSourceFile ();
2908
+
2909
+ // FIXME: There should probably still be a diagnostic even without a file.
2910
+ if (!sf)
2911
+ return ;
2912
+
2910
2913
auto *mod = sf->getParentModule ();
2911
2914
assert (mod->isMainModule ());
2912
2915
2916
+ diagnostics.HadError = true ;
2917
+
2913
2918
// If we have at least one primary file and the conformance is declared in a
2914
2919
// non-primary file, emit a fallback diagnostic.
2915
2920
if ((!sf->isPrimary () && !mod->getPrimarySourceFiles ().empty ()) ||
You can’t perform that action at this time.
0 commit comments