Skip to content

[SpaceEngine] intersect cleanups #16765

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 2 commits into from
May 23, 2018

Conversation

xedin
Copy link
Contributor

@xedin xedin commented May 22, 2018

Includes new intersect method which always returns simplified space and extracted decompose method which returns disjunct from decomposition of the type.

…esult

Based on the `intersect` usage it would be beneficial for it to
always return a result in simplified form instead of relying on
callers to request simplification. Also as part of this change
remove boilerplate code from commutative space intersections e.g.
Type ∩ Bool, Unknown ∩ Disjuct.
@xedin xedin requested a review from CodaFi May 22, 2018 08:33
@xedin
Copy link
Contributor Author

xedin commented May 22, 2018

@swift-ci please test

@xedin
Copy link
Contributor Author

xedin commented May 22, 2018

@swift-ci please test source compatibility

PAIRCASE (SpaceKind::UnknownCase, SpaceKind::Constructor):
return other.intersect(*this, TC, DC);
PAIRCASE(SpaceKind::UnknownCase, SpaceKind::Type):
PAIRCASE(SpaceKind::UnknownCase, SpaceKind::Constructor):
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Could you put the spaces back?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, missed that one, thanks!

Copy link
Contributor

@CodaFi CodaFi left a comment

Choose a reason for hiding this comment

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

Modulo formatting nit, LGTM

It seems benefitial to have type decomposition into disjunct space
as a separate function, because that code is regularly repeated in
`intersect`, `isSubspace` and `minus` methods.
@xedin xedin force-pushed the more-space-engine-cleanups branch from 8c2bb3a to 1101070 Compare May 22, 2018 18:17
@xedin
Copy link
Contributor Author

xedin commented May 22, 2018

@swift-ci please test

@swiftlang swiftlang deleted a comment from swift-ci May 22, 2018
@xedin xedin merged commit 80c38cb into swiftlang:master May 23, 2018
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