scala-cli icon indicating copy to clipboard operation
scala-cli copied to clipboard

Stackoverflow if the using dep directive is incorrect

Open yadavan88 opened this issue 1 year ago • 1 comments

Version(s) 1.1.0 Describe the bug If the using dep is not a valid one, in some cases, the scala-cli throws Stackoverflow error.

To Reproduce

//> using scala 3
//> using dep "com.lihaoyi" :: "fastparse" : "3.0.2"
//import fastparse.* 
object MyApp extends App {
    println("Yayyy...")
}

Expected behaviour It should show compilation error that the dependency directive is not correct. However, it just fails with Stackoverflow error. Please note that if there is no space between groupId and artifactId, it shows compilation error as expected.

//> using dep "com.lihaoyi"::"fastparse":"3.0.2"

Even this also throws StackOverflow error:

//> using dep com.lihaoyi :: fastparse : 3.0.2

yadavan88 avatar Dec 14 '23 16:12 yadavan88

I wonder if https://github.com/VirtusLab/using_directives/pull/58 could help here 🤔

(Although it might just go into an infinite loop)

JD557 avatar Jan 15 '24 13:01 JD557