mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
Synthesized 'copy' introduces default values for parameters, which is prohibited for regular overrides. Report warning in language version 1.2-, error in 1.3+.
9 lines
232 B
Kotlin
Vendored
9 lines
232 B
Kotlin
Vendored
// !LANGUAGE: +ProhibitDataClassesOverridingCopy
|
|
|
|
interface WithCopy<T> {
|
|
fun copy(str: T): WithCopy<T>
|
|
}
|
|
|
|
data class Test(val str: String, val int: Int) : WithCopy<String> {
|
|
override fun copy(str: String) = copy(str, int)
|
|
} |