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
Various improvements to Tasty Reader [ci: last-only] #9271
Conversation
val parameters = traitParams.map(_.nameString) | ||
s"parameterized trait ${parameters.mkString(s"${cls.nameString}(", ", ", ")")}" | ||
} | ||
cls.updateAttachment(new u.DottyParameterisedTrait(traitParams.toList)) |
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.
perhaps theres a more efficient representation we can use for 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.
or I guess more lightweight would be that its not necessary to record the actual parameters to present a correct error
7769f90
to
3627149
Compare
I've rebased and added a few new things in preparation for supporting Scala 3.0.0-M1 release |
8f392f1
to
82befac
Compare
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.
The changes outside of the DMZ of tasty look fine, so I'm happy for this to land. CI failed for the rec depth issue that I have a PR for (I restarted the job).
|
error in CI waiting for #9280 |
|
Following a discussion, it makes sense to prevent opaque type aliases. When the alias is visible in Scala 2 then the intended API of the opaque type is broken. It is possible to re-enable opaque types as long as they remain opaque until erasure, but they must be erased to their underlying type - so an efficient and correct representation should be found.
This also escapes Predef.classOf when creating a TypeApply
cea333c
to
8706224
Compare
I've now also added the changes to create local field symbols - which means pattern matching on dotty case classes works again |
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.
LGTM again, thank you Jamie!
@lrytz you want to give this a once-over, or shall we just merge it? |
I realised I accidentally overwrote the commits that made this work with 3.0.0 - so either this one should wait or I will open a new PR to add the changes again (I need to wait for tomorrow to access my other work laptop) Edit - second option is probably most simple and then I can add the settings flag to toggle the tasty reader also Second edit - those commits have been added back to the end of this PR now the CI for 8706224 passed |
I'll take a quick look as well. |
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.
Lovely, thanks for the speedy turnaround.
I've added back the commits that bring it to date with Scala 3.0.0-M1 nightly |
@@ -1793,6 +1793,16 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper | |||
val ps = psym.info.parents | |||
if (!ps.isEmpty && !superclazz.isSubClass(ps.head.typeSymbol)) | |||
pending += ParentSuperSubclassError(parent, superclazz, ps.head.typeSymbol, psym) | |||
if (!clazzIsTrait) { | |||
// TODO perhaps there can be a flag to skip this when we know there can be no Scala 3 definitions | |||
// or otherwise use an optimised representation for trait parameters |
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.
Use -Ytasty-reader
#9293?
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.
yes that would work nicely
this adds a number of improvements to tasty reader suggested in scala/bug#12197
scala.PolyFunction
@scala.annotation.static
@scala.annotation.alpha annotation