-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix trait constructors #699
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
Fix trait constructors #699
Conversation
Can we add |
6a18eee
to
69141c6
Compare
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.
Uncommented parts that were left accidentally commented out when debugging.
Trait constructors added a this to the constructor of a trait, which is useless because the constructor's type is unit. By contrast, it's good to rename the DefDef to the new name.
69141c6
to
3290164
Compare
Rebased on top of pending #697 |
It did not do enough to carry its own weight, in particular because DenotationTransformers do have a price - every encountered denotation in the whole program is passed through them. The name change from <init> to $init$ was all it did, that is now rolled into Mixin. Also renamed IMPLCLASS_CONSTRUCTOR to TRAIT_CONSTRUCTOR.
@smarter Even without traitConstructors, we get "bad owners" in several tests when checking after the last group. Not sure why. Would be good to investigate. |
Trait constructors added a this to the constructor of a trait, which is useless
because the constructor's type is unit. By contrast, it's good to rename the DefDef
to the new name.
Discovered while trying to isolate #685. This causes a -Ycheck:traitConstructor error for all traits.
Review by @DarkDimius