Skip to content

[Constraint system] Eliminate global flag UnderlyingTypeForOpaqueReturnType #29487

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

DougGregor
Copy link
Member

Make this information contextual (per type) rather than global (per
constraint system) so we don’t misapply it.

SolutionResult better captures what can happen when solving a constraint
system for the given expression occurs than the ad hoc SolutionKind return
& small vector of Solution results. Also, try to make this logic less
convoluted.
…rnType

Make this information contextual (per type) rather than global (per
constraint system) so we don’t misapply it.
@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor DougGregor requested a review from xedin January 27, 2020 23:47
@DougGregor
Copy link
Member Author

Only the last two commits are unmerged. Huh.

solutions.assign(std::make_move_iterator(ambiguousSolutions.begin()),
std::make_move_iterator(ambiguousSolutions.end()));
dumpSolutions();
solution.markAsDiagnosed();
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 the same 'use-after-move' problem @CodaFi mentioned is present here as well...

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm. It's the same one. I'll roll this into an upcoming PR.

Copy link
Contributor

@xedin xedin left a comment

Choose a reason for hiding this comment

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

Looks good to me, it does make more sense to have opaque result bit as a contextual information instead of a flag.

@DougGregor DougGregor merged commit ccde540 into swiftlang:master Jan 28, 2020
@DougGregor DougGregor deleted the constraint-system-localized-opaque-result-type-flag branch January 28, 2020 04:41
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