We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug An aliased import added via addAliasedImport is not used when e.g. function arguments or return types are a nullable version of that:
To Reproduce
package org.example import com.squareup.kotlinpoet.FileSpec import com.squareup.kotlinpoet.FunSpec import com.squareup.kotlinpoet.asTypeName class PersonId fun main() { println( FileSpec.builder("org.example", "SomeFile") .addAliasedImport(PersonId::class, "PID") .addFunction( FunSpec.builder("pid") .addParameter("pid", PersonId::class.asTypeName().copy(nullable = true)) .returns(PersonId::class.asTypeName().copy(nullable = true)) .addCode("return null") .build() ) .build() ) }
Expected behavior Use the import alias for nullable types:
package org.example import org.example.PersonId as PID public fun pid(pid: PID?): PID? = null
Actual behavior Does not use the import alias for nullable types:
package org.example import org.example.PersonId as PID public fun pid(pid: org.example.PersonId?): org.example.PersonId? = null
Additional context Used version 2.0.0 above. Worked with version 1.16.0. Broken since 1.17.0.
The text was updated successfully, but these errors were encountered:
java.lang.IllegalArgumentException
No branches or pull requests
Describe the bug
An aliased import added via addAliasedImport is not used when e.g. function arguments or return types are a nullable version of that:
To Reproduce
Expected behavior
Use the import alias for nullable types:
Actual behavior
Does not use the import alias for nullable types:
Additional context
Used version 2.0.0 above.
Worked with version 1.16.0.
Broken since 1.17.0.
The text was updated successfully, but these errors were encountered: