zio / zio-cli

Rapidly build powerful command-line applications powered by ZIO
https://zio.dev/zio-cli
Apache License 2.0
128 stars 78 forks source link

Compile-time error on Scala 3 #179

Open sergeda opened 1 year ago

sergeda commented 1 year ago

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)
jdegoes commented 1 year ago

/bounty $50

algora-pbc[bot] commented 1 year ago

💎 $50 bounty • ZIO

Steps to solve:

  1. Start working: Comment /attempt #179 with your implementation plan
  2. Submit work: Create a pull request including /claim #179 in the PR body to claim the bounty
  3. 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!

Add a bounty • Share on socials

andrzejressel commented 1 year ago

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.

pragmaxim commented 6 months ago

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.