Skip to content

Commit 4108beb

Browse files
committed
ABI/API checker: always print fully qualified names for types when diagnosing module difference
This change introduces a Json format change where we always print fully qualified type names everywhere. This is beneficial for diagnosing purposes but may not be ideal for generating migrator scripts. To resolve this conflict, the patch also introduces a flag -migrator to opt-out fully qualified type names. After the format change, we need to update the ABI and API baselines for the Swift stdlib.
1 parent e56743e commit 4108beb

18 files changed

+35502
-39164
lines changed

test/api-digester/Inputs/stdlib-stable-abi.json

Lines changed: 22275 additions & 21505 deletions
Large diffs are not rendered by default.

test/api-digester/Inputs/stdlib-stable.json

Lines changed: 12975 additions & 17165 deletions
Large diffs are not rendered by default.

test/api-digester/Outputs/Cake-abi.txt

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
/* Generic Signature Changes */
3-
cake: Func P1.P1Constraint() has generic signature change from <Self where Self : P1, Self : P2> to <Self where Self : P1>
3+
cake: Func P1.P1Constraint() has generic signature change from <Self where Self : cake.P1, Self : cake.P2> to <Self where Self : cake.P1>
44
cake: Protocol P3 has generic signature change from <Self : cake.P1, Self : cake.P2> to <Self : cake.P1, Self : cake.P4>
55

66
/* RawRepresentable Changes */
@@ -31,21 +31,21 @@ cake: Func S1.foo5(x:y:) has been renamed to Func foo5(x:y:z:)
3131
cake: Struct Somestruct2 has been renamed to Struct NSSomestruct2
3232

3333
/* Type Changes */
34-
cake: Accessor Zoo.current.Get() has return type change from Cat to Dog
35-
cake: AssociatedType AssociatedTypePro.T3 has default type change from C1 to C6
36-
cake: Class TChangesFromIntToString has type witness type for AssociatedTypesProtocol.T changing from Int to String
37-
cake: Constructor S1.init(_:) has parameter 0 type change from Int to Double
38-
cake: Func C1.foo2(_:) has parameter 0 type change from Int to () -> ()
34+
cake: Accessor Zoo.current.Get() has return type change from cake.Cat to cake.Dog
35+
cake: AssociatedType AssociatedTypePro.T3 has default type change from cake.C1 to cake.C6
36+
cake: Class TChangesFromIntToString has type witness type for AssociatedTypesProtocol.T changing from Swift.Int to Swift.String
37+
cake: Constructor S1.init(_:) has parameter 0 type change from Swift.Int to Swift.Double
38+
cake: Func C1.foo2(_:) has parameter 0 type change from Swift.Int to () -> ()
3939
cake: Func C7.foo(_:_:) has removed default argument from parameter 0
4040
cake: Func C7.foo(_:_:) has removed default argument from parameter 1
4141
cake: Func EscapingFunctionType.addedEscaping(_:) has added @escaping in parameter 0
4242
cake: Func EscapingFunctionType.removedEscaping(_:) has removed @escaping in parameter 0
43-
cake: Func Somestruct2.foo1(_:) has parameter 0 type change from C3 to C1
44-
cake: Func Zoo.getCurrentAnimalInlinable() has return type change from Cat to Dog
43+
cake: Func Somestruct2.foo1(_:) has parameter 0 type change from cake.C3 to cake.C1
44+
cake: Func Zoo.getCurrentAnimalInlinable() has return type change from cake.Cat to cake.Dog
4545
cake: Func ownershipChange(_:_:) has parameter 0 changing from InOut to Default
4646
cake: Func ownershipChange(_:_:) has parameter 1 changing from Shared to Owned
47-
cake: Func returnFunctionTypeOwnershipChange() has return type change from (C1) -> () to (__owned C1) -> ()
48-
cake: Var Zoo.current has declared type change from Cat to Dog
47+
cake: Func returnFunctionTypeOwnershipChange() has return type change from (cake.C1) -> () to (__owned cake.C1) -> ()
48+
cake: Var Zoo.current has declared type change from cake.Cat to cake.Dog
4949

5050
/* Decl Attribute changes */
5151
cake: Accessor GlobalLetChangedToVar.Modify() is a new API without @available attribute
@@ -103,13 +103,13 @@ cake: Struct fixedLayoutStruct has removed conformance to P1
103103

