[FIR] Report conflicts for data class generated members

^KT-59880
This commit is contained in:
Nikolay Lunyak
2023-10-10 12:37:19 +03:00
committed by Space Team
parent afc22728fa
commit bc2eb546b4
5 changed files with 12 additions and 9 deletions
@@ -1,6 +1,6 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
data class A(val x: Int, val y: String) {
data class <!CONFLICTING_OVERLOADS!>A(val x: Int, val y: String)<!> {
<!CONFLICTING_OVERLOADS!>fun copy(x: Int, y: String)<!> = x
<!CONFLICTING_OVERLOADS!>fun copy(x: Int, y: String)<!> = A(x, y)
}
@@ -4,6 +4,6 @@ interface WithCopy<T> {
fun copy(str: T): WithCopy<T>
}
<!DATA_CLASS_OVERRIDE_DEFAULT_VALUES!>data<!> class Test(val str: String) : WithCopy<String> {
override fun copy(str: String) = Test(str)
<!DATA_CLASS_OVERRIDE_DEFAULT_VALUES!>data<!> class <!CONFLICTING_OVERLOADS!>Test(val str: String)<!> : WithCopy<String> {
<!CONFLICTING_OVERLOADS!>override fun copy(str: String)<!> = Test(str)
}
@@ -4,6 +4,6 @@ interface WithCopy<T> {
fun copy(str: T): WithCopy<T>
}
<!DATA_CLASS_OVERRIDE_DEFAULT_VALUES!>data<!> class Test(val str: String) : WithCopy<String> {
override fun copy(str: String = <!DEFAULT_VALUE_NOT_ALLOWED_IN_OVERRIDE!>this.str<!>) = Test(str)
<!DATA_CLASS_OVERRIDE_DEFAULT_VALUES!>data<!> class <!CONFLICTING_OVERLOADS!>Test(val str: String)<!> : WithCopy<String> {
<!CONFLICTING_OVERLOADS!>override fun copy(str: String = <!DEFAULT_VALUE_NOT_ALLOWED_IN_OVERRIDE!>this.str<!>)<!> = Test(str)
}