arve
06/06/2025, 10:17 AMinterface IExample {
fun <T> something(cls: KClass<T>)
}
inline fun <reified T> ITest.something() = something(T::class)
val t: IExample = Example()
// caller has to manually know about, and import extension function before they can do
t.something<String>()
Joffrey
06/06/2025, 10:20 AMCtrl+Space
to autocomplete members in IJ and it finds and auto-imports extensions when needed), so I don't consider this much of a problem anymore.arve
06/06/2025, 10:22 AMJoffrey
06/06/2025, 10:24 AMKlitos Kyriacou
06/06/2025, 11:36 AMinline fun <reified T> ObjectMapper.readValue(content: String): T = readValue(content, jacksonTypeRef<T>())
And indeed, whenever I try to use the readValue
extension, I have trouble getting IntelliJ IDEA to recognize it until I manually import com.fasterxml.jackson.module.kotlin.readValue
.Joffrey
06/06/2025, 2:15 PMKlitos Kyriacou
06/06/2025, 2:53 PMloke
06/06/2025, 6:26 PM