We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Scala 3.0.2 (Scastie)
type ~>[Args <: Tuple, Return] = Args match { case (arg1, arg2) => ((arg1, arg2) => Return) } trait Builder[Args <: NonEmptyTuple] { def apply(f: Args ~> String): String } class BuilderImpl[Args <: NonEmptyTuple] extends Builder[Args] { override def apply(f: Args ~> String): String = ??? } val builder = BuilderImpl[Int *: String *: EmptyTuple]() // builder { (i: Int, s: String) => "test" } // This line compiles builder { (i, s) => "test" } // Does not compile
Missing parameter type I could not infer the type of the parameter i. Missing parameter type I could not infer the type of the parameter s.
No compiler error; I would expect the compiler to be able to infer the type of the function's arguments without annotations.
The text was updated successfully, but these errors were encountered:
@giacomocavalieri it seems that to use this you would also need TupledFunction. How did you implement the BuilderImpl.apply?
BuilderImpl.apply
Sorry, something went wrong.
Thanks for the answer! I still haven't tried to implement the apply method since I first wanted to understand why the compiler reported that error
apply
Normalize prototype before decomposing as a function
3cfda90
Fixes scala#13526
a6a0386
Successfully merging a pull request may close this issue.
Compiler version
Scala 3.0.2 (Scastie)
Minimized code
Output
Expectation
No compiler error; I would expect the compiler to be able to infer the type of the function's arguments without annotations.
The text was updated successfully, but these errors were encountered: