redacted-compiler-plugin
redacted-compiler-plugin copied to clipboard
Prepare for K2
Diagnostic renders keep getting punted https://youtrack.jetbrains.com/issue/KT-53510
I've released 1.8.0-alpha01 with the changes in the PR up to this point
Notes
- Targets Kotlin
2.0.0-Beta3
Updated based on https://github.com/JetBrains/kotlin/blob/master/compiler/fir/checkers/module.md#platform-and-common-checkers
Published 1.8.0-alpha02 with support for Kotlin 2.0.0-Beta4
jfyi, updated to 2.0.0-RC1 and compilation fails with the following error
> Task :shared:compileKotlinJs FAILED
e: java.lang.NoSuchMethodError: 'void org.jetbrains.kotlin.ir.expressions.impl.IrGetValueImpl.<init>(int, int, org.jetbrains.kotlin.ir.types.IrType, org.jetbrains.kotlin.ir.symbols.IrValueSymbol, org.jetbrains.kotlin.ir.expressions.IrStatementOrigin, int, kotlin.jvm.internal.DefaultConstructorMarker)'
at dev.zacsweers.redacted.compiler.RedactedIrVisitor.IrGetValueImpl(RedactedIrVisitor.kt:219)
at dev.zacsweers.redacted.compiler.RedactedIrVisitor.receiver(RedactedIrVisitor.kt:216)
at dev.zacsweers.redacted.compiler.RedactedIrVisitor.generateToStringMethodBody(RedactedIrVisitor.kt:192)
at dev.zacsweers.redacted.compiler.RedactedIrVisitor.convertToGeneratedToString(RedactedIrVisitor.kt:145)
at dev.zacsweers.redacted.compiler.RedactedIrVisitor.visitFunctionNew(RedactedIrVisitor.kt:121)
at org.jetbrains.kotlin.backend.common.IrElementTransformerVoidWithContext.visitFunction(IrElementTransformerVoidWithContext.kt:83)
at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitSimpleFunction(IrElementTransformerVoid.kt:128)
at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitSimpleFunction(IrElementTransformerVoid.kt:131)
at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitSimpleFunction(IrElementTransformerVoid.kt:19)
at org.jetbrains.kotlin.ir.declarations.IrSimpleFunction.accept(IrSimpleFunction.kt:36)
Just published 1.8.0-alpha03 with support for 2.0.0-RC1 and also avoided using the above impl type directly to hopefully avoid future issues.
I've just published 1.8.0-alpha04. Two additions since the last alpha
- Support for custom error messages in FIR diagnostics. Should show up in the IDE and command line. However, in my testing I don't see the IDE showing these. Maybe in future versions
- Published using KSP2 to build.
I've published 1.9.0-alpha01 with the new @Unredacted + interfaces features released in 1.8.0.
I've published 1.9.0-alpha02 with full support for validation in FIR with all the features on main (they were only partially implemented before). This also disables that validation during IR by default. This is also built against 2.0.0-RC3 and on the latest changes from main.