-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[CodeCompletion] Enable 'openArchetypes' when checking if convertible #25872
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
[CodeCompletion] Enable 'openArchetypes' when checking if convertible #25872
Conversation
```swift protocol Proto {} struct ConcreteProto {} struct MyStruct<T> {} extension MyStruct where T: Proto { static var option: MyStruct<ConcreteProto> { get } } func foo<T: Proto>(arg: MyStruct<T>) {} func test() { foo(arg: .#^HERE^#) } ``` In this case, the type of `MyStruct.option` is `MyStruct<ConcreteProto>` whereas the context type is `MyStruct<T> where T: Proto`. When checking the convertibility of them , we need to "open archetype types". rdar://problem/24570603 rdar://problem/51723460
@swift-ci Please smoke test |
Can you explain why we wouldn't always want to open archetypes in this function? I see there's one case where we don't, but I don't understand why |
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.
Not sure about code completion changes but change to isConvertibleTo
simple reasonable to me since archetype has to be opened and it's requirements have to be added to constraint system to property compare types from example.
It's |
Seems okay for now, but we should fix it if possible. |
FYI Regressions when turning on 'openArchetypes'
|
In this case, the type of
MyStruct.option
isMyStruct<ConcreteProto>
whereas the context type isMyStruct<T> where T: Proto
.When checking the convertibility of them , we need to "open archetype types".
rdar://problem/24570603
rdar://problem/51723460