[FIR] Introduce the PluginGenerated source kind

Make parcelize work consistently with
`FirOverrideChecker`.

Actually, there is a philosophical question about
what to do when a plugin generates a class
in a new package, and this class is red code
(for instance, doesn't implement an abstract
member from a supertype). There's no source
to report such an error, but we probably do
want to run checkers to avoid trying to
compile red code to binaries (because it may
crash in backend, or it may silently work).
This commit is contained in:
Nikolay Lunyak
2024-01-16 11:34:59 +02:00
committed by Space Team
parent 694029d67f
commit afd8895e51
14 changed files with 318 additions and 196 deletions
@@ -0,0 +1,20 @@
package test
import kotlinx.parcelize.Parcelize
import android.os.Parcelable
@Parcelize
class <!NOTHING_TO_OVERRIDE, NOTHING_TO_OVERRIDE, NO_PARCELABLE_SUPERTYPE!>Without<!>(val firstName: String, val secondName: String, val age: Int)
@Parcelize
class With(val firstName: String, val secondName: String, val age: Int) : Parcelable
interface MyParcelableIntf : Parcelable
abstract class MyParcelableCl : Parcelable
@Parcelize
class WithIntfSubtype(val firstName: String, val secondName: String, val age: Int) : MyParcelableIntf
@Parcelize
class WithClSubtype(val firstName: String, val secondName: String, val age: Int) : MyParcelableCl()
@@ -1,4 +1,3 @@
// FIR_IDENTICAL
package test
import kotlinx.parcelize.Parcelize
@@ -0,0 +1,25 @@
package test
import kotlinx.parcelize.Parcelize
import android.os.Parcelable
@Parcelize
interface <!PARCELABLE_SHOULD_BE_CLASS!>Intf<!> : Parcelable
@Parcelize
object <!NOTHING_TO_OVERRIDE, NOTHING_TO_OVERRIDE, NO_PARCELABLE_SUPERTYPE!>Obj<!>
class A {
@Parcelize
companion <!NOTHING_TO_OVERRIDE, NOTHING_TO_OVERRIDE, NO_PARCELABLE_SUPERTYPE!>object<!> {
fun foo() {}
}
}
@Parcelize
enum class <!NOTHING_TO_OVERRIDE, NOTHING_TO_OVERRIDE, NO_PARCELABLE_SUPERTYPE!>Enum<!> {
WHITE, BLACK
}
@Parcelize
annotation class <!NOTHING_TO_OVERRIDE, NOTHING_TO_OVERRIDE, PARCELABLE_SHOULD_BE_CLASS!>Anno<!>
@@ -1,4 +1,3 @@
// FIR_IDENTICAL
package test
import kotlinx.parcelize.Parcelize