sbt/main
bitloi f4eff2da77 [2.x] fix: Eviction error for downgrade of Scala 3.x (#6694)
**Problem**
When scalaVersion is Scala 3.x and a dependency brings a newer
scala3-library_3, sbt did not report an eviction error or warning.
The compiler could be older than the standard library on the
classpath, breaking compile-time alignment (e.g. scala/scala3#25406).

**Solution**
- In Compiler.scala, add an else if ScalaArtifacts.isScala3(sv) branch
  in scalaInstanceConfigFromUpdate that finds scala3-library_* on the
  Compile report and, if scalaVersion < that revision, fails (or warns
  when allowUnsafeScalaLibUpgrade := true) with the same pattern as
  the existing Scala 2.13 check (PR 7480). Message uses compile-time
  alignment wording and "See evicted to know why ... was upgraded from".
- Set allowUnsafeScalaLibUpgrade := true on b3 in stdlib-unfreeze so
  existing b3/run and b3/checkScala still pass.
- Add scripted tests: stdlib-unfreeze-scala3-eviction (expect compile
  to fail) and stdlib-unfreeze-scala3-warn (expect success with warning).

Closes #6694
2026-03-16 00:15:43 +01:00
..
src [2.x] fix: Eviction error for downgrade of Scala 3.x (#6694) 2026-03-16 00:15:43 +01:00
NOTICE Transfer copyright to Scala Center 2023-06-20 16:39:07 +02:00