kotlinpoet icon indicating copy to clipboard operation
kotlinpoet copied to clipboard

Subclasses of `TypeName` return `TypeName` from `copy`

Open Vampire opened this issue 6 months ago • 4 comments

If you for example call copy on a ClassName, you get TypeName returned. The copy with tags parameter is overridden in the subclasses and returns the respective subclass. But the copy without tags parameter always returns TypeName.

It would be nice if TypeName could get a type parameter that the subclass sets to itself and then both copy functions return the actual subclass.

Vampire avatar Aug 23 '24 11:08 Vampire