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)
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
// !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)
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package
|
||||
|
||||
public fun test(/*0*/ a: Foo, /*1*/ b: Foo): kotlin.Unit
|
||||
|
||||
public final class Foo {
|
||||
public constructor Foo()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
Reference in New Issue
Block a user