Skip to content

Fix erasure of This types. #696

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

Closed
wants to merge 2 commits into from
Closed

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Jun 25, 2015

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.

Fixes #685. Review by @smarter.

odersky added 2 commits June 25, 2015 22:03
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.
def self = z
}
test(new BBuf(collection.mutable.ListBuffer[String]()))
// test(collection.mutable.ListBuffer[String]())
Copy link
Contributor

Choose a reason for hiding this comment

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

why was test commented out?

@odersky
Copy link
Contributor Author

odersky commented Jun 26, 2015

Superseded by #697

@odersky odersky closed this Jun 26, 2015
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