-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[ConstraintSystem] Allow binding metatypes to succeed if one contains a hole #28116
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
@swift-ci please smoke test |
@@ -3399,6 +3399,13 @@ bool ConstraintSystem::repairFailures( | |||
break; | |||
} | |||
|
|||
case ConstraintLocator::InstanceType: { | |||
if (lhs->hasUnresolvedType() || rhs->hasUnresolvedType()) |
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.
Instead of checking unresolved type directly should be actually frame it in terms of a hole e.g. ->hasHole()
?
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 can add hasHole
that does the same thing as hasUnresolvedType
. I considered that for the last PR, but didn't know if it was worth having two methods that do the same thing. I do think we should rename it at least once CSDiag is gone, as the only use for UnresolvedType
will be for holes. What do you think?
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 think we better introduce hasHole
sooner than later because that gives up a clear distinction here. We can then remove hasUnresolvedType
completely when the time comes.
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.
Though, if I do add hasHole
now, I'd prefer to do that in my refactoring PR, so that this specific PR isn't renaming a bunch of stuff
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.
Sure, no problem!
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.
Do we need to update Sema/type_checker_perf/fast/rdar21374729.swift
again to match this? It will not run in smoke tests, so PR testing won't notice.
@benlangmuir oops, yes. Thank you! |
9e8f5d0
to
b560261
Compare
@swift-ci please smoke test |
preset=buildbot,tools=R,stdlib=RD |
On the note about the tests, I think we should do a requisition and remove |
rdar://problem/56942731