Files
kotlin-fork/plugins/parcelize/parcelize-compiler/testData/diagnostics/constructors.kt
T
Dmitriy Novozhilov 8cdddbfd9d [FIR] Implement checkers for FIR parcelize plugin
There is one of checks left unimplemented (FirParcelizePropertyChecker.checkParcelableClassProperty)
  because it requires huge commonization of detecting which type can be
  serialized and which not, which is not prioritized job for now
2021-11-23 15:01:31 +03:00

31 lines
703 B
Kotlin
Vendored

// FIR_IDENTICAL
// WITH_STDLIB
package test
import kotlinx.parcelize.Parcelize
import android.os.Parcelable
@Parcelize
class A : Parcelable
@Parcelize
class B(val firstName: String, val secondName: String) : Parcelable
@Parcelize
class C(val firstName: String, <!PARCELABLE_CONSTRUCTOR_PARAMETER_SHOULD_BE_VAL_OR_VAR!>secondName<!>: String) : Parcelable
@Parcelize
class D(val firstName: String, vararg val secondName: String) : Parcelable
@Parcelize
class E(val firstName: String, val secondName: String) : Parcelable {
constructor() : this("", "")
}
@Parcelize
class <!PARCELABLE_SHOULD_HAVE_PRIMARY_CONSTRUCTOR!>F<!> : Parcelable {
constructor(a: String) {
println(a)
}
}