JoshK
12/28/2018, 10:57 PMfun <E> firstOrderFnWithSecondOrderTypeInference() = { value: E -> value }
, attempting to firstOrderFnWithSecondOrderTypeInference()(42)
gives me a type inference error:
Type inference failed: Not enough information to infer parameter E in fun <E> firstOrderFnWithSecondOrderTypeInference( ) : (E) → E Please specify it explicitly.
firstOrderFnWithSecondOrderTypeInference<Int>()(1234)
works because there's no type inference for E
of the second rank function. I guess what I'm looking for is a why it's like this so I can understand the language a bit better. I know that C++ is the same way, same with Typescript, so I wonder if there's an underlying reason.Pavlo Liapota
12/28/2018, 11:44 PMJoshK
12/28/2018, 11:46 PM