Skip to content

[Diagnostics] Make sure extension type repr is available before using it #37887

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 15, 2021

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Jun 11, 2021

Before suggesting to add where Self == ... condition to the extension
of a protocol involved in a static member lookup, let's check whether
type repr is available and valid. It might not be available when e.g. extension
was loaded from a serialized module.

Resolves: rdar://78097387

@xedin xedin requested a review from hborla June 11, 2021 20:34
@xedin
Copy link
Contributor Author

xedin commented Jun 11, 2021

I have checked with Robert and it appears that adding a test-case for this would be too cumbersome.

@xedin
Copy link
Contributor Author

xedin commented Jun 11, 2021

@swift-ci please smoke test


if (auto noteLoc = nameRepr->getEndLoc()) {
note.fixItInsertAfter(noteLoc, " where Self == <#Type#>");
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

If you don't have the extended type repr, you should have the extended type. Can that be diagnosed even if it can't be fixed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It would be diagnose, just wouldn't have the note.

@xedin
Copy link
Contributor Author

xedin commented Jun 14, 2021

@swift-ci please smoke test

xedin added 2 commits June 14, 2021 17:56
Before suggesting to add `where Self == ...` condition to the extension
of a protocol involved in a static member lookup, let's check whether
type repr is available and valid.

Resolves: rdar://78097387
@xedin
Copy link
Contributor Author

xedin commented Jun 15, 2021

@swift-ci please smoke test

@xedin
Copy link
Contributor Author

xedin commented Jun 15, 2021

@swift-ci please clean smoke test macOS platform

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