-
Notifications
You must be signed in to change notification settings - Fork 491
Explicitly annotate existential usage of Message with the existential any keyword.
#1509
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
|
Can you expand the description for why this is needed (for history, etc.). And looking at the other PR, |
anyMessage with the existential any keyword.
|
Updated title and description |
This statement is no longer true. The language workgroup has recently put out a post where they stated that Can you explain why your other PR needed this to be changed everywhere? |
Ah TIL good to know!
I'm adding a Without this the compiler complains |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see a lot of any Message.Type and similar in here. I believe that is wrong -- Message.Type is not being used as an existential here, so the any is not appropriate.
@tbkka All of the places that I've annotated with
Just like how trying to use |
|
Yep. My mistake. |
|
In general, I am happy with adopting |
Having the validation sounds good to me. |
Sounds like a good plan to me. Let's do that. |
|
I found a workaround for this in #1504 so this is no longer necessary for me. LMK if I should close this. I'm happy to merge it too if you'd like. |
|
I think we're good landing this, just need to do @FranzBusch 's suggestion to enable the workings in the Package.swift file. |
Enable the feature on all targets, and then go through doing the fixits within Xcode 15 that are triggered as a result. This basically replaces apple#1509
Enable the feature on all targets, and then go through doing the fixits within Xcode 15 that are triggered as a result. This basically replaces apple#1509
Enable the feature on all targets, and then go through doing the fixits within Xcode 15 that are triggered as a result. This basically replaces #1509

This PR separates out the addition of the existential
anyfrom #1504 into its own distinct PR for easier consumption.Context: #1504 adds Self constraints to Message with the addition of
static var _fields: Field<Self>. With this change the swift compiler will require uses of the existentialMessagetype to be explicitly annotated with theanykeyword. This keyword is currently optional for existential types without Self constraints however it will be required in swift 6.