-
Notifications
You must be signed in to change notification settings - Fork 149
Closed
Labels
missing featureSomething should have been implemented, but wasn't.Something should have been implemented, but wasn't.spreeusing directivesIssues tied with using directives.Issues tied with using directives.
Description
Version(s)
1.8.1
Describe the bug
The new using file
feature with URLs doesn't work when a query parameter is passed.
The request is correctly sent to the server, but Scala CLI fails to use the downloaded code.
To Reproduce
Assume the following server:
//> using dep com.lihaoyi::cask::0.10.2
object Codegen extends cask.MainRoutes:
@cask.get("/Special.scala")
def dynamicWithParam(prefix: Option[String] = None): String =
println("GOT PREFIX: " + prefix)
val _prefix = prefix.getOrElse("NONE")
val op = s"def specialPrint(msg: String): Unit = println(\"prefix:\" + msg)"
s"""|package special
|object Ops:
| $op""".stripMargin
initialize()
The following code works as expected:
//> using file "http://localhost:8080/Special.scala"
import special.Ops.*
object Crazy:
@main def run: Unit = specialPrint("bar")
But, when a query parameter is added to the using
clause, it fails:
//> using file "http://localhost:8080/Special.scala?prefix=foo"
import special.Ops.*
object Crazy:
@main def run: Unit = specialPrint("bar")
Fails with:
[error] value Ops is not a member of special
[error] import special.Ops.*
Even though the server logs the request correctly.
Expected behaviour
Both cases should compile and run.
Metadata
Metadata
Assignees
Labels
missing featureSomething should have been implemented, but wasn't.Something should have been implemented, but wasn't.spreeusing directivesIssues tied with using directives.Issues tied with using directives.