diff options
Diffstat (limited to 'kotlin-plugin')
3 files changed, 11 insertions, 11 deletions
diff --git a/kotlin-plugin/build.gradle.kts b/kotlin-plugin/build.gradle.kts index 0db911d..2f5f825 100644 --- a/kotlin-plugin/build.gradle.kts +++ b/kotlin-plugin/build.gradle.kts @@ -6,7 +6,7 @@ plugins { dependencies { compileOnly("org.jetbrains.kotlin:kotlin-compiler-embeddable") - implementation("com.google.devtools.ksp:symbol-processing-api:1.9.23-1.0.20") + implementation("com.google.devtools.ksp:symbol-processing-api:2.1.20-2.0.0") implementation(project(":annotations")) ksp("dev.zacsweers.autoservice:auto-service-ksp:1.2.0") @@ -14,8 +14,8 @@ dependencies { testImplementation(kotlin("test-junit5")) testImplementation("org.jetbrains.kotlin:kotlin-compiler-embeddable") - testImplementation("dev.zacsweers.kctfork:core:0.5.1") - testImplementation("dev.zacsweers.kctfork:ksp:0.5.1") + testImplementation("dev.zacsweers.kctfork:core:0.7.0") + testImplementation("dev.zacsweers.kctfork:ksp:0.7.0") } diff --git a/kotlin-plugin/src/main/kotlin/moe/nea/mcautotranslations/kotlin/MCAutoTranslationsCallTransformerAndCollector.kt b/kotlin-plugin/src/main/kotlin/moe/nea/mcautotranslations/kotlin/MCAutoTranslationsCallTransformerAndCollector.kt index d87648d..822be0f 100644 --- a/kotlin-plugin/src/main/kotlin/moe/nea/mcautotranslations/kotlin/MCAutoTranslationsCallTransformerAndCollector.kt +++ b/kotlin-plugin/src/main/kotlin/moe/nea/mcautotranslations/kotlin/MCAutoTranslationsCallTransformerAndCollector.kt @@ -86,8 +86,8 @@ class MCAutoTranslationsCallTransformerAndCollector( val varArgs = irVararg(context.irBuiltIns.anyType.makeNullable(), arguments) return irCall( - replacementFunction, replacementFunction.owner.returnType, - valueArgumentsCount = 2, + replacementFunction, + replacementFunction.owner.returnType, ).apply { putValueArgument(0, constString(key, keySource.startOffset, keySource.endOffset)) @@ -139,8 +139,8 @@ class MCAutoTranslationsCallTransformerAndCollector( text: String, startOffset: Int = SYNTHETIC_OFFSET, endOffset: Int = SYNTHETIC_OFFSET - ): IrConst<String> = - text.toIrConst(irPluginContext.irBuiltIns.stringType, startOffset, endOffset) as IrConst<String> + ): IrConst = + text.toIrConst(irPluginContext.irBuiltIns.stringType, startOffset, endOffset) } data class StringTemplate( @@ -150,13 +150,13 @@ data class StringTemplate( } fun IrExpression?.asStringDyn(): StringTemplate? = when (this) { - is IrConst<*> -> if (kind == IrConstKind.String) StringTemplate(this) else null + is IrConst -> if (kind == IrConstKind.String) StringTemplate(this) else null is IrStringConcatenation -> StringTemplate(this.arguments) else -> null } fun IrExpression?.asStringConst(): String? = when (this) { - is IrConst<*> -> if (kind == IrConstKind.String) value as String else null + is IrConst -> if (kind == IrConstKind.String) value as String else null is IrStringConcatenation -> this.arguments.singleOrNull().asStringConst() else -> null } diff --git a/kotlin-plugin/src/test/kotlin/moe/nea/mcautotranslations/TestTemplateReplacement.kt b/kotlin-plugin/src/test/kotlin/moe/nea/mcautotranslations/TestTemplateReplacement.kt index b4a7f18..a62ac30 100644 --- a/kotlin-plugin/src/test/kotlin/moe/nea/mcautotranslations/TestTemplateReplacement.kt +++ b/kotlin-plugin/src/test/kotlin/moe/nea/mcautotranslations/TestTemplateReplacement.kt @@ -10,7 +10,7 @@ class TestTemplateReplacement { @Test fun testX() { val dollar = '$' - compile(listOf( + val result = compile(listOf( SourceFile.kotlin( "test.kt", """ @@ -37,4 +37,4 @@ class TestTemplateReplacement { ) )) } -}
\ No newline at end of file +} |