Skip to content

[DeclChecker] Don't try to derive conformances for invalid enums #14419

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
Feb 6, 2018

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Feb 5, 2018

If one of the cases is invalid, let's mark parent enum as invalid
as well, and avoid trying to derive any conformances related to it.

Resolves: rdar://problem/36989792

If one of the cases is invalid, let's mark parent enum as invalid
as well, and avoid trying to derive any conformances related to it.

Resolves: rdar://problem/36989792
@xedin xedin requested a review from DougGregor February 5, 2018 22:59
@xedin
Copy link
Contributor Author

xedin commented Feb 5, 2018

/cc @DougGregor Can you please take a look?

@jrose-apple
Copy link
Contributor

Do we have to leave out the type, or would it be possible to mark it invalid without that? Would slightly improve the experience to still have a valid type around…but only if it's not going to lead to more crashes.

…e names

We want to preserve as much of the AST as possible in the valid state,
so for cases with duplicate names it makes sense to mark declaration
itself and its parent enum as invalid and leave the original types in place.
@xedin
Copy link
Contributor Author

xedin commented Feb 5, 2018

@jrose-apple Right! It looks like setting the type to ErrorType is an overkill, I was lead to believe that it's a pattern we have, that's why I did that... Made a follow-up commit which address it.

@xedin
Copy link
Contributor Author

xedin commented Feb 5, 2018

@swift-ci please smoke test

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

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

This version LGTM

@xedin xedin merged commit 1a02213 into swiftlang:master Feb 6, 2018
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