JS: don't report error when FAKE function overrides external function with optional parameters. Report only when it overrides at least two such functions. See KT-15961
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
// !DIAGNOSTICS: -DEPRECATION
|
||||
// !DIAGNOSTICS: -DEPRECATION, -DEPRECATION_ERROR
|
||||
@native("B")
|
||||
<!JS_NAME_PROHIBITED_FOR_NAMED_NATIVE!>@JsName("C")<!>
|
||||
class A
|
||||
|
||||
+10
@@ -6,6 +6,8 @@ class B : A() {
|
||||
<!OVERRIDING_EXTERNAL_FUN_WITH_OPTIONAL_PARAMS!>override fun f(x: Int)<!> {}
|
||||
}
|
||||
|
||||
class BB : A()
|
||||
|
||||
external class C : A {
|
||||
override fun f(x: Int)
|
||||
}
|
||||
@@ -19,6 +21,12 @@ interface J {
|
||||
fun f(x: Int = 23)
|
||||
}
|
||||
|
||||
interface II {
|
||||
fun f(x: Int)
|
||||
}
|
||||
|
||||
interface IIJ : II, J
|
||||
|
||||
open external class D {
|
||||
open fun f(x: Int)
|
||||
}
|
||||
@@ -45,6 +53,8 @@ open external class XE {
|
||||
|
||||
class <!OVERRIDING_EXTERNAL_FUN_WITH_OPTIONAL_PARAMS_WITH_FAKE!>Y<!> : X(), I
|
||||
|
||||
class <!OVERRIDING_EXTERNAL_FUN_WITH_OPTIONAL_PARAMS_WITH_FAKE!>YY<!> : A(), II
|
||||
|
||||
external class YE: XE, I
|
||||
|
||||
class Z : X(), J
|
||||
+30
@@ -16,6 +16,14 @@ public final class B : A {
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class BB : A {
|
||||
public constructor BB()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun f(/*0*/ x: kotlin.Int = ...): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public external final class C : A {
|
||||
public constructor C()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
@@ -63,6 +71,20 @@ public external interface I {
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface II {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public abstract fun f(/*0*/ x: kotlin.Int): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface IIJ : II, J {
|
||||
public open override /*2*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public abstract override /*2*/ /*fake_override*/ fun f(/*0*/ x: kotlin.Int = ...): kotlin.Unit
|
||||
public open override /*2*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface J {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public abstract fun f(/*0*/ x: kotlin.Int = ...): kotlin.Unit
|
||||
@@ -102,6 +124,14 @@ public external final class YE : XE, I {
|
||||
public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class YY : A, II {
|
||||
public constructor YY()
|
||||
public open override /*2*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*2*/ /*fake_override*/ fun f(/*0*/ x: kotlin.Int = ...): kotlin.Unit
|
||||
public open override /*2*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class Z : X, J {
|
||||
public constructor Z()
|
||||
public open override /*2*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
|
||||
Reference in New Issue
Block a user