Thanks to @liujingxing and @BoD for contributing to this release.
-
New: Kotlin scripting support in
FileSpec
.val spec = FileSpec.scriptBuilder("Taco") .addStatement("println(%S)", "hello world!") .addKotlinDefaultImports() .build()
Generates a Taco.kts file with the following contents:
println("hello world!")
-
New: Emit trailing commas for multi-line parameters and annotations.
-
New: Add
KSAnnotation.toAnnotationSpec()
. -
New: Add
Unit
andCharSequence
conversions in javapoet-interop. -
New: Add support for default imports in
FileSpec
.- This is particularly oriented at scripting support, but can also be used in non-script files.
-
New: Update to Kotlin 1.6.10.
-
Fix: Fail compilation if you only pass one string to
ClassName
. -
Fix: Inline val property if its getter is inline.
-
Fix: Add
yield
to the list of reserved keywords. -
Fix: Enforce only allowed parameter modifiers in
ParameterSpec
(i.e.crossinline
,vararg
, andnoinline
). -
Fix: Fix
CodeBlock
s in class delegation gettingtoString()
'd instead of participating in code writing. -
Fix: Error when attempting to convert KSP error types (i.e. if
KSType.isError
is true) toTypeName
.