zio-cli
zio-cli copied to clipboard
Compile-time error on Scala 3
This code produce compile-time error:
enum Subcommand:
case IndexFile(file: Path)
val fileArg = Args.file("path-to-file", Exists.Yes) ?? "Path to the file"
val command = Command(name = "index-file", args = fileArg)
.withHelp("Index file")
.map{ path => Subcommand.IndexFile(path)}
Version is 0.4.0 , Scala is 3.3.0-RC2 Here is the error:
[error] java.lang.AssertionError: assertion failed: `wildApprox` failed to remove uninstantiated A
[error] scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8)
/bounty $50
💎 $50 bounty • ZIO
Steps to solve:
-
Start working: Comment
/attempt #179
with your implementation plan -
Submit work: Create a pull request including
/claim #179
in the PR body to claim the bounty - Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts
Thank you for contributing to zio/zio-cli!
I couldn't reproduce it (I believe the supplied code snippet is not enough), but I believe it's this :https://github.com/lampepfl/dotty/issues/17305. I believe it's something on Dotty side, I'll see if I can minimize it.
EDIT: The good thing is that is means something is wrong with your code - so I guess If you find it you don't have to wait for new Dotty version.
This error seems to happen in case of any compilation error related to the syntax needed in the DSL, so it is indeed a dotty bug, just go line by line or comment out blocks of code and find the real compilation error to get rid of it.