-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[IDE] Resolve [.]Type
completion for (any P).
to produce singleton metatype instead of existential metatype
#73163
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
base: main
Are you sure you want to change the base?
Conversation
@AnthonyLatsis |
@swift-ci please smoke test Linux |
Currently protocol ExistentialProto {
static func staticMethod()
func instanceMethod()
}
func testExistential() {
let _ = ExistentialProto.#^PROTOCOLTYPE_DOT_1^#
// PROTOCOLTYPE_DOT_1: Begin completions, 3 items
// PROTOCOLTYPE_DOT_1-DAG: Keyword[self]/CurrNominal: self[#(any ExistentialProto).Type#]; name=self
// PROTOCOLTYPE_DOT_1-DAG: Keyword/CurrNominal: Protocol[#(any ExistentialProto).Type#]; name=Protocol
// PROTOCOLTYPE_DOT_1-DAG: Keyword/CurrNominal: Type[#any ExistentialProto.Type#]; name=Type |
What are your thoughts on these three completions: Does either look incorrect to you? If so, why? |
I think according to my changes since we are checking the canonical type to be |
According to this logic, the result of appending
|
At the moment, the expected output as per my logic is |
In terms of the implementation, I feel like the syntactic sugar for parenthesis, i.e |
What do you mean by outcome, and what type are you referring to? |
0fd78cb
to
69e67bb
Compare
With the latest changes, the test passes. |
Please check that other IDE tests pass too. |
All tests pass: Testing Time: 40.10s
Excluded : 9854
Unsupported : 6
Passed : 480
Expectedly Failed: 1
2 warning(s) in tests |
@swift-ci please smoke test Linux |
@AnthonyLatsis |
69e67bb
to
d27484a
Compare
1f0eb6d
to
6bffda5
Compare
[.]Type
completion for (any P).
to produce singleton metatype instead of existential metatype.[.]Type
completion for (any P).
to produce singleton metatype instead of existential metatype
…tatype instead of existential metatype. Resolves swiftlang#65843 The type completion for (any P). is a singleton meta type which currently falsely produces any P., i.e, an existential meta type.
6bffda5
to
f64014a
Compare
@ahoppen |
Have you tried running the test locally? |
Yes, of course I did. |
Could you trigger the CI bot? |
@swift-ci please smoke test macOS |
Build failure seems unrelated? |
Could you trigger CI once again? |
@swift-ci please smoke test macOS |
CI looks good now. |
@AnthonyLatsis |
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.
Please make sure these cases work too:
P.#^TOKEN1^# // Type[#any P.Type#]
((P)).#^TOKEN2^# // Type[#any P.Type#]
(P.Type).#^TOKEN3^# // Type[#any P.Type.Type#]
(any P).Type.#^TOKEN4^# // Type[#(any P).Type.Type#]
(any P.Type).#^TOKEN5^# // Type[#(any P.Type).Type#]
Quick clarification:
|
Resolves #65843
The type completion for
(any P).
is a singleton meta type which currently falsely producesany P.
, i.e, an existential meta type.