Skip to content

Commit 9de1a79

Browse files
authored
Merge pull request #42362 from DougGregor/preconcurrency-silence-swiftinterface
2 parents b175165 + aad67a8 commit 9de1a79

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

lib/Sema/TypeChecker.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff 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.
270270
static 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) &&
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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

0 commit comments

Comments
 (0)