104104
/* Protocol Requirement Change */
105105
cake: Accessor HasMutatingMethodClone.bar.Get() now requires new witness table entry
106-
cake: AssociatedType AssociatedTypePro.T1 has removed default type Int
106+
cake: AssociatedType AssociatedTypePro.T1 has removed default type Swift.Int
107107
cake: AssociatedType RequiementChanges.addedTypeWithoutDefault has been added as a protocol requirement
108108
cake: Func HasMutatingMethodClone.foo() now requires new witness table entry
109109
cake: Func RequiementChanges.addedFunc() has been added as a protocol requirement
110110
cake: Var RequiementChanges.addedVar has been added as a protocol requirement
111111

112112
/* Class Inheritance Change */
113-
cake: Class C4 has changed its super class from OldType to NewType
114-
cake: Class SubGenericClass has changed its super class from GenericClass<P1> to GenericClass<P2>
115-
cake: Class SuperClassRemoval has removed its super class C3
113+
cake: Class C4 has changed its super class from APINotesTest.OldType to APINotesTest.NewType
114+
cake: Class SubGenericClass has changed its super class from cake.GenericClass<cake.P1> to cake.GenericClass<cake.P2>
115+
cake: Class SuperClassRemoval has removed its super class cake.C3

test/api-digester/Outputs/Cake.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
/* Generic Signature Changes */
3-
cake: Func P1.P1Constraint() has generic signature change from <Self where Self : P1, Self : P2> to <Self where Self : P1>
3+
cake: Func P1.P1Constraint() has generic signature change from <Self where Self : cake.P1, Self : cake.P2> to <Self where Self : cake.P1>
44
cake: Protocol P3 has generic signature change from <Self : cake.P1, Self : cake.P2> to <Self : cake.P1, Self : cake.P4>
55

66
/* RawRepresentable Changes */
@@ -26,14 +26,14 @@ cake: Func S1.foo5(x:y:) has been renamed to Func foo5(x:y:z:)
2626
cake: Struct Somestruct2 has been renamed to Struct NSSomestruct2
2727

2828
/* Type Changes */
29-
cake: AssociatedType AssociatedTypePro.T3 has default type change from C1 to C6
30-
cake: Constructor S1.init(_:) has parameter 0 type change from Int to Double
31-
cake: Func C1.foo2(_:) has parameter 0 type change from Int to () -> ()
29+
cake: AssociatedType AssociatedTypePro.T3 has default type change from cake.C1 to cake.C6
30+
cake: Constructor S1.init(_:) has parameter 0 type change from Swift.Int to Swift.Double
31+
cake: Func C1.foo2(_:) has parameter 0 type change from Swift.Int to () -> ()
3232
cake: Func C7.foo(_:_:) has removed default argument from parameter 0
3333
cake: Func C7.foo(_:_:) has removed default argument from parameter 1
3434
cake: Func ownershipChange(_:_:) has parameter 0 changing from InOut to Default
3535
cake: Func ownershipChange(_:_:) has parameter 1 changing from Shared to Owned
36-
cake: TypeAlias TChangesFromIntToString.T has underlying type change from Int to String
36+
cake: TypeAlias TChangesFromIntToString.T has underlying type change from Swift.Int to Swift.String
3737

3838
/* Decl Attribute changes */
3939
cake: Func C1.foo1() is now not static
@@ -52,16 +52,16 @@ cake: Protocol P3 has removed inherited protocol P2
5252
cake: Struct fixedLayoutStruct has removed conformance to P1
5353

5454
/* Protocol Requirement Change */
55-
cake: AssociatedType AssociatedTypePro.T1 has removed default type Int
55+
cake: AssociatedType AssociatedTypePro.T1 has removed default type Swift.Int
5656
cake: AssociatedType RequiementChanges.addedTypeWithoutDefault has been added as a protocol requirement
5757
cake: Func RequiementChanges.addedFunc() has been added as a protocol requirement
5858
cake: Var RequiementChanges.addedVar has been added as a protocol requirement
5959
cake: Accessor ClassWithOpenMember.property.Get() is no longer open for subclassing
6060

