File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -268,6 +268,16 @@ void swift::performTypeChecking(SourceFile &SF) {
268268// / there were no diagnostics downgraded or suppressed due to that
269269// / @preconcurrency, suggest that the attribute be removed.
270270static void diagnoseUnnecessaryPreconcurrencyImports (SourceFile &sf) {
271+ switch (sf.Kind ) {
272+ case SourceFileKind::Interface:
273+ case SourceFileKind::SIL:
274+ return ;
275+
276+ case SourceFileKind::Library:
277+ case SourceFileKind::Main:
278+ break ;
279+ }
280+
271281 ASTContext &ctx = sf.getASTContext ();
272282 for (const auto &import : sf.getImports ()) {
273283 if (import .options .contains (ImportFlags::Preconcurrency) &&
Original file line number Diff line number Diff line change 1+ // swift-interface-format-version: 1.0
2+ // swift-module-flags: -target x86_64-apple-macos10.9 -module-name SilencePreconcurrency
3+
4+ // RUN: %empty-directory(%t)
5+ // RUN: %target-swift-frontend -compile-module-from-interface -o %/t/SilencePreconcurrency.swiftmodule %s -verify
6+
7+ // REQUIRES: OS=macosx
8+
9+ @preconcurrency import Swift
You can’t perform that action at this time.
0 commit comments