You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
objectTest {
defint[A](k: String=>A)(s: String)(x: Int):A=???// composing directly: ok in scalac, error in dotcvalc: (String=>String) => (String) => (Int) => (Int) =>String= (int[Int=>String] _).compose(int[String] _)
// unwrapping composition: ok in scalac, ok in dotcvalq: (String=>Int=>String) => (String) => (Int) => (Int=>String) = int[Int=>String]
valp: (String=>String) => (String) => (Int) =>String= int[String]
valc2: (String=>String) => (String) => (Int) => (Int) =>String= q.compose(p)
}
Doing it directly raises an inference error for both parameters of the anonymous function in dotty with the following error:
error missing parameter type
The argument types of an anonymous function must be fully known. (SLS 8.5)
Expected type: class dotty.tools.dotc.typer.ProtoTypes$AnyFunctionProto$
Missing type for parameter s
The text was updated successfully, but these errors were encountered:
In the following example I compose
int
withint
.Doing it directly raises an inference error for both parameters of the anonymous function in dotty with the following error:
The text was updated successfully, but these errors were encountered: