mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[swift-api-digester] Ensure we exclude decls of low accessibility from the API comparison. (#5382)
This commit is contained in:
@@ -1,4 +1,11 @@
|
||||
public struct S1 {
|
||||
public func foo1() {}
|
||||
mutating public func foo2() {}
|
||||
internal func foo3() {}
|
||||
private func foo4() {}
|
||||
fileprivate func foo5() {}
|
||||
}
|
||||
|
||||
public class C1 {
|
||||
open func foo1() {}
|
||||
}
|
||||
@@ -62,6 +62,49 @@
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "TypeDecl",
|
||||
"name": "C1",
|
||||
"printedName": "C1",
|
||||
"declKind": "Class",
|
||||
"usr": "s:C4cake2C1",
|
||||
"location": "",
|
||||
"moduleName": "cake",
|
||||
"children": [
|
||||
{
|
||||
"kind": "Function",
|
||||
"name": "foo1",
|
||||
"printedName": "foo1()",
|
||||
"declKind": "Func",
|
||||
"usr": "s:FC4cake2C14foo1FT_T_",
|
||||
"location": "",
|
||||
"moduleName": "cake",
|
||||
"children": [
|
||||
{
|
||||
"kind": "TypeNominal",
|
||||
"name": "Void",
|
||||
"printedName": "()"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "Constructor",
|
||||
"name": "init",
|
||||
"printedName": "init()",
|
||||
"declKind": "Constructor",
|
||||
"usr": "s:FC4cake2C1cFT_S0_",
|
||||
"location": "",
|
||||
"moduleName": "cake",
|
||||
"children": [
|
||||
{
|
||||
"kind": "TypeNominal",
|
||||
"name": "C1",
|
||||
"printedName": "C1"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1112,6 +1112,15 @@ static bool shouldIgnore(Decl *D) {
|
||||
return true;
|
||||
if (VD->getName().empty())
|
||||
return true;
|
||||
switch (VD->getFormalAccess()) {
|
||||
case Accessibility::Internal:
|
||||
case Accessibility::Private:
|
||||
case Accessibility::FilePrivate:
|
||||
return true;
|
||||
case Accessibility::Public:
|
||||
case Accessibility::Open:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (auto *ClangD = D->getClangDecl()) {
|
||||
|
||||
Reference in New Issue
Block a user