https://kotlinlang.org logo
#announcements
Title
# announcements
k

karelpeeters

09/11/2017, 3:04 PM
The compiler could technically see that
test(InInt(5))
has type
Out<Int>
and the only possibility is that it's actually
OutInt
, but it's not that advanced.
j

jstuyts-squins

09/12/2017, 7:56 AM
I know I am late, but the problem remains that if the compiler inferred
Out<Int>
as the return type, the type of the
when
statement would be incompatible with the return type. The compiler cannot infer the return type in this case, because the type information of the parameter conflicts with the type information of the returned expression
k

karelpeeters

09/12/2017, 7:58 AM
Welp sure, but the compiler could technically deduce that
Out<Int>
must be
OutInt
. I agree that's beyond what we can expect.