Skip to content
Snippets Groups Projects
Verified Commit 207255d6 authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

fix: correct issue with nullable parameters

parent 20f47831
No related branches found
No related tags found
No related merge requests found
......@@ -27,11 +27,13 @@ fun KSTypeReference.asTypeName(): TypeName = resolve().asTypeName()
fun KSType.asTypeName(): TypeName {
when (val decl = declaration) {
is KSTypeAlias -> return decl.type.resolve().asTypeName()
.copy(nullable = isMarkedNullable)
}
val baseType = asClassName()
if (arguments.isEmpty()) {
return baseType
.copy(nullable = isMarkedNullable)
}
val parameters = arguments.map {
......@@ -53,4 +55,5 @@ fun KSType.asTypeName(): TypeName {
}
return baseType.parameterizedBy(parameters)
.copy(nullable = isMarkedNullable)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment