Skip to content

[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

Merged
merged 1 commit into from
Nov 7, 2019

Conversation

hborla
Copy link
Member

@hborla hborla commented Nov 6, 2019

rdar://problem/56942731

@hborla hborla requested a review from xedin November 6, 2019 21:53
@hborla
Copy link
Member Author

hborla commented Nov 6, 2019

@swift-ci please smoke test

@@ -3399,6 +3399,13 @@ bool ConstraintSystem::repairFailures(
break;
}

case ConstraintLocator::InstanceType: {
if (lhs->hasUnresolvedType() || rhs->hasUnresolvedType())
Copy link
Contributor

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()?

Copy link
Member Author

@hborla hborla Nov 6, 2019

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?

Copy link
Contributor

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.

Copy link
Member Author

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, no problem!

Copy link
Contributor

@benlangmuir benlangmuir left a 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.

@hborla
Copy link
Member Author

hborla commented Nov 6, 2019

@benlangmuir oops, yes. Thank you!

@hborla hborla force-pushed the same-type-regression branch from 9e8f5d0 to b560261 Compare November 6, 2019 22:02
@hborla
Copy link
Member Author

hborla commented Nov 6, 2019

@swift-ci please smoke test

@hborla
Copy link
Member Author

hborla commented Nov 6, 2019

preset=buildbot,tools=R,stdlib=RD
@swift-ci please test with preset macOS

@xedin
Copy link
Contributor

xedin commented Nov 6, 2019

On the note about the tests, I think we should do a requisition and remove no assertions requirement from the "fast" perf tests since they became a constant pain for no real gain in testing time...

@hborla hborla merged commit 2394bab into swiftlang:master Nov 7, 2019
@hborla hborla deleted the same-type-regression branch November 7, 2019 00:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants