Skip to content

unhelpful error when TASTy version is not compatible #18427

Closed
@som-snytt

Description

@som-snytt

Compiler version

3.x

Minimized code

Use cats-effect 3.5 or 3.4 with Scala 3.0.

Output

[info] Setting Scala version to 3.0.2 on 1 projects.
[info] Reapplying settings...
[info] ...
[error] error while loading $throws$package$,
[error] class file scala/runtime/$throws$package.class is broken, reading aborted with class dotty.tools.tasty.UnpickleException
[error] TASTy signature has wrong version.
[error]  expected: {majorVersion: 28, minorVersion: 0}
[error]  found   : {majorVersion: 28, minorVersion: 2}
[error]
[error] This TASTy file was produced by a more recent, forwards incompatible release.
[error] To read this TASTy file, please upgrade your tooling.
[error] The TASTy file was produced by Scala 3.2.2-bin-nonbootstrapped.
[error] error while loading package$,
[error] class file cats/package.class is broken, reading aborted with class dotty.tools.tasty.UnpickleException
[error] TASTy signature has wrong version.
[error]  expected: {majorVersion: 28, minorVersion: 0}
[error]  found   : {majorVersion: 28, minorVersion: 2}

Expectation

It would be helpful if the error message linked to the currently canonical explanation, which is currently the blog at https://www.scala-lang.org/blog/2022/08/17/long-term-compatibility-plans.html

Even better would be instructions that said plainly that the artifact is not "broken" but I must upgrade the compiler to some version V.

I understand, to some extent, how class files work.

This directive is surprisingly ambiguous:

[error] To read this TASTy file, please upgrade your tooling.

You mean my compiler version or something that produced the jar file or what?

Wikipedia lists how class file format versions are associated with spec versions, but nothing tells me what tool understands 28.2 tasty.

Noticed at:

https://discord.com/channels/632150470000902164/632628489719382036/1142924560325423246

Although I was specifically testing Scala x Cats versions, it's easy to imagine someone has been happily using Scala 3.n and then wants to try Lib m.p and it breaks obscurely.

Metadata

Metadata

Assignees

Labels

area:reportingError reporting including formatting, implicit suggestions, etcarea:tasty-formatissues relating to TASTy as a portable standardbetter-errorsIssues concerned with improving confusing/unhelpful diagnostic messagesitype:bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions