<Type infer in comparisons (equals, ...)> This cod...
# forum
r
Type infer in comparisons (equals, ...) This code for example won’t compile: if (msg.convert() == MSG_SCROLL) { } Why? msg is a UInt, MSG_SCROLL is a Int Now of course the solution seems obvious in this case BUT MSG_SCROLL is not guaranteed to be an Int (at compile time). convert() is a function in Kotlin native that takes a type argument, and it returns a value of that type. (This is not a Kotlin native only problem because the same problem exists for all functions everywhere) You would think that it just automatically infers...