Skip to content

Downgrading default Scala version to match Ammonite is wrong with using directives #3467

Open
@Gedochao

Description

@Gedochao

Version(s)
1.6.1

Describe the bug
When the default Scala version is not yet supported by the default Ammonite version, we automatically downgrade to a hardcoded version.
This, however, only works if the Scala version is passed to the REPL via a command line option.
Whatever is defined in a using directive gets ignored at the moment.

To Reproduce

scala-cli repl --amm --scala-snippet '//> using scala 3.3.4' --power
# Scala 3.6.3 is not yet supported with this version of Ammonite
# Defaulting to Scala 3.5.1
# Scala 3.6.3 is not yet supported with this version of Ammonite
# Defaulting to Scala 3.5.1
# Compiling project (Scala 3.5.1, JVM (23))
# Compiled project (Scala 3.5.1, JVM (23))
# Loading...
# Welcome to the Ammonite Repl 3.0.0-2-6342755f (Scala 3.5.1 Java 23.0.1)
# @  

Expected behaviour
Ammonite REPL should respect Scala version from using directives.

Metadata

Metadata

Assignees

No one assigned

    Labels

    AmmonitebugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions