Files
kotlin-fork/compiler/testData/diagnostics/tests/override/fakeEquals.kt
T
Dmitry Savvinov 99e1d4ab45 Check for the presence of dispatch receiver too in isEqualsDescriptor()
Otherwise, top-level function with the name 'equals' and suitable
signature will be (erroneously) treated as true 'equals' invocation,
leading to further exception (see EA-126602)
2018-10-15 10:54:39 +03:00

9 lines
196 B
Kotlin
Vendored

// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_REFERENCE
class Foo
fun test(a: Foo, b: Foo) {
// Note that signature matches the 'equals'
fun equals(x: Any?): Boolean = false
equals(b)
}