Tests: move inline class-related diagnostic tests

... with backend-reported diagnostics to testsWithJvmBackend.
This commit is contained in:
Alexander Udalov
2024-03-12 14:55:12 +01:00
committed by Space Team
parent d08c904b0c
commit 56a1a3153b
26 changed files with 160 additions and 620 deletions
@@ -1,7 +0,0 @@
// !LANGUAGE: +InlineClasses, -JvmInlineValueClasses
// !DIAGNOSTICS: -UNUSED_PARAMETER
inline class IC(val i: Int)
fun foo(a: Any, ic: IC) {}
fun foo(a: Any?, ic: IC) {}
@@ -1,7 +0,0 @@
// !LANGUAGE: +InlineClasses, -JvmInlineValueClasses
// !DIAGNOSTICS: -UNUSED_PARAMETER
inline class IC(val i: Int)
<!CONFLICTING_JVM_DECLARATIONS!>fun foo(a: Any, ic: IC)<!> {}
<!CONFLICTING_JVM_DECLARATIONS!>fun foo(a: Any?, ic: IC)<!> {}
@@ -1,12 +0,0 @@
package
public fun foo(/*0*/ a: kotlin.Any, /*1*/ ic: IC): kotlin.Unit
public fun foo(/*0*/ a: kotlin.Any?, /*1*/ ic: IC): kotlin.Unit
public final inline class IC {
public constructor IC(/*0*/ i: kotlin.Int)
public final val i: kotlin.Int
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
}
@@ -1,18 +0,0 @@
// !LANGUAGE: +InlineClasses, -JvmInlineValueClasses
// !DIAGNOSTICS: -UNUSED_PARAMETER
inline class X(val x: Int)
inline class Z(val x: Int)
class TestOk1(val a: Int, val b: Int) {
constructor(x: X) : this(x.x, 1)
}
class TestErr1(val a: Int) {
constructor(x: X) : this(x.x)
}
class TestErr2(val a: Int, val b: Int) {
constructor(x: X) : this(x.x, 1)
constructor(z: Z) : this(z.x, 2)
}
@@ -1,18 +0,0 @@
// !LANGUAGE: +InlineClasses, -JvmInlineValueClasses
// !DIAGNOSTICS: -UNUSED_PARAMETER
inline class X(val x: Int)
inline class Z(val x: Int)
class TestOk1(val a: Int, val b: Int) {
constructor(x: X) : this(x.x, 1)
}
class TestErr1(val a: Int) {
<!CONFLICTING_JVM_DECLARATIONS!>constructor(x: X)<!> : this(x.x)
}
class <!CONFLICTING_JVM_DECLARATIONS!>TestErr2(val a: Int, val b: Int)<!> {
<!CONFLICTING_JVM_DECLARATIONS!>constructor(x: X)<!> : this(x.x, 1)
<!CONFLICTING_JVM_DECLARATIONS!>constructor(z: Z)<!> : this(z.x, 2)
}
@@ -1,47 +0,0 @@
package
public final class TestErr1 {
public constructor TestErr1(/*0*/ x: X)
public constructor TestErr1(/*0*/ a: kotlin.Int)
public final val a: kotlin.Int
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
}
public final class TestErr2 {
public constructor TestErr2(/*0*/ x: X)
public constructor TestErr2(/*0*/ z: Z)
public constructor TestErr2(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int)
public final val a: kotlin.Int
public final val b: kotlin.Int
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
}
public final class TestOk1 {
public constructor TestOk1(/*0*/ x: X)
public constructor TestOk1(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int)
public final val a: kotlin.Int
public final val b: kotlin.Int
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
}
public final inline class X {
public constructor X(/*0*/ x: kotlin.Int)
public final val x: kotlin.Int
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
}
public final inline class Z {
public constructor Z(/*0*/ x: kotlin.Int)
public final val x: kotlin.Int
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
}
@@ -1,37 +0,0 @@
// !LANGUAGE: +InlineClasses, -JvmInlineValueClasses
// !DIAGNOSTICS: -UNUSED_PARAMETER
inline class X(val x: Int)
inline class Z(val x: Int)
inline class Str(val str: String)
inline class Name(val name: String)
inline class NStr(val str: String?)
fun testSimple(x: X) {}
fun testSimple(z: Z) {}
fun testMixed(x: Int, y: Int) {}
fun testMixed(x: X, y: Int) {}
fun testMixed(x: Int, y: X) {}
fun testMixed(x: X, y: X) {}
fun testNewType(s: Str) {}
fun testNewType(name: Name) {}
fun testNullableVsNonNull1(s: Str) {}
fun testNullableVsNonNull1(s: Str?) {}
fun testNullableVsNonNull2(ns: NStr) {}
fun testNullableVsNonNull2(ns: NStr?) {}
fun testFunVsExt(x: X) {}
fun X.testFunVsExt() {}
fun testNonGenericVsGeneric(x: X, y: Number) {}
fun <T : Number> testNonGenericVsGeneric(x: X, y: T) {}
class C<TC : Number> {
fun testNonGenericVsGeneric(x: X, y: Number) {}
fun <T : Number> testNonGenericVsGeneric(x: X, y: T) {}
fun testNonGenericVsGeneric(x: X, y: TC) {}
}
@@ -1,37 +0,0 @@
// !LANGUAGE: +InlineClasses, -JvmInlineValueClasses
// !DIAGNOSTICS: -UNUSED_PARAMETER
inline class X(val x: Int)
inline class Z(val x: Int)
inline class Str(val str: String)
inline class Name(val name: String)
inline class NStr(val str: String?)
fun testSimple(x: X) {}
fun testSimple(z: Z) {}
fun testMixed(x: Int, y: Int) {}
fun testMixed(x: X, y: Int) {}
fun testMixed(x: Int, y: X) {}
fun testMixed(x: X, y: X) {}
fun testNewType(s: Str) {}
fun testNewType(name: Name) {}
fun testNullableVsNonNull1(s: Str) {}
fun testNullableVsNonNull1(s: Str?) {}
fun testNullableVsNonNull2(ns: NStr) {}
fun testNullableVsNonNull2(ns: NStr?) {}
<!CONFLICTING_JVM_DECLARATIONS!>fun testFunVsExt(x: X)<!> {}
<!CONFLICTING_JVM_DECLARATIONS!>fun X.testFunVsExt()<!> {}
<!CONFLICTING_JVM_DECLARATIONS!>fun testNonGenericVsGeneric(x: X, y: Number)<!> {}
<!CONFLICTING_JVM_DECLARATIONS!>fun <T : Number> testNonGenericVsGeneric(x: X, y: T)<!> {}
class C<TC : Number> {
<!CONFLICTING_JVM_DECLARATIONS!>fun testNonGenericVsGeneric(x: X, y: Number)<!> {}
<!CONFLICTING_JVM_DECLARATIONS!>fun <T : Number> testNonGenericVsGeneric(x: X, y: T)<!> {}
<!CONFLICTING_JVM_DECLARATIONS!>fun testNonGenericVsGeneric(x: X, y: TC)<!> {}
}
@@ -1,68 +0,0 @@
package
public fun testFunVsExt(/*0*/ x: X): kotlin.Unit
public fun testMixed(/*0*/ x: X, /*1*/ y: X): kotlin.Unit
public fun testMixed(/*0*/ x: X, /*1*/ y: kotlin.Int): kotlin.Unit
public fun testMixed(/*0*/ x: kotlin.Int, /*1*/ y: X): kotlin.Unit
public fun testMixed(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.Int): kotlin.Unit
public fun testNewType(/*0*/ name: Name): kotlin.Unit
public fun testNewType(/*0*/ s: Str): kotlin.Unit
public fun </*0*/ T : kotlin.Number> testNonGenericVsGeneric(/*0*/ x: X, /*1*/ y: T): kotlin.Unit
public fun testNonGenericVsGeneric(/*0*/ x: X, /*1*/ y: kotlin.Number): kotlin.Unit
public fun testNullableVsNonNull1(/*0*/ s: Str): kotlin.Unit
public fun testNullableVsNonNull1(/*0*/ s: Str?): kotlin.Unit
public fun testNullableVsNonNull2(/*0*/ ns: NStr): kotlin.Unit
public fun testNullableVsNonNull2(/*0*/ ns: NStr?): kotlin.Unit
public fun testSimple(/*0*/ x: X): kotlin.Unit
public fun testSimple(/*0*/ z: Z): kotlin.Unit
public fun X.testFunVsExt(): kotlin.Unit
public final class C</*0*/ TC : kotlin.Number> {
public constructor C</*0*/ TC : kotlin.Number>()
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 </*0*/ T : kotlin.Number> testNonGenericVsGeneric(/*0*/ x: X, /*1*/ y: T): kotlin.Unit
public final fun testNonGenericVsGeneric(/*0*/ x: X, /*1*/ y: TC): kotlin.Unit
public final fun testNonGenericVsGeneric(/*0*/ x: X, /*1*/ y: kotlin.Number): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public final inline class NStr {
public constructor NStr(/*0*/ str: kotlin.String?)
public final val str: kotlin.String?
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
}
public final inline class Name {
public constructor Name(/*0*/ name: kotlin.String)
public final val name: kotlin.String
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
}
public final inline class Str {
public constructor Str(/*0*/ str: kotlin.String)
public final val str: kotlin.String
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
}
public final inline class X {
public constructor X(/*0*/ x: kotlin.Int)
public final val x: kotlin.Int
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
}
public final inline class Z {
public constructor Z(/*0*/ x: kotlin.Int)
public final val x: kotlin.Int
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
}