[x] error: type mismatch: inferred type is Int but Short was expected -- TypeArgumentErasureSubstitution
class X<T>(val x: T)
fun main () {
val a2: X<Short> = X(X(50).x)
}
[ ] error: type mismatch: inferred type is {Comparable<CapturedType(*)> & Number} but Short was expected -- TypeArgumentErasureSubstitution
class Paroling<N>(val burying: N)
fun buxom(warned: Paroling<Short>) {}
fun main () {
val bizarre: Short = 10
buxom(Paroling<Short>(if (true) bizarre else Paroling(62).burying))
}
[x] error: type mismatch: inferred type is B<C> but B<A> was expected -- ValueSubstitution
open class A
open class B<T: A>(var x: T)
class C: A()
fun foo() = B(C())
error: type mismatch: inferred type is Int but Short was expected
-- TypeArgumentErasureSubstitutionerror: type mismatch: inferred type is {Comparable<CapturedType(*)> & Number} but Short was expected
-- TypeArgumentErasureSubstitutionerror: type mismatch: inferred type is B<C> but B<A> was expected
-- ValueSubstitutionfun main () { val x: B = B(C()) // compiles val y: B = foo() // error }