How do we type-project type arguments of properties?
It all started with this (intentionally) invalid code:
class Box(var item: T)
fun fx(box: Box){ }
fx(Box(1)) //OK
fx(Box(1)) //ERROR
We would receive an error on “out”:
Projections are not allowed on type arguments of functions and properties
Here the attempt to perform covariant projection on the type argument Int, which the related type parameter T is declared by the function, is not allowed.
And so this explains the error message, “projections are not allowed on type arguments of...