-
Notifications
You must be signed in to change notification settings - Fork 1.1k
assertion failed: wildApprox
failed to remove uninstantiated B (should be a type error)
#17305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi! Thank you for filing the issue. It would be incredibly helpful if we could get a zero-dependency reproduction (without |
Facing a similar issue. |
Have the same issue when using ZIO Cli |
Minimized: trait Wrapper[A1] {
def use(a: A1 => Unit): Unit
}
trait Assertion[A2] {}
def hideTypeInOut[A3](
c1: A3
)(using
hider: HideAInOut[A3]
): Wrapper[hider.Out] = ???
def entryPoint(): Unit = {
hideTypeInOut(1L)
.use((pair) => myAssert(pair)(someAssertion(2)))
}
private def myAssert[A4](a: A4)(assertion: Assertion[A4]): Unit = ()
// This should be Unit or generic, but let compiler figure it out
private def someAssertion(i: Int): Assertion[Int] = ???
trait HideAInOut[-A] {
type Out
def get(left: A): Out
}
object HideAInOut {
type Out[HideA, HideB] = HideAInOut[HideA] { type Out = HideB }
given [ImplicitA]: HideAInOut.Out[ImplicitA, ImplicitA] =
new HideAInOut[ImplicitA] {
type Out = ImplicitA
def get(left: ImplicitA): Out = left
}
} Error:
|
So I see that
with
works fine ...
|
I have a repro, this is code with the error : import zio.cli.*
object Cli {
sealed trait Subcommand extends Product with Serializable
object Subcommand {
final case class Init(extraParameter: String, gpgId: String) extends Subcommand
}
val init =
Command("init", Args.text("gpd-id"))
.withHelp(HelpDoc.p("Init subcommand description"))
.map(gpgId => Subcommand.Init(gpgId))
val pass: Command[Subcommand] =
Command("pass", Options.none, Args.none).subcommands(init)
} And the reason is that
|
Compiler version
3.3.0-RC3
Minimized code
Scastie link; same code:
Note the
assertLessThanBenches
has what should be a type error; the correct code is:Output (click arrow to expand)
See also
#14145
The text was updated successfully, but these errors were encountered: