Skip to content

[5.6] Fix invalid warning for enum cases named self #41529

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 Feb 23, 2022

#37992 introduced a warning when you
were likely to confuse self with TypeName.self, this also applied to
enum cases that were named self, these cases should not be easily
confused at call sites since their use requires prefixing them with a
.. There was also no way to avoid this warning since other syntax such
as TypeName.self, which produces the enum type instead, or
TypeName.`self` which produced the same warning again.

Fixes #57970

(cherry picked from commit f6b2e2e) / #41520

swiftlang#37992 introduced a warning when you
were likely to confuse `self` with `TypeName.self`, this also applied to
enum cases that were named `self`, these cases should not be easily
confused at call sites since their use requires prefixing them with a
`.`. There was also no way to avoid this warning since other syntax such
as `TypeName.self`, which produces the enum type instead, or
`` TypeName.`self` `` which produced the same warning again.

Fixes https://bugs.swift.org/browse/SR-15691

(cherry picked from commit f6b2e2e)
@keith keith requested a review from a team as a code owner February 23, 2022 18:02
@keith
Copy link
Member Author

keith commented Feb 23, 2022

@swift-ci please test

@keith
Copy link
Member Author

keith commented Mar 2, 2022

@DougGregor since you're the RM for 5.6 can you take a look?

@keith
Copy link
Member Author

keith commented Mar 15, 2022

@DougGregor now that 5.6 is released can you consider this for a .1?

@DougGregor
Copy link
Member

Yeah, it's a good candidate fix if we get a .1

@DougGregor DougGregor merged commit 4317e03 into swiftlang:release/5.6 Mar 23, 2022
@keith
Copy link
Member Author

keith commented Mar 23, 2022

Thanks!

@keith keith deleted the ks/fix-invalid-warning-for-enum-cases-named-self-41520 branch March 23, 2022 04:09
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.

2 participants