Open WojciechMazur opened 4 months ago
It does seem surprising that it wouldn't complain that the bytecode version is too high.
But it's also surprising that Scala 2 doesn't complain. This is speculation, but I wonder if it has to do with Scala 2 being intentionally tolerant of missing indirect dependencies, as per SCP-009.
Based on OpenCB failure in
getkyo/kyo
- build logsWhen a Scala 3 library (ox) is published using JDK 21 and uses API introduced in this version, usage of this artifact in other project using lower JDK version (kyo) would lead to compiler crash. The crash message contains phrase
the classfile defining the type might be missing from the classpath
- however we should try to handle the crash using error reporting instead of uncontrolled failure. Scala 2.13 does not crash at compile time, but rather fails at runtimeCompiler version
All Scala 3 versions
Minimized code
Output
Expectation
Compiler should provide meaningful message about incompatible JDK. In Scala 2.13 it compiles but fails at runtime.