We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
trait Smt[F[_], A] { def fa: F[A] def smt[G[_]](f: [X] => F[X] => G[X]): G[A] = f(fa) } enum Console[A] { case ReadLine extends Console[String] case PrintLine extends Console[Unit] } val smtListInts = new Smt[Console, String] { def fa = Console.ReadLine } val res: List[String] = smtListInts.smt[List]([X] => (con: Console[X]) => con match { case Console.ReadLine => List("string") case Console.PrintLine => List(()) })
I expect compiler to infer [X] type, but instead, I have to cast results manually:
[X]
val res: List[String] = smtListInts.smt[List]([X] => (con: Console[X]) => con match { case Console.ReadLine => List("string").asInstanceOf[List[X]] case Console.PrintLine => List(()).asInstanceOf[List[X]] })
The text was updated successfully, but these errors were encountered:
Thanks for reporting this issue!
We already track it as #5828, so I'm going to close this one.
Sorry, something went wrong.
No branches or pull requests
minimized code
expectation
I expect compiler to infer
[X]
type, but instead, I have to cast results manually:The text was updated successfully, but these errors were encountered: