Front-end and back-end test for KT-7801
This commit is contained in:
@@ -0,0 +1,9 @@
|
|||||||
|
// See also KT-7801
|
||||||
|
class A
|
||||||
|
|
||||||
|
fun <T> test(v: T): T {
|
||||||
|
val a: T = if (v !is A) v else v
|
||||||
|
return a
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box() = test("OK")
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
// See also KT-7801
|
||||||
|
class A
|
||||||
|
|
||||||
|
fun <T> test(v: T): T {
|
||||||
|
val a: T = if (v !is A) v else v
|
||||||
|
return a
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package
|
||||||
|
|
||||||
|
public fun </*0*/ T> test(/*0*/ v: T): T
|
||||||
|
|
||||||
|
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 open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||||
|
}
|
||||||
@@ -15615,6 +15615,12 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("genericIntersection.kt")
|
||||||
|
public void testGenericIntersection() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/smartCasts/genericIntersection.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("genericSet.kt")
|
@TestMetadata("genericSet.kt")
|
||||||
public void testGenericSet() throws Exception {
|
public void testGenericSet() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/smartCasts/genericSet.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/smartCasts/genericSet.kt");
|
||||||
|
|||||||
+6
@@ -7357,6 +7357,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("genericIntersection.kt")
|
||||||
|
public void testGenericIntersection() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/smartCasts/genericIntersection.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("genericSet.kt")
|
@TestMetadata("genericSet.kt")
|
||||||
public void testGenericSet() throws Exception {
|
public void testGenericSet() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/smartCasts/genericSet.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/smartCasts/genericSet.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user