Skip to content

Commit 95e9879

Browse files
authored
Merge pull request #18761 from nkcsgexi/diagnose-gs
swift-api-digester: diagnose generic signature change for any declarations.
2 parents 4b7f892 + 11cdd41 commit 95e9879

File tree

8 files changed

+126
-120
lines changed

8 files changed

+126
-120
lines changed

include/swift/IDE/DigesterEnums.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ NODE_ANNOTATION(OwnershipChange)
6262
NODE_ANNOTATION(ChangeObjC)
6363
NODE_ANNOTATION(ChangeFixedLayout)
6464
NODE_ANNOTATION(ChangeFrozen)
65+
NODE_ANNOTATION(ChangeGenericSignature)
6566
NODE_ANNOTATION(RawTypeLeft)
6667
NODE_ANNOTATION(RawTypeRight)
6768

test/api-digester/Inputs/cake1.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,11 @@ public struct C6 {}
3636

3737
@_frozen
3838
public enum IceKind {}
39+
40+
public protocol P1 {}
41+
42+
public protocol P2 {}
43+
44+
public extension P1 where Self: P2 {
45+
func P1Constraint() {}
46+
}

test/api-digester/Inputs/cake2.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,12 @@ public class C5 {}
3535
@_fixed_layout
3636
public struct C6 {}
3737

38-
public enum IceKind {}
38+
public enum IceKind {}
39+
40+
public protocol P1 {}
41+
42+
public protocol P2 {}
43+
44+
public extension P1 {
45+
func P1Constraint() {}
46+
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11

2+
/* Generic Signature Changes */
3+
cake1: Func P1.P1Constraint() has generic signature change from <τ_0_0 where τ_0_0 : P1, τ_0_0 : P2> to <τ_0_0 where τ_0_0 : P1>
4+
25
/* RawRepresentable Changes */
36

47
/* Removed Decls */

test/api-digester/Outputs/Cake.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11

2+
/* Generic Signature Changes */
3+
cake1: Func P1.P1Constraint() has generic signature change from <Self where Self : P1, Self : P2> to <Self where Self : P1>
4+
25
/* RawRepresentable Changes */
36

47
/* Removed Decls */

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

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

2+
/* Generic Signature Changes */
3+
24
/* RawRepresentable Changes */
35
APINotesTest(APINotesTest.h): TypeAlias AnimalAttributeName(NSString) is now String representable
46

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11

2+
/* 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+
26
/* RawRepresentable Changes */
37
APINotesTest(APINotesTest.h): TypeAlias CatAttributeName(NSString) is now String representable
48

0 commit comments

Comments
 (0)