Skip to content

[Index][SR-12903] Index @objc optional references #32087

New issue

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

Merged
merged 2 commits into from
Jun 2, 2020

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