What is a good way to get around not being able to...
# getting-started
b
What is a good way to get around not being able to use reified type parameters in an interface? I want to have a method like
Copy code
override inline fun <reified T> foo(key: String, value: T): T {
    }
but it's not possible since you can't
inline
an interface function
v
It depends on what you are using the
T
for. The code in your snippet works just the same if you remove
reified
b
I need to call
value::class.java
directly (which only works if it's reified). I guess I could pass the class as a parameter but I would like to keep the client code as simple as possible
k
You can declare
inline
extension functions for your interface
v
@bachhuberdesign are you sure you need reifying for that? It compiles for me
fun <T: Any> foo(value: T) = value::class.java