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
Scala 3.3.2: class file ... is broken, reading aborted with class java.util.NoSuchElementException
contextual$
#12418
Comments
What I ask myself is: If I build Play with 3.3.2 will it be necessary to make people also upgrade to Scala 3.3.2 in their projects? I thought this would not be necessary (but please correct me if I am wrong). |
class java.util.NoSuchElementException
class java.util.NoSuchElementException
contextual$
No, that should not be necessary. I'll investigate your issue. |
Running with java.util.NoSuchElementException: contextual$
at dotty.tools.dotc.util.ReadOnlyMap.apply(ReadOnlyMap.scala:29)
at dotty.tools.dotc.core.tasty.TastyUnpickler.readNameContents(TastyUnpickler.scala:72)
at dotty.tools.dotc.core.tasty.TastyUnpickler.$init$$$anonfun$1(TastyUnpickler.scala:94)
at dotty.tools.tasty.TastyReader.until(TastyReader.scala:125)
at dotty.tools.dotc.core.tasty.TastyUnpickler.<init>(TastyUnpickler.scala:94)
at dotty.tools.dotc.core.tasty.TastyUnpickler.<init>(TastyUnpickler.scala:34)
at dotty.tools.dotc.core.tasty.DottyUnpickler.<init>(DottyUnpickler.scala:48) /cc @bishabosha |
I have my doubts right now that Scala 3.3.1 can handle the Tasty files Scala 3.3.2 generates just by looking (grep'ing) at the source code:
But maybe I am wrong and there are other mechanism I am not aware of which might make things work. |
A workaround might be to make PathBindableMacros.scala emit |
So while these name prefixes such as |
@sharable private val simpleNameKinds = util.HashMap[Int, ClassifiedNameKind]()
@sharable private val qualifiedNameKinds = util.HashMap[Int, QualifiedNameKind]()
@sharable private val numberedNameKinds = util.HashMap[Int, NumberedNameKind]()
@sharable private val uniqueNameKinds = util.HashMap[String, UniqueNameKind]() unique names is the outlier, in using any user-defined string as the key, rather than tag int defined in TastyFormat.NameTags. |
I can confirm Scala 3.3.3 fixes the problem. Thanks! |
Asking @SethTisue @lrytz @som-snytt @sjrd @smarter for advice.
Just yesterday I made Play build with with 3.3.2:
Now I run into a problem which IMHO is caused by
How to reproduce:
main
(3ace273)sbt +publishLocal
3.3.2
makes compiliation work however (inbuild.sbt
:crossScalaVersions := Seq("2.13.12", "3.3.2"),
)So this is the file which this problem is about: https://github.com/playframework/playframework/blob/main/core/play/src/main/scala-3/play/api/mvc/PathBindableMacros.scala
If I build Play with Scala 3.3.1 by reverting yesterdays commit (
git revert -m 1 552f5a0ae1876804b06114a94b619712a22c46c4
), I can run the samples project again with Scala 3.3.1 set in the project.Now what I found out is that the tasty files generated by Play with Scala 3.3.1 vs Scala 3.3.2 differ:
./core/play/target/scala-3.3.1/classes/play/api/mvc/PathBindableMacros.tasty
containsevidence$
./core/play/target/scala-3.3.2/classes/play/api/mvc/PathBindableMacros.tasty
replacedevidence$
withcontextual$
I also inspected the class files
./core/play/target/scala-3.3.1/classes/play/api/mvc/PathBindableMacros.class
./core/play/target/scala-3.3.2/classes/play/api/mvc/PathBindableMacros.class
with
javap -v
and it looks like they are identical (except some bytes in the tasty part):The text was updated successfully, but these errors were encountered: