https://kotlinlang.org logo
f

fellshard

07/20/2016, 6:36 PM
That definition,
override fun <List<String>> foo(t: List<String>) {}
, is trying to say the following:
foo
is a method that - given some type named
X
- performs an operation on a value of given type
X
.
All you're doing is replacing the name
X
with the name
List<String>
. But that name is invalid for type identifiers in Kotlin. That's the key, here. That's just a name, and it doesn't constrain the actual type of the function.
🤔 1
👍 5