-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #5965: Make scala.quoted.Type poly-kinded #5988
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
535d9fc to
8484b2f
Compare
8484b2f to
73a0a2e
Compare
|
To make this work we also need to bootstrap |
|
Very interested to see where this goes. |
c677aae to
c64c599
Compare
|
@liufengyun maybe we should wait until #5990 is merged to merge this one. That PR will simplify the changes that are currently in |
|
Also, rebasing #5990 on this one would be more complex than the other way around. |
| import scala.reflect.ClassTag | ||
| import scala.runtime.quoted.Unpickler.Pickled | ||
|
|
||
| sealed abstract class Type[T <: AnyKind] { |
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.
Here I only added <: AnyKind and src-non-bootstrapped/scala/quoted/Type.scala contatins the current version without the bound.
liufengyun
left a comment
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.
Otherwise, LGTM
| tree.tpe.stripTypeVar match { | ||
| case tp: AppliedType => | ||
| val splicedType = tp.tycon.asInstanceOf[TypeRef].prefix.termSymbol | ||
| AppliedTypeTree(transformSplice(ref(splicedType).select(tpnme.splice)), tp.args.map(TypeTree(_))).withSpan(tree.span) |
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.
It is not obvious why there is no need to transformSplice on the type arguments.
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.
Maybe I should call transform on the arguments. I will double check.
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.
Actually, this whole branch is useless. This is already handled by the transformation done in the Staging phase.
tests/run-with-compiler/i5965.check
Outdated
| @@ -0,0 +1,15 @@ | |||
| { | |||
| val y: collection.immutable.List[scala.Int] = scala.List.apply[scala.Int](1, 2, 3) | |||
| (y: collection.immutable.List[evidence$1$_~$1]) | |||
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.
evidence$1$_~$1 was leaking here
liufengyun
left a comment
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.
Nice simplification 👍
Enable kind polimorphism by default by replacing `-Ykind-polymorphism` with `-Yno-kind-polymorphism`.
This branch should have been removed whe the logic in the staging Staging phase was split
No description provided.