Closed knizamov closed 7 months ago
It does look like the person, address, and street information is all being captured and printed in your example but the information is not aligned properly because only street eq "123"
is displayed. Probably a bug in the start offset for the expression. Thanks for the report!
This compiler plugin is now bundled with Kotlin, starting with version 2.0.0-Beta5, where this issue has been fixed: https://youtrack.jetbrains.com/issue/KT-65640/PowerAssert-Infix-function-not-aligned-correctly.
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
plugins {
kotlin("jvm") version "2.0.0-Beta5"
kotlin("plugin.power-assert") version "2.0.0-Beta5"
}
@OptIn(ExperimentalKotlinGradlePluginApi::class)
powerAssert {
functions = listOf("kotlin.assert", "kotlin.test.assertTrue")
excludedSourceSets = listOf("main")
}
Hi, thanks for your great plugin.
Given infix function:
It captures only
street
, not fullperson.address?.street
context:While using
assert(person.address?.street == "123")
prints: