mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[AST] Don't print using declarations in swift interfaces
These declarations are effectively `fileprivate` at the moment and should appear in swift interfaces.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
9
test/ModuleInterface/using.swift
Normal file
9
test/ModuleInterface/using.swift
Normal 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
|
||||
Reference in New Issue
Block a user