Skip to content

Commit

Permalink
Better message on TASTY mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
romanowski committed May 4, 2023
1 parent b8d2966 commit 94760a7
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions tasty/src/dotty/tools/tasty/TastyHeaderUnpickler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,20 @@ object TastyHeaderUnpickler {
}
val minorVersion = showMinorVersion(MinorVersion, ExperimentalVersion)
val fileMinorVersion = showMinorVersion(fileMinor, fileExperimental)
s"""TASTy signature has wrong version.
| expected: {majorVersion: $MajorVersion, minorVersion: $minorVersion}
| found : {majorVersion: $fileMajor, minorVersion: $fileMinorVersion}
|
|""".stripMargin

if (MajorVersion == 28 && fileMajor == 28)
s"""Found a file on a classpath, that was compiled with a newer Scala version than the one currently used.
| Found: 3.$fileMinorVersion
| Supported: 3.$minorVersion or older
|
| Try updating your Scala version to 3.$fileMinorVersion or changing the classpath.""".stripMargin
else
// This should not happen in practice, but better safe than sorry
s"""TASTy signature has the wrong version that cannot be expressed as Scala version.
| expected: {majorVersion: $MajorVersion, minorVersion: $minorVersion}
| found : {majorVersion: $fileMajor, minorVersion: $fileMinorVersion}
|""".stripMargin

}

private def unstableAddendum =
Expand Down

0 comments on commit 94760a7

Please sign in to comment.