-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix erasure of this types and refactor value class erasure #697
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
odersky
merged 6 commits into
scala:master
from
dotty-staging:fix/erasure-thistypes-vcs
Jun 26, 2015
Merged
Fix erasure of this types and refactor value class erasure #697
odersky
merged 6 commits into
scala:master
from
dotty-staging:fix/erasure-thistypes-vcs
Jun 26, 2015
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Jun 26, 2015
Merged
rebased to master |
Thistypes erased to the underlying class. This is wrong. When seen as part of some other type, a ThisType has to erase to the erasure of the underlying type (i.e. the erasure if the selftype of the class). unittest-collections.scala failed with a MethodNotFound error because the erasure was computed incorrectly. On the other hand, a tree with a ThisType type, should keep the type, analogous to a tree with a TermRef type.
The file consisted of just a deprecation warning. Not sure what was deprecated; neither dotty nor scalac find anything wrong with it.
There's one behavioral change: on typedSelectFromTypeTree, we use erasedType as for a notmal ref. Before semiEraseVCs was always set to false here. I don't see how the treatment should be different. E.g. it should not matter if we see a x.y or T#y
Checking that constraints are closed caused cyclic reference exceptions in DottyBackedInterface. What's worrying is that these were seemingly not checked by the checkin tests. Or maybe there is some dependcy on compilation order that triggers the erros only in my setup.
Replace by the pair of methods erasure/valueErasure. The boolean parameter is still kept, but only as a confuration parameter of the erasure objects.
1effc93
to
28751a1
Compare
Uncommented parts that were left accidentally commented out when debugging.
@@ -14,7 +14,7 @@ import core._ | |||
import Phases.Phase | |||
import Types._, Contexts._, Constants._, Names._, NameOps._, Flags._, DenotTransformers._ | |||
import SymDenotations._, Symbols._, StdNames._, Annotations._, Trees._, Scopes._, Denotations._ | |||
import TypeErasure.{ erasure, ErasedValueType } | |||
import TypeErasure.{ erasure, valueErasure, ErasedValueType } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
erasure
does not need to be imported anymore.
LGTM otherwise, it's nice that this simplified erasure a bit. |
odersky
added a commit
that referenced
this pull request
Jun 26, 2015
Fix erasure of this types and refactor value class erasure
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thistypes erased to the underlying class. This is wrong. When seen as part of some other type,
a ThisType has to erase to the erasure of the underlying type (i.e. the erasure if the selftype
of the class). unittest-collections.scala failed with a MethodNotFound error because the erasure
was computed incorrectly.
On the other hand, a tree with a ThisType type, should keep the type, analogous to a
tree with a TermRef type.
Also, refactored value class erasure to avoid spreading semiEraseVCs.
Fixes #682
Rview by @DarkDimius @smarter