what’s the error message if you don’t change to `A...
# getting-started
m
what’s the error message if you don’t change to
Any
?
b
That i need to specify the type, but i want a generic like in java, for example only Validator type without passing type, is it possible?
A simple example could be, a fun that receives a generic Comparator with param: fun generic(comparator: Comparator)
m
you need to update
validateForm
to
fun <T> validateForm(validator: Validator<T>) {}
b
Alright nice, in java form is not possible alright? Without pass arg type?
m
not sure, I guess not
b
ok thank you!!!
e
even though type erasure is still a thing at runtime (because of the JVM), Kotlin explicitely forbids erasing type at compile time to avoid ambiguities.
b
Nice explanation, thank you