Files
kotlin-fork/plugins/parcelize/parcelize-compiler/testData/diagnostics/modality.kt
T
2023-02-28 10:19:18 +00:00

32 lines
699 B
Kotlin
Vendored

package test
import kotlinx.parcelize.Parcelize
import android.os.Parcelable
@Parcelize
open class Open(val foo: String) : Parcelable
@Parcelize
class Final(val foo: String) : Parcelable
@Parcelize
<!PARCELABLE_SHOULD_BE_INSTANTIABLE!>abstract<!> class Abstract(val foo: String) : Parcelable
@Parcelize
sealed class Sealed(val foo: String) : Parcelable {
class X : Sealed("")
}
class Outer {
@Parcelize
<!PARCELABLE_CANT_BE_INNER_CLASS!>inner<!> class Inner(val foo: String) : Parcelable
}
fun foo() {
@Parcelize
<!PARCELABLE_CANT_BE_LOCAL_CLASS!>object<!> : Parcelable {}
@Parcelize
class <!NO_PARCELABLE_SUPERTYPE, PARCELABLE_CANT_BE_LOCAL_CLASS!>Local<!> {}
}