Skip to content

[Typechecker] Allow static functions to overload enum cases #23227

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 7 commits into from
Mar 20, 2019
Merged

[Typechecker] Allow static functions to overload enum cases #23227

merged 7 commits into from
Mar 20, 2019

Conversation

theblixguy
Copy link
Collaborator

Fixes an issue with redeclaration checking where a static function would incorrectly get marked as a redeclaration of an enum element declaration, even if their types were different. See https://twitter.com/an0/status/1105187953834369025

Resolves SR-10084.

@theblixguy
Copy link
Collaborator Author

cc @slavapestov @xedin

Copy link
Contributor

@slavapestov slavapestov left a comment

Choose a reason for hiding this comment

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

Thanks!

@slavapestov slavapestov self-assigned this Mar 12, 2019
…e() to compute the type for the enum element decl, etc
@theblixguy
Copy link
Collaborator Author

I have added some more tests to ensure non-functions can't redeclare an enum element (or vice versa). We only had one test for this, but I have added some more test cases to ensure we don't regress.

@theblixguy
Copy link
Collaborator Author

@slavapestov Do you have any additional feedback or is this good to go?

@slavapestov
Copy link
Contributor

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor

@swift-ci Please test source compatibility

@slavapestov slavapestov merged commit 25e0a9f into swiftlang:master Mar 20, 2019
@theblixguy theblixguy changed the title [Typechecker] Fix an issue with redeclaration checking [Typechecker] Allow static functions to overload enum cases Mar 20, 2019
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