In the case you gave, `override fun <List<St...
# announcements
f
In the case you gave,
override fun <List<String>> foo(t: List<String>) {}
, you're trying to override a method named
foo
that - when used - binds
T
to some type parameter given by the caller of the function. The class itself doesn't care what types the caller wants, and multiple callers can call that same function with different types. E.g.:
Copy code
val b = B()    // Create an instance of B
b.foo(1)   // Binds the name Int to type Int
b.foo("bar")    // Binds the name Int to type String
All that you've done in
B
is rename the type parameter
T
to have the name
Int
instead.