Skip to content

Commit 87d22ac

Browse files
authored
[swift-api-digester] Ensure we exclude decls of low accessibility from the API comparison. (#5382)
1 parent 85343be commit 87d22ac

File tree

4 files changed

+61
-1419
lines changed

4 files changed

+61
-1419
lines changed

test/api-digester/Inputs/cake.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
public struct S1 {
22
public func foo1() {}
33
mutating public func foo2() {}
4+
internal func foo3() {}
5+
private func foo4() {}
6+
fileprivate func foo5() {}
7+
}
8+
9+
public class C1 {
10+
open func foo1() {}
411
}

test/api-digester/Outputs/cake.json

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,49 @@
6262
]
6363
}
6464
]
65+
},
66+
{
67+
"kind": "TypeDecl",
68+
"name": "C1",
69+
"printedName": "C1",
70+
"declKind": "Class",
71+
"usr": "s:C4cake2C1",
72+
"location": "",
73+
"moduleName": "cake",
74+
"children": [
75+
{
76+
"kind": "Function",
77+
"name": "foo1",
78+
"printedName": "foo1()",
79+
"declKind": "Func",
80+
"usr": "s:FC4cake2C14foo1FT_T_",
81+
"location": "",
82+
"moduleName": "cake",
83+
"children": [
84+
{
85+
"kind": "TypeNominal",
86+
"name": "Void",
87+
"printedName": "()"
88+
}
89+
]
90+
},
91+
{
92+
"kind": "Constructor",
93+
"name": "init",
94+
"printedName": "init()",
95+
"declKind": "Constructor",
96+
"usr": "s:FC4cake2C1cFT_S0_",
97+
"location": "",
98+
"moduleName": "cake",
99+
"children": [
100+
{
101+
"kind": "TypeNominal",
102+
"name": "C1",
103+
"printedName": "C1"
104+
}
105+
]
106+
}
107+
]
65108
}
66109
]
67110
}

0 commit comments

Comments
 (0)