Report error on accidentally "overriding" wait/notify

Hard-code only Object members because diagnostics are reported for all other
classes out of the box in 1.1

 #KT-7174 Fixed
This commit is contained in:
Alexander Udalov
2016-06-14 20:08:48 +03:00
parent da332d1a27
commit 79ecc9751b
5 changed files with 134 additions and 32 deletions
@@ -0,0 +1,17 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
// KT-7174 Report error on members with the same signature as non-overridable methods from mapped Java types (like Object.wait/notify)
class A {
<!CONFLICTING_INHERITED_JVM_DECLARATIONS!>fun notify()<!> {}
<!CONFLICTING_INHERITED_JVM_DECLARATIONS!>fun notifyAll()<!> {}
<!CONFLICTING_INHERITED_JVM_DECLARATIONS!>fun wait()<!> {}
<!CONFLICTING_INHERITED_JVM_DECLARATIONS!>fun wait(l: Long)<!> {}
<!CONFLICTING_INHERITED_JVM_DECLARATIONS!>fun wait(l: Long, i: Int)<!> {}
}
<!CONFLICTING_INHERITED_JVM_DECLARATIONS!>fun notify()<!> {}
<!CONFLICTING_INHERITED_JVM_DECLARATIONS!>fun notifyAll()<!> {}
<!CONFLICTING_INHERITED_JVM_DECLARATIONS!>fun wait()<!> {}
<!CONFLICTING_INHERITED_JVM_DECLARATIONS!>fun wait(l: Long)<!> {}
<!CONFLICTING_INHERITED_JVM_DECLARATIONS!>fun wait(l: Long, i: Int)<!> {}
@@ -0,0 +1,19 @@
package
public fun notify(): kotlin.Unit
public fun notifyAll(): kotlin.Unit
public fun wait(): kotlin.Unit
public fun wait(/*0*/ l: kotlin.Long): kotlin.Unit
public fun wait(/*0*/ l: kotlin.Long, /*1*/ i: kotlin.Int): kotlin.Unit
public final class A {
public constructor A()
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 final fun notify(): kotlin.Unit
public final fun notifyAll(): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
public final fun wait(): kotlin.Unit
public final fun wait(/*0*/ l: kotlin.Long): kotlin.Unit
public final fun wait(/*0*/ l: kotlin.Long, /*1*/ i: kotlin.Int): kotlin.Unit
}