ConstExtract: Update for noncopyable generics (sort of)

This commit is contained in:
Slava Pestov
2024-03-01 11:05:54 -05:00
parent c18c7a610c
commit 37dbd05354
11 changed files with 19 additions and 32 deletions

View File

@@ -776,6 +776,10 @@ void writeResultBuilderInformation(llvm::json::OStream &JSON,
for (ProtocolDecl *Decl :
TypeDecl->getLocalProtocols(ConformanceLookupKind::All)) {
// FIXME(noncopyable_generics): Should these be included?
if (Decl->getInvertibleProtocolKind())
continue;
for (auto Member : Decl->getMembers()) {
if (auto *VD = dyn_cast<swift::VarDecl>(Member)) {
if (VD->getName() != VarDecl->getName())
@@ -840,9 +844,16 @@ void writeSubstitutedOpaqueTypeAliasDetails(
// Ignore requirements whose subject type is that of the owner decl
if (!Requirement.getFirstType()->isEqual(OpaqueTy.getInterfaceType()))
continue;
if (Requirement.getKind() == RequirementKind::Conformance)
JSON.value(
toFullyQualifiedProtocolNameString(*Requirement.getProtocolDecl()));
if (Requirement.getKind() != RequirementKind::Conformance)
continue;
// FIXME(noncopyable_generics): Should these be included?
if (Requirement.getProtocolDecl()->getInvertibleProtocolKind())
continue;
JSON.value(
toFullyQualifiedProtocolNameString(*Requirement.getProtocolDecl()));
}
});
@@ -920,7 +931,11 @@ void writeProperties(llvm::json::OStream &JSON,
void writeConformances(llvm::json::OStream &JSON,
const NominalTypeDecl &NomTypeDecl) {
JSON.attributeArray("conformances", [&] {
for (auto &Protocol : NomTypeDecl.getAllProtocols()) {
for (auto *Protocol : NomTypeDecl.getAllProtocols()) {
// FIXME(noncopyable_generics): Should these be included?
if (Protocol->getInvertibleProtocolKind())
continue;
JSON.value(toFullyQualifiedProtocolNameString(*Protocol));
}
});

View File

@@ -172,4 +172,3 @@ public struct DeprecatedAnnotations: MyProto {}
// CHECK-NEXT: }
// CHECK-NEXT:]
// XFAIL: noncopyable_generics

View File

@@ -156,6 +156,3 @@ public struct Bat {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT:]
// XFAIL: noncopyable_generics

View File

@@ -65,6 +65,3 @@ enum DirectOnEnum {
// CHECK: "kind": "enum",
// CHECK: "cases": [
// CHECK: "name": "yes"
// XFAIL: noncopyable_generics

View File

@@ -227,6 +227,3 @@ public struct Enums: MyProto {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT:]
// XFAIL: noncopyable_generics

View File

@@ -31,6 +31,3 @@ extension MyType {
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: ]
// XFAIL: noncopyable_generics

View File

@@ -333,6 +333,3 @@ extension String: Foo {}
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT:]
// XFAIL: noncopyable_generics

View File

@@ -548,6 +548,3 @@ public struct PropertyWrappers : MyProto {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT:]
// XFAIL: noncopyable_generics

View File

@@ -55,6 +55,3 @@ struct Foo<L : Hashable> : myProto {
// CHECK-NEXT: "properties": []
// CHECK-NEXT: }
// CHECK-NEXT: ]
// XFAIL: noncopyable_generics

View File

@@ -71,6 +71,3 @@ private func baz() -> some protoA<testModBStruct> & protoB<Float> & testModBProt
// CHECK-NEXT: "properties": []
// CHECK-NEXT: }
// CHECK-NEXT:]
// XFAIL: noncopyable_generics

View File

@@ -113,6 +113,3 @@ public struct MyFooProviderInferred: FooProvider {
// CHECK-NEXT: ]
// CHECK-NEXT: }
// CHECK-NEXT: ]
// XFAIL: noncopyable_generics