Skip to content

Fix missing indexing data when using Self initializer #65512

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

Conversation

keith
Copy link
Member

@keith keith commented Apr 28, 2023

Fixes: #64686

@keith
Copy link
Member Author

keith commented Apr 28, 2023

@swift-ci please test

@keith
Copy link
Member Author

keith commented Apr 28, 2023

One alternative here would be to make the underlying decl ref not implicit, but I figured that might be more significant of a change. The only thing I'm not sure about this is if there is another time where things could be this same shape since I can't explicitly check that Self is being used here

struct Foo {
init() {} // CHECK: [[@LINE]]:3 | constructor/Swift | init() | [[init_USR:.*]] | Def,RelChild | rel: 1

static func bar() -> Self {
Copy link
Member Author

@keith keith Apr 28, 2023

Choose a reason for hiding this comment

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

Self in this context also isn't indexed yet, I figured that could potentially be done as a follow up. I also think that one is a bit less important since the type it's referencing will always have another reference in the same file, where the initializer being referenced could be in another file

@keith
Copy link
Member Author

keith commented Apr 28, 2023

The only thing I'm not sure about this is if there is another time where things could be this same shape

turns out just using the type's name directly is the same shape, so I need to figure out how to narrow it down

@keith
Copy link
Member Author

keith commented Apr 28, 2023

There's actually no difference in the AST (at least via -dump-ast) in that case, so I think I do have to solve this somewhere else

@keith keith force-pushed the ks/fix-missing-indexing-data-when-using-self-initializer branch from 2ff3f34 to 9773bdd Compare April 29, 2023 01:28
@keith
Copy link
Member Author

keith commented Apr 29, 2023

@swift-ci please test

@keith keith force-pushed the ks/fix-missing-indexing-data-when-using-self-initializer branch from 9773bdd to 8a9f6ef Compare April 29, 2023 01:36
@keith
Copy link
Member Author

keith commented Apr 29, 2023

@swift-ci please test

@keith
Copy link
Member Author

keith commented Apr 29, 2023

@swift-ci please test macOS Platform

Copy link
Member

@ahoppen ahoppen left a comment

Choose a reason for hiding this comment

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

Looks reasonable to me.

@bnbarham bnbarham requested a review from hamishknight May 1, 2023 21:03
@keith keith requested review from hborla, slavapestov and xedin as code owners May 1, 2023 22:52
Copy link
Contributor

@hamishknight hamishknight left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this!

@keith keith force-pushed the ks/fix-missing-indexing-data-when-using-self-initializer branch 4 times, most recently from 484b753 to ae77ad3 Compare May 3, 2023 16:54
@keith keith force-pushed the ks/fix-missing-indexing-data-when-using-self-initializer branch from ae77ad3 to 1d3a9ba Compare May 4, 2023 17:47
@keith
Copy link
Member Author

keith commented May 4, 2023

@swift-ci please test and merge

@swift-ci swift-ci merged commit 27d9d65 into swiftlang:main May 4, 2023
@keith keith deleted the ks/fix-missing-indexing-data-when-using-self-initializer branch May 4, 2023 23:04
keith added a commit to keith/swift that referenced this pull request May 4, 2023
keith added a commit that referenced this pull request May 30, 2023
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.

Index data incomplete when using Self to initialize a type
6 participants