-
Notifications
You must be signed in to change notification settings - Fork 1.1k
FullParametrization: allow to have $this of ThisType. #1091
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
Conversation
@sjrd please review |
* @param abstractOverClass if true, include the type parameters of the class in the method's list of type parameters. | ||
* @param liftThisType if true, require created $this to be $this: (Foo[A] & Foo,this). |
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.
Is Foo,this
a typo for Foo.this
?
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.
Why not have the type of $this
simply be Foo.this
when liftThisType
is true?
As far as I understand, LGTM. |
@sjrd, neg tests fail as normal. Actual test failure is in ./scala-scala/src/library/scala/collection/immutable/TrieIterator.scala. I'm having a look at it. |
TailRec methods remain members of enclosing class, it means that they can refer to methods that require this.type. It means that tailrec, unlike value classes is not allowed to widen type of $this to it's full self type. Fixes scala#1089
If the method that recurses over a different type arguments, if this method is specialised, it would lead to method not being tail-rec anymore. Eg: def foo[@specialized A, @specialized B]: Unit = foo[B, A]
This is a simpler fix than the previous one. Local methods, cannot change `this` and do not need to go through FullParameterization.
rebased over master. |
LGTM. I'll rebase the other one to see if it passes. |
TailRec methods remain members of enclosing class,
it means that they can refer to methods that require this.type.
It means that tailrec, unlike value classes is not allowed to widen
type of $this to it's full self type.
Fixes #1089