Closed
Description
minimized code
val aiPoly: [T] => Any => Int = [T] => (a: Any) => 5
val iiPoly: [T] => Int => Int = aiPoly // <-- this part fails
Does not compile, producing the error:
Found: PolyFunction{apply: [T](x$1: Any): Int}(aiPoly)
Required: PolyFunction{apply: [T](x$1: Int): Int}
expectation
Expected the polymorhpic case to behave the same way as normal functions do:
val ai: Any => Int = (a: Any) => 5
val ii: Int => Int = ai // <-- compiles and works with no errors