Twirl has been generating code with Scala 2 syntax.
Therefore, when compiling a Scala 3 project with the "-source:future" scalac option,
the compilation would fail.
To address this issue, TwirlCompiler can now generate the appropriate code
depending on the Scala version.
The Scala version is set by build tools.
if you are using Maven or gradle, it will dynamically determine the Scala version
you are currently using and set it.
If you are using sbt, it will use the value of "scalaVersion". It can't dynamically
determine the Scala version since the version for code generation (2.12.x,
the runtime of sbt) and the version for compilation are different.
Twirl has been generating code with Scala 2 syntax. Therefore, when compiling a Scala 3 project with the "-source:future" scalac option, the compilation would fail.
To address this issue, TwirlCompiler can now generate the appropriate code depending on the Scala version.
The Scala version is set by build tools. if you are using Maven or gradle, it will dynamically determine the Scala version you are currently using and set it. If you are using sbt, it will use the value of "scalaVersion". It can't dynamically determine the Scala version since the version for code generation (2.12.x, the runtime of sbt) and the version for compilation are different.
This fixes https://github.com/playframework/twirl/issues/591.