swiftshield
swiftshield copied to clipboard
Public static var/func not identified as public if exported to objc
Given a protocol defined as
@objc public protocol AProtocol {
static func pubfunction()
static var pubvariable: Int { get }
}
SourceKit do not reports the right ACL in the attributes list. The right ACL is resported instead in key.effective_access
key.entities: [
{
key.kind: source.lang.swift.decl.function.method.static,
key.name: "decision()",
key.usr: "c:@M@Module@objc(pl)Name(cm)pubfunction",
key.line: 23,
key.column: 17,
key.attributes: [
{
key.attribute: source.decl.attribute.objc
}
],
key.effective_access: source.decl.effective_access.public
},
......
This MR try to address this behaviour looking into the effective_access
property to identify public entities in SDK mode.
@rockbruno Any idea why this is failing ? Tests are green on MacOS Apple Swift version 5.4 (swiftlang-1205.0.26.9 clang-1205.0.19.55) Target: x86_64-apple-darwin20.5.0
Maybe a difference in SourceKit ?
The CI here is configured for Xcode 12.4 (Swift 5.3, I think?), so this feature likely changed recently in SourceKit
FYI tests are green now