Last active
April 16, 2022 05:45
-
-
Save Morfly/257b983680922c71eefb60ac963af74d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override fun visitTypeArgument(typeArgument: KSTypeArgument, data: Unit) { | |
... | |
val resolvedType: KSType? = typeArgument.type?.resolve() | |
file += resolvedType?.declaration?.qualifiedName?.asString() ?: run { | |
logger.error("Invalid type argument", typeArgument) | |
return | |
} | |
// Generating nested generic parameters if any | |
val genericArguments: List<KSTypeArgument> = typeArgument.type?.element?.typeArguments ?: emptyList() | |
visitTypeArguments(genericArguments) | |
// Handling nullability | |
file += if (resolvedType?.nullability == Nullability.NULLABLE) "?" else "" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment