Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Partial fix #21242: Add REPL init script setting Test with flag at REPL startup: ```scala > ./bin/scalaQ --repl-init-script 'println("Hello from init script!"); val i = 2 * 2' [warning] MainGenericRunner class is deprecated since Scala 3.5.0, and Scala CLI features will not work. [warning] Please be sure to update to the Scala CLI launcher to use the new features. [warning] Check the Scala 3.5.0 release notes to troubleshoot your installation. Hello from init script! val i: Int = 4 Welcome to Scala 3.6.4-RC1-bin-SNAPSHOT-nonbootstrapped-git-5ea7c13 (17.0.12, Java OpenJDK 64-Bit Server VM). Type in expressions for evaluation. Or try :help. scala> ``` Test inside REPL: ```scala sbt:scala3> repl Welcome to Scala 3.6.4-RC1-bin-SNAPSHOT-nonbootstrapped-git-20e6f11 (17.0.12, Java OpenJDK 64-Bit Server VM). Type in expressions for evaluation. Or try :help. scala> :reset --repl-init-script:'println("Hello from init script!")' Resetting REPL state with the following settings: --repl-init-script:println("Hello from init script!") Hello from init script! scala> ``` scala-cli can use this flag to passing init code to REPL.
- Loading branch information