Front-end and back-end test for KT-7801

This commit is contained in:
Mikhail Glukhikh
2016-01-21 14:14:57 +03:00
parent 7ac55cefcb
commit 3106a8508a
5 changed files with 38 additions and 0 deletions
@@ -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);
}
@TestMetadata("genericIntersection.kt")
public void testGenericIntersection() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/smartCasts/genericIntersection.kt");
doTest(fileName);
}
@TestMetadata("genericSet.kt")
public void testGenericSet() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/smartCasts/genericSet.kt");
@@ -7357,6 +7357,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
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")
public void testGenericSet() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/smartCasts/genericSet.kt");