Incorrect generation for boxed primitives when used as generics
If you read the type SomeClass<Integer> and write it you get SomeClass<Integer> rather than SomeClass<Int>. The generated code compiles but complains that Integer should not be used.
Just to be clear, you want Java types automatically converted to Kotlin types when you parse them from an element or mirror?
On Mon, Jun 26, 2017, 7:28 AM Nicklas Ansman Giertz < [email protected]> wrote:
If you read the type SomeClass<Integer> and write it you get SomeClass<Integer> rather than SomeClass<Int>. The generated code compiles but complains that Integer should not be used.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/square/kotlinpoet/issues/139, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEEEduNVAssONWm5zRb0FW3IkAUk6tZks5sH6QJgaJpZM4OFPf6 .
Yes, exactly. I think that should be fine for all cases, right?
Seems fine. Want to send a PR?
On Mon, Jun 26, 2017, 1:02 PM Nicklas Ansman Giertz < [email protected]> wrote:
Yes, exactly. I think that should be fine for all cases, right?
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/square/kotlinpoet/issues/139#issuecomment-311135766, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEEEVai1vld81XO_qA7Ex4-r5fbiISCks5sH_I9gaJpZM4OFPf6 .
What I see is that kotlin.String, when read from TypeMirror, is seen as java.lang.String. Is there a clever trick to fix this, or do we have to manually map it back into kotlin.String to create ClassName?
There's no such thing as kotlin.String when running on the JVM, so yes, that's expected.
On Mon, Jun 26, 2017, 4:24 PM Egor Andreevici [email protected] wrote:
What I see is that kotlin.String, when read from TypeMirror, is seen as java.lang.String. Is there a clever trick to fix this, or do we have to manually map it back into kotlin.String to create ClassName?
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/square/kotlinpoet/issues/139#issuecomment-311186445, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEEEcyQiy81kaAg5dsTeGqtdbbW3IUiks5sICGogaJpZM4OFPf6 .
Yeah, I'll add a PR