Skip to content

Commit

Permalink
fix nullability of lambdas in KSTypeReference.toTypeName (#1756)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielittner authored Dec 2, 2023
1 parent 221bbbc commit 51b218b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public fun KSTypeReference.toTypeName(
receiver = elem.receiverType?.toTypeName(typeParamResolver),
parameters = elem.functionParameters.map { ParameterSpec.unnamed(it.type.toTypeName(typeParamResolver)) },
returnType = elem.returnType.toTypeName(typeParamResolver),
)
).copy(nullable = resolve().isMarkedNullable)
}
else -> resolve().toTypeName(typeParamResolver, element?.typeArguments.orEmpty())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ class TestProcessorTest {
param4: Function0<String>,
param5: Function1<String, String>,
param6: (Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int) -> Unit,
param7: ((String) -> String)?,
) {
}
Expand Down Expand Up @@ -296,6 +297,7 @@ class TestProcessorTest {
Int,
Int,
) -> Unit,
param7: ((String) -> String)?,
) {
}
Expand Down

0 comments on commit 51b218b

Please sign in to comment.