-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Code completion fixes [5.0 01/07] #21748
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
AnnaZaks
merged 14 commits into
swiftlang:swift-5.0-branch-01-07-2019
from
slavapestov:code-completion-fixes-5.0-01-07
Jan 11, 2019
Merged
Code completion fixes [5.0 01/07] #21748
AnnaZaks
merged 14 commits into
swiftlang:swift-5.0-branch-01-07-2019
from
slavapestov:code-completion-fixes-5.0-01-07
Jan 11, 2019
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
It looks like Type::subst() was subsequently fixed for GenericFunctionTypes in 06d1679 so we can remove this hack.
…eclared type In a protocol, the overload signature type of a property is (Self) -> (), not (Proto) -> ().
…ocols and superclass constraints on an archetype Semantically, these are not superclass/refined-protocol members. If I have a generic parameter <T : P & Q>, then when looking at a value of type T, members of P and Q are at the same "level" as if I had a value of type (P & Q).
…tential type It's better to use the 'Self' archetype here.
…n existential type It's better to use the 'Self' archetype here.
It's no longer needed after the previous set of changes, and removing it fixes a crash. Fixes <rdar://problem/46853611>.
… is used with protocol conformance
Consider this setup:
protocol Proto {
func foo() {}
}
class Base : Proto {
func foo() {}
}
class Derived : Base {
...
}
When completing members of a Derived instance, we find both the protocol's
foo() and the base class's foo(). These have the following types:
- Proto.foo: <Self : Proto> (Self) -> () -> ()
- Base.foo: (Base) -> () -> ()
If we simply substitute the base type (Derived) into the type of the protocol
member, we get (Derived) -> () -> (), which is different than the type of
Base.foo, so we get both declarations in the completion list.
Instead, use the 'Self' type for the specific class of the conformance,
which in this case is 'Base' even if we're looking at members of 'Derived'.
Fixes <rdar://problem/21161476>, <https://bugs.swift.org/browse/SR-1181>.
The logic here had diverged from UnqualifiedLookup. One day we'll merge the two, for now clean it up a bit to match. Note that all generic parameters now have 'Reason' reported as 'Local'. I don't believe this really matters. Fixes <rdar://problem/20530021>.
AnnaZaks
approved these changes
Jan 11, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
rdar://problem/20530021, rdar://problem/21161476, https://bugs.swift.org/browse/SR-1181, rdar://problem/46853611