Skip to content

Conversation

@rockbruno
Copy link
Contributor

Declarations of objc optional methods were indexed, but their references weren't.

import Foundation

@objc protocol Foo {
    @objc optional func bar()
}

class Sample {

    weak var delegate: Foo?

    func doSomething() {
        delegate?.bar()
    }
}

The bar() call was left unindexed. This provides a fix by walking DynamicMemberRefExprs.

@rockbruno rockbruno force-pushed the index-objcdynamic branch from 475cae5 to cd83896 Compare May 29, 2020 21:44
@rockbruno rockbruno changed the title [SourceKit] Index @objc optional references [Index] Index @objc optional references May 29, 2020
@rockbruno rockbruno changed the title [Index] Index @objc optional references [Index][SR-12903] Index @objc optional references May 29, 2020
@theblixguy theblixguy requested a review from nathawes May 29, 2020 21:50
@nathawes
Copy link
Contributor

nathawes commented Jun 1, 2020

@swift-ci please test

Copy link
Contributor

@nathawes nathawes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the fix!

@nathawes nathawes merged commit 67d8be7 into swiftlang:master Jun 2, 2020
@amolpict
Copy link

@nathawas Are you people planning to make this fix available in upcoming Swift version release ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants