[AST] Don't print using declarations in swift interfaces

These declarations are effectively `fileprivate` at the moment
and should appear in swift interfaces.

(cherry picked from commit ad71e07cae)
This commit is contained in:
Pavel Yaskevich
2025-05-29 16:13:09 -07:00
parent 7d18588f93
commit 4f88004fc0
2 changed files with 14 additions and 0 deletions

View File

@@ -383,6 +383,11 @@ PrintOptions PrintOptions::printSwiftInterfaceFile(ModuleDecl *ModuleToPrint,
}
}
// The `using` declarations are private to the file at the moment
// and shouldn't appear in swift interfaces.
if (isa<UsingDecl>(D))
return false;
return ShouldPrintChecker::shouldPrint(D, options);
}
};

View File

@@ -0,0 +1,9 @@
// RUN: %target-swift-emit-module-interface(%t.swiftinterface) %s
// RUN: %target-swift-typecheck-module-from-interface(%t.swiftinterface)
// RUN: %FileCheck %s --input-file %t.swiftinterface
using @MainActor
// CHECK-NOT: using @MainActor