mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[ModuleInterface] Don't print extensions of internal types (#19440)
This commit is contained in:
@@ -109,6 +109,14 @@ PrintOptions PrintOptions::printTextualInterfaceFile() {
|
||||
}
|
||||
}
|
||||
|
||||
// Skip extensions that extend things we wouldn't print.
|
||||
if (auto *ED = dyn_cast<ExtensionDecl>(D)) {
|
||||
if (!shouldPrint(ED->getExtendedNominal(), options))
|
||||
return false;
|
||||
// FIXME: We also need to check the generic signature for constraints
|
||||
// that we can't reference.
|
||||
}
|
||||
|
||||
// Skip typealiases that just redeclare generic parameters.
|
||||
if (auto *alias = dyn_cast<TypeAliasDecl>(D)) {
|
||||
if (alias->isImplicit()) {
|
||||
|
||||
@@ -102,3 +102,12 @@ extension PublicStruct {
|
||||
// CHECK: public private(set) static var secretlySettable: Int{{$}}
|
||||
public private(set) static var secretlySettable: Int = 0
|
||||
} // CHECK: {{^[}]$}}
|
||||
|
||||
extension InternalStruct_BAD: PublicProto {
|
||||
internal static var dummy: Int { return 0 }
|
||||
}
|
||||
|
||||
// CHECK: extension UFIStruct : PublicProto {{[{]$}}
|
||||
extension UFIStruct: PublicProto {
|
||||
internal static var dummy: Int { return 0 }
|
||||
} // CHECK-NEXT: {{^[}]$}}
|
||||
|
||||
Reference in New Issue
Block a user