7
ho il seguente codice:Tipo non corrispondente: tipo inferito è T ma kotlin.Any era previsto
val map = HashMap<Int, Any>()
fun <T> test(t: T) = map.put(0, t) // Type mismatch: inferred type is T but kotlin.Any was expected
Ma every Kotlin class has Any as a superclass, quindi perché questo errore?
Per aggiungere a questo, il limite predefinito per un '' '' è 'Qualsiasi?' –
Kiskae