Skip to content

Fix #1753: Better comparison of path types #1760

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 30, 2016

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Nov 30, 2016

In this case, a path went through a type parameter which was
aliased to a singleton type. Need to dealias to get to the
special case handling two paths.

Review by @felixmulder

In this case, a path went through a type parameter which was
aliased to a singleton type. Need to dealias to get to the
special case handling two paths.
@odersky odersky changed the title Fix #1753 - Better comparison of path types Fix #1753: Better comparison of path types Nov 30, 2016
Copy link
Contributor

@felixmulder felixmulder left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM, thanks @odersky!

import bTypes._
val b: BTypesFromSymbols[int.type] = bTypes
val x: int.type = bTypes.int
val y: bTypes.int.type = int
Copy link
Contributor

Choose a reason for hiding this comment

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

What are these two lines with x and y?

Used it for debugging?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Break the problem apart into two subtype tests. I thought it was good to add this.

isSubType(tp1, tp2i) // see z1720.scala for a case where this can arise even in typer.
isSubType(tp1, tp2i)
// see z1720.scala for a case where this can arise even in typer.
// Also, i1753.scala, to show why the dealias above is necessary.
Copy link
Contributor

Choose a reason for hiding this comment

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

strange indentation here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I use this style on occasion. Basically, if an end of line comment is too long I put several
indented lines after the commented statement. I find it sometimes clearer than having the comments before (depends on the wording of the comment).

@odersky odersky merged commit b9350f4 into scala:master Nov 30, 2016
@allanrenucci allanrenucci deleted the fix-#1753 branch December 14, 2017 16:59
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