[FIR] Relax MULTIPLE_DEFAULTS_* to account for the K1 behavior
^KT-56442 ^KT-36188
This commit is contained in:
committed by
Space Team
parent
3f1bf6112f
commit
13a7bb95b3
+1
-3
@@ -1,6 +1,4 @@
|
||||
// IGNORE_BACKEND_K1: JS, JS_IR, JS_IR_ES6
|
||||
// IGNORE_BACKEND_K2: ANY
|
||||
// STATUS: This must be red code anyway, KT-36188
|
||||
// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6
|
||||
|
||||
// The code in this test should be prohibited in the frontend, see KT-36188.
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
// IGNORE_BACKEND_K1: JS, JS_IR, JS_IR_ES6
|
||||
// IGNORE_BACKEND_K2: ANY
|
||||
// STATUS: This must be red code anyway, KT-36188
|
||||
// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6
|
||||
// !JVM_DEFAULT_MODE: all
|
||||
// JVM_TARGET: 1.8
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
// IGNORE_BACKEND: JS
|
||||
// IGNORE_BACKEND_K2: ANY
|
||||
// STATUS: This must be red code anyway, KT-36188
|
||||
|
||||
// Test for KT-36188 bug compatibility between non-IR and IR backends
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
// IGNORE_BACKEND: JS
|
||||
// IGNORE_BACKEND_K2: ANY
|
||||
// STATUS: This must be red code anyway, KT-36188
|
||||
|
||||
// Test for KT-36188 bug compatibility between non-IR and IR backends
|
||||
|
||||
|
||||
+1
-1
@@ -11,5 +11,5 @@ open class Keker<P> {
|
||||
}
|
||||
|
||||
class Implementation<P>() : Keker<P>(), SomeRandomOverride<P> {
|
||||
override fun child(<!MULTIPLE_DEFAULTS_INHERITED_FROM_SUPERTYPES!>props: Int<!>) {}
|
||||
override fun child(<!MULTIPLE_DEFAULTS_INHERITED_FROM_SUPERTYPES_DEPRECATION_WARNING!>props: Int<!>) {}
|
||||
}
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
// LANGUAGE: +ProhibitAllMultipleDefaultsInheritedFromSupertypes
|
||||
// ISSUE: KT-36188
|
||||
|
||||
interface SomeRandomBase<K> {
|
||||
fun child(props: Int = 20)
|
||||
}
|
||||
|
||||
interface SomeRandomOverride<J> : SomeRandomBase<J>
|
||||
|
||||
open class Keker<P> {
|
||||
open fun child(props: Int = 10) {}
|
||||
}
|
||||
|
||||
class Implementation<P>() : Keker<P>(), SomeRandomOverride<P> {
|
||||
override fun child(<!MULTIPLE_DEFAULTS_INHERITED_FROM_SUPERTYPES_DEPRECATION_ERROR!>props: Int<!>) {}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
// LANGUAGE: +ProhibitAllMultipleDefaultsInheritedFromSupertypes
|
||||
// ISSUE: KT-36188
|
||||
|
||||
interface SomeRandomBase<K> {
|
||||
fun child(props: Int = 20)
|
||||
}
|
||||
|
||||
interface SomeRandomOverride<J> : SomeRandomBase<J>
|
||||
|
||||
open class Keker<P> {
|
||||
open fun child(props: Int = 10) {}
|
||||
}
|
||||
|
||||
class Implementation<P>() : Keker<P>(), SomeRandomOverride<P> {
|
||||
override fun child(props: Int) {}
|
||||
}
|
||||
+1
-1
@@ -13,5 +13,5 @@ open class Keker<P> {
|
||||
}
|
||||
|
||||
class Implementation<P>() : Keker<P>(), SomeRandomOverride<P> {
|
||||
override fun child(<!MULTIPLE_DEFAULTS_INHERITED_FROM_SUPERTYPES!>props: Int<!>) {}
|
||||
override fun child(<!MULTIPLE_DEFAULTS_INHERITED_FROM_SUPERTYPES_DEPRECATION_WARNING!>props: Int<!>) {}
|
||||
}
|
||||
|
||||
+1
-1
@@ -13,5 +13,5 @@ open class Keker<P> {
|
||||
}
|
||||
|
||||
class Implementation<P>() : Keker<P>(), SomeRandomOverride<P> {
|
||||
override fun child(<!MULTIPLE_DEFAULTS_INHERITED_FROM_SUPERTYPES!>props: Int<!>) {}
|
||||
override fun child(<!MULTIPLE_DEFAULTS_INHERITED_FROM_SUPERTYPES_DEPRECATION_WARNING!>props: Int<!>) {}
|
||||
}
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
// ISSUE: KT-60269
|
||||
// WITH_STDLIB
|
||||
|
||||
interface Foo {
|
||||
fun foo(param: Int = 1)
|
||||
}
|
||||
|
||||
interface Bar {
|
||||
fun foo(param: Int = 2)
|
||||
}
|
||||
|
||||
interface Baz1 : Bar
|
||||
|
||||
class Baz : Baz1, Foo {
|
||||
override fun foo(<!MULTIPLE_DEFAULTS_INHERITED_FROM_SUPERTYPES_DEPRECATION_WARNING!>param: Int<!>) {
|
||||
println(param)
|
||||
}
|
||||
}
|
||||
|
||||
fun main() {
|
||||
Baz().foo()
|
||||
(Baz() as Foo).foo()
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
// ISSUE: KT-60269
|
||||
// WITH_STDLIB
|
||||
|
||||
interface Foo {
|
||||
fun foo(param: Int = 1)
|
||||
}
|
||||
|
||||
interface Bar {
|
||||
fun foo(param: Int = 2)
|
||||
}
|
||||
|
||||
interface Baz1 : Bar
|
||||
|
||||
class Baz : Baz1, Foo {
|
||||
override fun foo(param: Int) {
|
||||
println(param)
|
||||
}
|
||||
}
|
||||
|
||||
fun main() {
|
||||
Baz().foo()
|
||||
(Baz() as Foo).foo()
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
// FIR_IDENTICAL
|
||||
// ISSUE: KT-60269
|
||||
// WITH_STDLIB
|
||||
|
||||
interface Foo {
|
||||
fun foo(param: Int = 1)
|
||||
}
|
||||
|
||||
interface Bar {
|
||||
fun foo(param: Int = 2)
|
||||
}
|
||||
|
||||
class Baz : Bar, Foo {
|
||||
override fun foo(<!MULTIPLE_DEFAULTS_INHERITED_FROM_SUPERTYPES!>param: Int<!>) {
|
||||
println(param)
|
||||
}
|
||||
}
|
||||
|
||||
fun main() {
|
||||
Baz().foo()
|
||||
(Baz() as Foo).foo()
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
// FIR_IDENTICAL
|
||||
// ISSUE: KT-57076
|
||||
// WITH_STDLIB
|
||||
|
||||
interface I01 {
|
||||
fun some(x: Int = 1, y: Int)
|
||||
}
|
||||
|
||||
open class C01 {
|
||||
open fun some(x: Int = -1, y: Int = 2) {
|
||||
println("x = $x y = $y")
|
||||
}
|
||||
}
|
||||
|
||||
<!MULTIPLE_DEFAULTS_INHERITED_FROM_SUPERTYPES_WHEN_NO_EXPLICIT_OVERRIDE!>class C02<!>: C01(), I01
|
||||
|
||||
fun main(){
|
||||
C02().some() // K2: x = -1 y = 2
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// FIR_IDENTICAL
|
||||
// ISSUE: KT-36188
|
||||
|
||||
interface A {
|
||||
fun foo(a: String = "Fail"): String
|
||||
}
|
||||
interface B {
|
||||
fun foo(a: String = "OK"): String
|
||||
}
|
||||
class Impl : A, B {
|
||||
override fun foo(<!MULTIPLE_DEFAULTS_INHERITED_FROM_SUPERTYPES!>a: String<!>) = a
|
||||
}
|
||||
|
||||
fun box(): String = Impl().foo()
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// ISSUE: KT-36188
|
||||
|
||||
interface A {
|
||||
fun foo(a: String = "Fail"): String
|
||||
}
|
||||
interface A2 : A
|
||||
interface B {
|
||||
fun foo(a: String = "OK"): String
|
||||
}
|
||||
class Impl : A2, B {
|
||||
override fun foo(<!MULTIPLE_DEFAULTS_INHERITED_FROM_SUPERTYPES_DEPRECATION_WARNING!>a: String<!>) = a
|
||||
}
|
||||
|
||||
fun box(): String = Impl().foo()
|
||||
@@ -0,0 +1,14 @@
|
||||
// ISSUE: KT-36188
|
||||
|
||||
interface A {
|
||||
fun foo(a: String = "Fail"): String
|
||||
}
|
||||
interface A2 : A
|
||||
interface B {
|
||||
fun foo(a: String = "OK"): String
|
||||
}
|
||||
class Impl : A2, B {
|
||||
override fun foo(a: String) = a
|
||||
}
|
||||
|
||||
fun box(): String = Impl().foo()
|
||||
Reference in New Issue
Block a user