-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Remove PolymorphicFunctionType #5935
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
Remove PolymorphicFunctionType #5935
Conversation
@swift-ci Please smoke test |
b827fba
to
fd839e2
Compare
@@ -0,0 +1,3 @@ | |||
// RUN: %target-swift-ide-test -code-completion -code-completion-token=A -source-filename=%s | |||
// REQUIRES: asserts |
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.
doesn't require asserts any more
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 agree that the uses of SubstitutedType
are fragile. In the first case, getMemberSubstitutions()
seems like a far simpler and more correct solution.
For accessibility and availability checking, maintaining proper sugar in the Type
(with all of the appropriate declaration references as written) would make it far easier. Or, better yet, use the TypeRepr
for these checks: then we have all of the source-location information.
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.
Kinda surprised we can do this, because IIRC we haven't done anything to preclude this recursion elsewhere.
I browsed through everything thus far, and it's looking great. I hadn't realized we were relying on |
4087297
to
33da79f
Compare
@swift-ci Please smoke test Linux |
1 similar comment
@swift-ci Please smoke test Linux |
@swift-ci Please test macOS |
1 similar comment
@swift-ci Please test macOS |
Build failed |
@DougGregor This is now at the point where check-swift-validation passes on my Mac, however it looks like I broke something in SwiftPM, and lldb needs changes as usual. Progress :) |
33da79f
to
035dff4
Compare
@swift-ci Please test macOS |
Build failed |
@swift-ci Please test macOS |
035dff4
to
78b4c9e
Compare
@swift-ci Please smoke test macOS |
1 similar comment
@swift-ci Please smoke test macOS |
Build failed |
78b4c9e
to
92727d5
Compare
@swift-ci Please smoke test macOS |
…tDecl These can contain PolymorphicFunctionTypes, and should no longer be accessed.
Instead of checking if the function has a contextual type, the more accurate predicate here is if it already has a generic environment.
92727d5
to
1809fc8
Compare
@swift-ci Please smoke test macOS |
1 similar comment
@swift-ci Please smoke test macOS |
@swift-ci Please smoke test Linux |
1 similar comment
@swift-ci Please smoke test Linux |
@swift-ci Please smoke test Linux |
@swift-ci Please smoke test macOS |
@swift-ci Please smoke test Linux |
@swift-ci Please smoke test macOS |
@swift-ci Please test Linux |
@swift-ci Please test macOS |
Build failed |
Build failed |
Waahoooooooo! |
For those following along at home, this is a continuation of the work in #4849 and earlier commits like da4af64. PolymorphicFunctionType is the contextual type equivalent of GenericFunctionType, a polymorphic function signature but written in terms of archetypes. It didn't make much sense in the first place, and GenericFunctionType had a FIXME comment explaining it should replace PolymorphicFunctionType -- since 2013 :-)
There are three big pieces here: