We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
md5: f78d9f8248b8cfe12367c3dee95bad65
Issue Description:
Consider the following snippet with two ways of representing operators:
class A { init(){} } func +(lhs: A, rhs: A) -> A { return lhs } class B { init() {} func foo() { let a = A() let b = a + a let c = B() let d = c - c } public static func -(lhs: B, rhs: B) -> B { return lhs } }
If you run that through swift-ide-test, all references to + and - are correctly fetched:
5:6 | function/infix-operator/Swift | +(_:_:) | ... | Def 13:19 | function/infix-operator/Swift | +(_:_:) | ... | Ref 15:19 | static-method/infix-operator/Swift | -(_:_:) | ... | Ref 18:24 | static-method/infix-operator/Swift | -(_:_:) | ... | Def
But if you run the same snippet with SourceKit, the nested operator - is treated as a regular static method instead of an operator:
key.kind: source.lang.swift.decl.function.method.static, key.name: "-(_:_:)", key.line: 18, key.column: 24, key.kind: source.lang.swift.ref.function.method.static, key.name: "-(_:_:)", key.line: 15, key.column: 19
The text was updated successfully, but these errors were encountered:
Comment by Bruno Rocha (JIRA)
Ah, seems that the issue is simply that the subkind isn't being checked in static functions: https://github.com/apple/swift/blob/master/tools/SourceKit/lib/SwiftLang/SwiftLangSupport.cpp#L561
Sorry, something went wrong.
#20427
Merged.
No branches or pull requests
Additional Detail from JIRA
md5: f78d9f8248b8cfe12367c3dee95bad65
Issue Description:
Consider the following snippet with two ways of representing operators:
If you run that through swift-ide-test, all references to + and - are correctly fetched:
But if you run the same snippet with SourceKit, the nested operator - is treated as a regular static method instead of an operator:
The text was updated successfully, but these errors were encountered: