Skip to content

Fixes #24233: Remove misleading JDK compatibility hint for TASTy errors#25171

Merged
tgodzik merged 7 commits intoscala:mainfrom
Bbn08:fix/my-first-contribution
Feb 4, 2026
Merged

Fixes #24233: Remove misleading JDK compatibility hint for TASTy errors#25171
tgodzik merged 7 commits intoscala:mainfrom
Bbn08:fix/my-first-contribution

Conversation

@Bbn08
Copy link
Contributor

@Bbn08 Bbn08 commented Feb 2, 2026

Fix misleading JDK compatibility error message for TASTy version mismatches
Fixes #24233

Description

When the compiler encounters a TASTy version mismatch (e.g., attempting to read a TASTy file produced by a newer compiler version like 3.7.1 with compiler 3.3.6), it throws an UnpickleException. The error handling code in ClassfileParser and ClassfileTastyUUIDParser was catching this as a generic RuntimeException and appending a misleading message suggesting to "check the JDK compatibility of your Scala version."

This message was confusing because:

The error is about TASTy format versions (majorVersion: 28), not Java classfile versions
The JDK version suggestion is irrelevant to TASTy compatibility issues

Changes Made

  • Modified exception handlers in ClassfileParser.scala and ClassfileTastyUUIDParser.scala
  • Added pattern matching to detect UnpickleException specifically
  • Suppress JDK compatibility hint for TASTy unpickling errors
  • Preserve the hint for actual classfile version issues

Example

Before:

class file ... is broken (version 52.0),
  please check the JDK compatibility of your Scala version (3.3.6),
  reading aborted with class dotty.tools.tasty.UnpickleException:
  TASTy signature has wrong version...

After:

class file ... is broken,
  reading aborted with class dotty.tools.tasty.UnpickleException:
  TASTy signature has wrong version...

The UnpickleException message already contains clear information about the TASTy version mismatch, making the JDK hint unnecessary and confusing.

Testing

  • Manually verified code correctness through inspection
  • Changes are minimal and focused on error message formatting
  • No functional changes to compilation logic

Bbn08 added 6 commits February 3, 2026 00:02
… errors

When a TASTy version mismatch occurs (e.g., reading a TASTy file from a
newer compiler), the error incorrectly suggests checking "JDK compatibility"
even though the issue is with TASTy format versions, not Java classfile versions.

This change:
- Adds pattern matching in exception handlers to detect UnpickleException
- Suppresses the JDK compatibility addendum for TASTy unpickling errors
- Preserves the JDK hint for actual classfile version issues
- Applies fix to both ClassfileParser and ClassfileTastyUUIDParser for consistency
@Bbn08
Copy link
Contributor Author

Bbn08 commented Feb 2, 2026

Hi!

Some CI checks (test-scala3-compiler-nonbootstrapped and related jobs) keep getting cancelled due to GitHub Actions infrastructure issues:

  • "The job was not acquired by Runner of type hosted even after multiple attempts"
  • "Internal server error"

I've tried triggering re-runs by pushing new commits, but the same infrastructure errors keep occurring.

Could a maintainer please click Re-run cancelled jobs when you get a chance? Thank you!

Copy link
Contributor

@tgodzik tgodzik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@tgodzik tgodzik merged commit 4810100 into scala:main Feb 4, 2026
58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clueless error message

3 participants