Do function parameters take precedence over functi...
# compiler
e
Do function parameters take precedence over function receivers for type inference? I have the following function:
Copy code
infix fun <T> MyResult<T>.assertSuccess(result: T) {
  assert(this is MyResult.Success && value == result)
}
but the compiler lets me call
MyResult.Success("string") assertSuccess 1
e
is
MyResult
covariant? if so, that's completely expected. it's not that parameters have precedence, it's that the unification in type interference can find
<Any>
as a solution
e
Ah good call, forgot that I made it covariant. Didn't even think to check 😅