Skip to content

Fix #2140: Avoid exponential subtype complexity #2890

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
Jul 20, 2017

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Jul 19, 2017

Avoid exponential subtype complexity arising from revisiting |-types
unnecessarily.

Copy link
Member

@smarter smarter left a comment

Choose a reason for hiding this comment

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

Nice!

@@ -993,7 +993,7 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
case tp: ProtoType => false
case tp: RefinedOrRecType => isCovered(tp.parent)
case tp: AnnotatedType => isCovered(tp.underlying)
case AndType(tp1, tp2) => isCovered(tp1) && isCovered(tp2)
case tp: AndOrType => isCovered(tp.tp1) && isCovered(tp.tp2)
Copy link
Member

Choose a reason for hiding this comment

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

The documentation of the method needs to be updated to refer to AndOrTypes instead of AndTypes

odersky added 2 commits July 20, 2017 10:15
Avoid exponential subtype complexity arising from revisiting |-types
unnecessarily.
and eliminate redundant case in isCovered.
@odersky odersky merged commit 56933ec into scala:master Jul 20, 2017
@allanrenucci allanrenucci deleted the fix-#2140 branch December 14, 2017 19:18
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