From 3d2d1e435f2ef119404ea7ea22334612d4239590 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Kautler?= Date: Mon, 19 Aug 2024 14:37:09 +0200 Subject: [PATCH] fix(abg): Use "a.to(b)" instead of "a to b" or Kotlin Poet sometimes breaks before the "to" which is illegal --- .../workflows/actionbindinggenerator/generation/Generation.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action-binding-generator/src/main/kotlin/io/github/typesafegithub/workflows/actionbindinggenerator/generation/Generation.kt b/action-binding-generator/src/main/kotlin/io/github/typesafegithub/workflows/actionbindinggenerator/generation/Generation.kt index dde767a04..648b57de3 100644 --- a/action-binding-generator/src/main/kotlin/io/github/typesafegithub/workflows/actionbindinggenerator/generation/Generation.kt +++ b/action-binding-generator/src/main/kotlin/io/github/typesafegithub/workflows/actionbindinggenerator/generation/Generation.kt @@ -309,9 +309,9 @@ private fun Metadata.linkedMapOfInputs(inputTypings: Map): CodeB inputs.forEach { (key, value) -> val asStringCode = inputTypings.getInputTyping(key).asString() if (!value.shouldBeNonNullInBinding()) { - add("%N?.let { %S to it$asStringCode },\n", key.toCamelCase(), key) + add("%N?.let { %S.to(it$asStringCode) },\n", key.toCamelCase(), key) } else { - add("%S to %N$asStringCode,\n", key, key.toCamelCase()) + add("%S.to(%N$asStringCode),\n", key, key.toCamelCase()) } } add("*$CUSTOM_INPUTS.%M().%M(),\n", Types.mapToList, Types.listToArray)