Files
kotlin-fork/plugins/kotlin-serialization/kotlin-serialization-compiler/testData/diagnostics/Transients.kt
T
Leonid Startsev b78d84c120 Add some tests for kotlinx.serialization plugin:
- declaration checker
- bytecode listings
- JVM IR

Improve @Transient redundant reporting
2019-06-11 19:32:40 +03:00

10 lines
462 B
Kotlin
Vendored

// !DIAGNOSTICS: -UNUSED_PARAMETER,-UNUSED_VARIABLE
// FILE: test.kt
import kotlinx.serialization.*
@Serializable
data class WithTransients(<!PLUGIN_ERROR("This property is marked as @Transient and therefore must have an initializing expression")!>@Transient val missing: Int<!>) {
<!PLUGIN_WARNING("Property does not have backing field which makes it non-serializable and therefore @Transient is redundant")!>@Transient<!> val redundant: Int get() = 42
}