Skip to content

Conversation

CodaFi
Copy link
Contributor

@CodaFi CodaFi commented Dec 16, 2019

Const-qualify the members of SelectedOverload and change up the interface to the subscript-y bits of CSApply so it's a bit clearer what all they're doing with it. This pushes the failure path up and out to its callers, where it's now apparent that only visitSubscriptExpr ever needed to use it. As it's CSApply's responsibility to create DynamicSubscriptExprs - we'd be in quite a lot of trouble if we somehow were able to build one then lost the overload that got us there.

Have callers resolve the SelectedOverload instead of the callee.  Then make the error paths more apparent, and flush Optional<SelectedOverload> wherever it can be found.
@CodaFi CodaFi requested a review from xedin December 16, 2019 19:44
@CodaFi
Copy link
Contributor Author

CodaFi commented Dec 16, 2019

@swift-ci please smoke test

// have a proper overload selected from subscript call, might be because
// solver was allowed to return free or unresolved types, which can
// happen while running diagnostics on one of the expressions.
if (!overload) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@xedin A quick grep reveals we have no tests that emit these diagnostics. Should this just use getOverloadChoice?

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like there are some in d111e9b but they are crash tests so diagnostic is not verified. I have ran a couple with -debug-constraints and it looks like new framework is handling them well now, so I'd say let's remove this logic from here and maybe assert instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Confirmed, this passes the compiler crasher suite.

Copy link
Contributor

Choose a reason for hiding this comment

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

Great!

@CodaFi
Copy link
Contributor Author

CodaFi commented Dec 16, 2019

@swift-ci please smoke test

@CodaFi
Copy link
Contributor Author

CodaFi commented Dec 16, 2019

@swift-ci please smoke test

1 similar comment
@CodaFi
Copy link
Contributor Author

CodaFi commented Dec 16, 2019

@swift-ci please smoke test

@CodaFi
Copy link
Contributor Author

CodaFi commented Dec 16, 2019

⛵️

@CodaFi CodaFi merged commit 6d8e5f1 into swiftlang:master Dec 16, 2019
@CodaFi CodaFi deleted the constant-contact branch December 16, 2019 21:33
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.

2 participants