6161
/* Class Inheritance Change */
62-
cake: Class C4 has changed its super class from OldType to NewType
63-
cake: Class SubGenericClass has changed its super class from GenericClass<P1> to GenericClass<P2>
64-
cake: Class SuperClassRemoval has removed its super class C3
62+
cake: Class C4 has changed its super class from APINotesTest.OldType to APINotesTest.NewType
63+
cake: Class SubGenericClass has changed its super class from cake.GenericClass<cake.P1> to cake.GenericClass<cake.P2>
64+
cake: Class SuperClassRemoval has removed its super class cake.C3
6565
cake: Func ClassWithOpenMember.bar() is no longer open for subclassing
6666
cake: Func ClassWithOpenMember.foo() is no longer open for subclassing
6767
cake: Var ClassWithOpenMember.property is no longer open for subclassing

test/api-digester/Outputs/apinotes-diags-3-4.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@
22
/* Generic Signature Changes */
33

44
/* RawRepresentable Changes */
5-
APINotesTest(APINotesTest.h): TypeAlias AnimalAttributeName(NSString) is now String representable
65

76
/* Removed Decls */
7+
APINotesTest(APINotesTest.h): TypeAlias AnimalAttributeName has been removed
88

99
/* Moved Decls */
1010

1111
/* Renamed Decls */
1212
APINotesTest(APINotesTest.h): Var globalAttributeName has been renamed to Var AnimalAttributeName.globalAttributeName
1313

1414
/* Type Changes */
15-
APINotesTest(APINotesTest.h): Func AnimalStatusDescriptor.addingAttributes(_:) has parameter 0 type change from [String : Any] to [AnimalAttributeName : Any]
16-
APINotesTest(APINotesTest.h): Func AnimalStatusDescriptor.addingAttributesArray(_:) has parameter 0 type change from [String] to [AnimalAttributeName]
17-
APINotesTest(APINotesTest.h): Func AnimalStatusDescriptor.addingOptionalAttributes(_:) has parameter 0 type change from [String : Any]? to [AnimalAttributeName : Any]?
18-
APINotesTest(APINotesTest.h): Func AnimalStatusDescriptor.addingOptionalAttributesArray(_:) has parameter 0 type change from [String]? to [AnimalAttributeName]?
19-
APINotesTest(APINotesTest.h): Func AnimalStatusDescriptor.animalStatusSingleAttribute(_:) has parameter 0 type change from String to AnimalAttributeName
20-
APINotesTest(APINotesTest.h): Func AnimalStatusDescriptor.animalStatusSingleOptionalAttribute(_:) has parameter 0 type change from String? to AnimalAttributeName?
15+
APINotesTest(APINotesTest.h): Func AnimalStatusDescriptor.addingAttributes(_:) has parameter 0 type change from [Swift.String : Any] to [APINotesTest.AnimalAttributeName : Any]
16+
APINotesTest(APINotesTest.h): Func AnimalStatusDescriptor.addingAttributesArray(_:) has parameter 0 type change from [Swift.String] to [APINotesTest.AnimalAttributeName]
17+
APINotesTest(APINotesTest.h): Func AnimalStatusDescriptor.addingOptionalAttributes(_:) has parameter 0 type change from [Swift.String : Any]? to [APINotesTest.AnimalAttributeName : Any]?
18+
APINotesTest(APINotesTest.h): Func AnimalStatusDescriptor.addingOptionalAttributesArray(_:) has parameter 0 type change from [Swift.String]? to [APINotesTest.AnimalAttributeName]?
19+
APINotesTest(APINotesTest.h): Func AnimalStatusDescriptor.animalStatusSingleAttribute(_:) has parameter 0 type change from Swift.String to APINotesTest.AnimalAttributeName
20+
APINotesTest(APINotesTest.h): Func AnimalStatusDescriptor.animalStatusSingleOptionalAttribute(_:) has parameter 0 type change from Swift.String? to APINotesTest.AnimalAttributeName?
2121

2222
/* Decl Attribute changes */
Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11

22
/* Generic Signature Changes */
3-
APINotesTest(APINotesTest.h): Func SwiftTypeWithMethodLeft.minusPrint() has generic signature change from <Self where Self : SwiftTypeWithMethodLeft> to <Self where Self : SwiftTypeWithMethodRight>
4-
APINotesTest(APINotesTest.h): Func SwiftTypeWithMethodLeft.plusPrint() has generic signature change from <Self where Self : SwiftTypeWithMethodLeft> to <Self where Self : SwiftTypeWithMethodRight>
5-
6-
/* RawRepresentable Changes */
7-
APINotesTest(APINotesTest.h): TypeAlias CatAttributeName(NSString) is now String representable
3+
APINotesTest(APINotesTest.h): Func SwiftTypeWithMethodLeft.minusPrint() has generic signature change from <Self where Self : APINotesTest.SwiftTypeWithMethodLeft> to <Self where Self : APINotesTest.SwiftTypeWithMethodRight>
4+
APINotesTest(APINotesTest.h): Func SwiftTypeWithMethodLeft.plusPrint() has generic signature change from <Self where Self : APINotesTest.SwiftTypeWithMethodLeft> to <Self where Self : APINotesTest.SwiftTypeWithMethodRight>
85

96
/* Removed Decls */
107
APINotesTest(APINotesTest.h): Func ObjcProt.protMemberFunc2() has been removed
118
APINotesTest(APINotesTest.h): Func ObjcProt.protMemberFunc3() has been removed
129
APINotesTest(APINotesTest.h): Func SwiftTypeWithMethodLeft.getPropertyA() has been removed
10+
APINotesTest(APINotesTest.h): TypeAlias CatAttributeName has been removed
1311

1412
/* Moved Decls */
1513

@@ -19,12 +17,12 @@ APINotesTest(APINotesTest.h): Var OldType.oldMember has been renamed to Var NewT
1917
APINotesTest(APINotesTest.h): Var globalAttributeName has been renamed to Var AnimalAttributeName.globalAttributeName
2018

2119
/* Type Changes */
22-
APINotesTest(APINotesTest.h): Constructor Cat.init(name:) has return type change from Cat to Cat?
23-
APINotesTest(APINotesTest.h): Func AnimalStatusDescriptor.addingAttributes(_:) has parameter 0 type change from [String : Any] to [AnimalAttributeName : Any]
24-
APINotesTest(APINotesTest.h): Func AnimalStatusDescriptor.addingAttributesArray(_:) has parameter 0 type change from [String] to [AnimalAttributeName]
25-
APINotesTest(APINotesTest.h): Func AnimalStatusDescriptor.addingOptionalAttributes(_:) has parameter 0 type change from [String : Any]? to [AnimalAttributeName : Any]?
26-
APINotesTest(APINotesTest.h): Func AnimalStatusDescriptor.addingOptionalAttributesArray(_:) has parameter 0 type change from [String]? to [AnimalAttributeName]?
27-
APINotesTest(APINotesTest.h): Func AnimalStatusDescriptor.animalStatusSingleAttribute(_:) has parameter 0 type change from String to AnimalAttributeName
28-
APINotesTest(APINotesTest.h): Func AnimalStatusDescriptor.animalStatusSingleOptionalAttribute(_:) has parameter 0 type change from String? to AnimalAttributeName?
20+
APINotesTest(APINotesTest.h): Constructor Cat.init(name:) has return type change from APINotesTest.Cat to APINotesTest.Cat?
21+
APINotesTest(APINotesTest.h): Func AnimalStatusDescriptor.addingAttributes(_:) has parameter 0 type change from [Swift.String : Any] to [APINotesTest.AnimalAttributeName : Any]
22+
APINotesTest(APINotesTest.h): Func AnimalStatusDescriptor.addingAttributesArray(_:) has parameter 0 type change from [Swift.String] to [APINotesTest.AnimalAttributeName]
23+
APINotesTest(APINotesTest.h): Func AnimalStatusDescriptor.addingOptionalAttributes(_:) has parameter 0 type change from [Swift.String : Any]? to [APINotesTest.AnimalAttributeName : Any]?
24+
APINotesTest(APINotesTest.h): Func AnimalStatusDescriptor.addingOptionalAttributesArray(_:) has parameter 0 type change from [Swift.String]? to [APINotesTest.AnimalAttributeName]?
25+
APINotesTest(APINotesTest.h): Func AnimalStatusDescriptor.animalStatusSingleAttribute(_:) has parameter 0 type change from Swift.String to APINotesTest.AnimalAttributeName
26+
APINotesTest(APINotesTest.h): Func AnimalStatusDescriptor.animalStatusSingleOptionalAttribute(_:) has parameter 0 type change from Swift.String? to APINotesTest.AnimalAttributeName?
2927

3028
/* Decl Attribute changes */

0 commit comments

Comments
 (0)