1

is it possible to have multiple reified type parameters in Kotlin. I can do something like:

inline fun <reified T> func(column: String): T { return when(column) { .... } } 

Can this be extended to something like:

inline fun <reified T, reified U> func(column: String): Pair(T, U) { } 

1 Answer 1

6

Multiple reified parameters are supported in a regular way. if your problem is that your code does not compile then this is because you wrote Pair(T, U) instead of Pair<T, U>:

inline fun <reified T, reified U> func(column: String): Pair<T, U> 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.