veiset
08/29/2018, 8:43 AMclass A {
fun <T> a(v: T): TypedA<T> = this
}
typealias TypedA<T> = A
fun main(args: Array<String>) {
val result = A().a("hello") // inferred type: TypedA<String>
val result2: TypedA<Int> = A().a("hello") // <Int>, this is legal
}
Is there any way to enforce the type <T>
here?