kotlinpoet
kotlinpoet copied to clipboard
the ``typeOf `` method be confused by ``Class generics``
Describe the bug
typeOf
method has totally different result when a class has generics
To Reproduce
annotation class Anno
@Anno
class Foo
@Anno
class Bar<T>
println(typeOf<Foo>().asTypeName().toString()) // Foo ps. Expected
println(typeOf<Bar<*>>().asTypeName().toString()) // @Anno Bar<*> ps. Unexpected
Expected behavior
annotation class Anno
@Anno
class Foo
@Anno
class Bar<T>
println(typeOf<Foo>().asTypeName().toString()) // Foo
println(typeOf<Bar<*>>().asTypeName().toString()) // Bar
Additional context Add any other context about the problem here.
This seems more like an inconsistency with typeOf()
?
Yes, it's make more sense.