KType of typealias


#1

I have the following scenario:

class Test<T>(val thing: T)
typealias StringTest = Test<String>

fun main(args: Array<String>) {
  val stringTest = StringTest("Hello")
  println(stringTest::class.starProjectedType)
}

This outputs Test<*>. Is there a way I can instead get a KType for StringTest?
Thanks


#2

Type aliases exist only at compilation time; the use of type aliases does not affect the generated bytecode in any way.


#3

Ah ok that makes sense. I’ll have to extend instead. Thanks