File tree 1 file changed +10
-10
lines changed
modules/cli/src/main/scala/scala/cli/commands/repl
1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -75,18 +75,18 @@ object Repl extends ScalaCommand[ReplOptions] with BuildCommandHelpers {
75
75
val maybeDowngradedScalaVersion = {
76
76
val isDefaultAmmonite = ammonite.contains(true ) && ammoniteVersionOpt.isEmpty
77
77
extension (s : MaybeScalaVersion )
78
- private def isLts : Boolean = s.versionOpt
79
- .exists(v =>
80
- v.startsWith(Constants .scala3LtsPrefix) ||
81
- ScalaVersionUtil .scala3Lts.contains(v.toLowerCase)
82
- )
78
+ private def isLtsAlias : Boolean =
79
+ s.versionOpt.exists(v => ScalaVersionUtil .scala3Lts.contains(v.toLowerCase))
80
+ private def isLts : Boolean =
81
+ s.versionOpt.exists(_.startsWith(Constants .scala3LtsPrefix)) || isLtsAlias
83
82
baseOptions.scalaOptions.scalaVersion match
84
83
case Some (s)
85
- if isDefaultAmmonite && s.isLts && s.versionOpt
86
- .exists(_.coursierVersion > maxAmmoniteScalaLtsVer.coursierVersion) =>
87
- logger.message(
88
- s " Scala ${s.versionOpt.getOrElse(Constants .scala3Lts)} is not yet supported with this version of Ammonite "
89
- )
84
+ if isDefaultAmmonite && s.isLts &&
85
+ (s.versionOpt
86
+ .exists(_.coursierVersion > maxAmmoniteScalaLtsVer.coursierVersion) ||
87
+ s.isLtsAlias) =>
88
+ val versionString = s.versionOpt.filter(_ => ! s.isLtsAlias).getOrElse(Constants .scala3Lts)
89
+ logger.message(s " Scala $versionString is not yet supported with this version of Ammonite " )
90
90
logger.message(s " Defaulting to Scala $maxAmmoniteScalaLtsVer" )
91
91
Some (MaybeScalaVersion (maxAmmoniteScalaLtsVer))
92
92
case None
You can’t perform that action at this time.
0 commit comments