Skip to content

Commit ad71e07

Browse files
committed
[AST] Don't print using declarations in swift interfaces
These declarations are effectively `fileprivate` at the moment and should appear in swift interfaces.
1 parent 36b7711 commit ad71e07

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

lib/AST/ASTPrinter.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,11 @@ PrintOptions PrintOptions::printSwiftInterfaceFile(ModuleDecl *ModuleToPrint,
383383
}
384384
}
385385

386+
// The `using` declarations are private to the file at the moment
387+
// and shouldn't appear in swift interfaces.
388+
if (isa<UsingDecl>(D))
389+
return false;
390+
386391
return ShouldPrintChecker::shouldPrint(D, options);
387392
}
388393
};

test/ModuleInterface/using.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// RUN: %target-swift-emit-module-interface(%t.swiftinterface) %s
2+
3+
// RUN: %target-swift-typecheck-module-from-interface(%t.swiftinterface)
4+
5+
// RUN: %FileCheck %s --input-file %t.swiftinterface
6+
7+
using @MainActor
8+
9+
// CHECK-NOT: using @MainActor

0 commit comments

Comments
 (0)