Check componentN functions for override conflicts
Check if newly generated component functions happen to override something which they're not supposed to. Create new slice to store mapping from annotation descriptors to corresponding PSI elements, which is used by override checker to report errors in data classes on.
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
open data class A(val x: Int, val y: String)
|
||||
|
||||
<!DATA_CLASS_OVERRIDE_CONFLICT!>data<!> class B(val z: String) : A(42, "")
|
||||
@@ -0,0 +1,5 @@
|
||||
trait T {
|
||||
fun component1(): Int
|
||||
}
|
||||
|
||||
data class A(val x: Int) : T
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
trait T {
|
||||
final fun component1(): Int = 42
|
||||
}
|
||||
|
||||
<!DATA_CLASS_OVERRIDE_CONFLICT!>data<!> class A(val x: Int) : T
|
||||
@@ -0,0 +1,3 @@
|
||||
open data class D(private final val x: Int)
|
||||
|
||||
data class E(internal <!CANNOT_OVERRIDE_INVISIBLE_MEMBER!>override<!> val x: Int) : D(42)
|
||||
Reference in New Issue
Block a user