[FIR] Implement DATA_CLASS_OVERRIDE_DEFAULT_VALUES diagnostic

#KT-59415 Fixed
This commit is contained in:
Kirill Rakhman
2023-07-24 15:53:15 +02:00
committed by Space Team
parent 53ff4584d4
commit 06d2befb72
12 changed files with 57 additions and 5 deletions
@@ -4,6 +4,6 @@ interface WithCopy<T> {
fun copy(str: T): WithCopy<T>
}
data class Test(val str: String) : WithCopy<String> {
<!DATA_CLASS_OVERRIDE_DEFAULT_VALUES!>data<!> class Test(val str: String) : WithCopy<String> {
override fun copy(str: String) = Test(str)
}
}
@@ -4,6 +4,6 @@ interface WithCopy<T> {
fun copy(str: T): WithCopy<T>
}
data class Test(val str: String) : WithCopy<String> {
<!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)
}
@@ -4,4 +4,4 @@ interface WithCopy<T> {
fun copy(str: T): WithCopy<T>
}
data class Test(val str: String): WithCopy<String>
<!DATA_CLASS_OVERRIDE_DEFAULT_VALUES!>data<!> class Test(val str: String): WithCopy<String>
@@ -4,4 +4,4 @@ interface WithCopy<T> {
fun copy(str: T): WithCopy<T>
}
data class Test(val str: String): WithCopy<String>
<!DATA_CLASS_OVERRIDE_DEFAULT_VALUES!>data<!> class Test(val str: String): WithCopy<String>