Add tests for obsolete issues

#KT-31784 Obsolete
 #KT-31757 Obsolete
This commit is contained in:
Mikhail Zarechenskiy
2019-06-10 11:49:53 +03:00
parent 414c116d93
commit 991e60c9e4
7 changed files with 93 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
// !LANGUAGE: +NewInference
// WITH_RUNTIME
@file:UseExperimental(ExperimentalTypeInference::class)
package test
import kotlin.experimental.ExperimentalTypeInference
interface Builder<T : Any> {
fun filter(filter: (T) -> Boolean)
}
fun <T : Any> build(@BuilderInference block: Builder<T>.() -> Unit): T {
val o = object : Builder<T> {
override fun filter(filter: (T) -> Boolean) {
}
}
o.block()
return 42 as T
}
fun box(): String {
val r = build<Int> {
filter {
it > 10
}
}
return if (r == 42) "OK" else "Fail: $r"
}
+19
View File
@@ -0,0 +1,19 @@
// !LANGUAGE: +NewInference
// TARGET_BACKEND: JVM
// FULL_JDK
package test
import java.util.function.*
interface Interface1<T> : () -> T, Supplier<T> {
override fun invoke() = get()
}
class Impl : Interface1<String> {
override fun get(): String = "OK"
}
fun box(): String {
return Impl()()
}
@@ -6054,6 +6054,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/coroutines/kt30858.kt");
}
@TestMetadata("kt31784.kt")
public void testKt31784() throws Exception {
runTest("compiler/testData/codegen/box/coroutines/kt31784.kt");
}
@TestMetadata("lastExpressionIsLoop.kt")
public void testLastExpressionIsLoop_1_2() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/lastExpressionIsLoop.kt", "kotlin.coroutines.experimental");
@@ -10944,6 +10949,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/fullJdk/intCountDownLatchExtension.kt");
}
@TestMetadata("kt31757.kt")
public void testKt31757() throws Exception {
runTest("compiler/testData/codegen/box/fullJdk/kt31757.kt");
}
@TestMetadata("kt434.kt")
public void testKt434() throws Exception {
runTest("compiler/testData/codegen/box/fullJdk/kt434.kt");
@@ -6054,6 +6054,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/coroutines/kt30858.kt");
}
@TestMetadata("kt31784.kt")
public void testKt31784() throws Exception {
runTest("compiler/testData/codegen/box/coroutines/kt31784.kt");
}
@TestMetadata("lastExpressionIsLoop.kt")
public void testLastExpressionIsLoop_1_2() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/lastExpressionIsLoop.kt", "kotlin.coroutines.experimental");
@@ -10944,6 +10949,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/fullJdk/intCountDownLatchExtension.kt");
}
@TestMetadata("kt31757.kt")
public void testKt31757() throws Exception {
runTest("compiler/testData/codegen/box/fullJdk/kt31757.kt");
}
@TestMetadata("kt434.kt")
public void testKt434() throws Exception {
runTest("compiler/testData/codegen/box/fullJdk/kt434.kt");
@@ -6054,6 +6054,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/coroutines/kt30858.kt");
}
@TestMetadata("kt31784.kt")
public void testKt31784() throws Exception {
runTest("compiler/testData/codegen/box/coroutines/kt31784.kt");
}
@TestMetadata("lastExpressionIsLoop.kt")
public void testLastExpressionIsLoop_1_2() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/lastExpressionIsLoop.kt", "kotlin.coroutines.experimental");
@@ -10944,6 +10949,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/fullJdk/intCountDownLatchExtension.kt");
}
@TestMetadata("kt31757.kt")
public void testKt31757() throws Exception {
runTest("compiler/testData/codegen/box/fullJdk/kt31757.kt");
}
@TestMetadata("kt434.kt")
public void testKt434() throws Exception {
runTest("compiler/testData/codegen/box/fullJdk/kt434.kt");
@@ -4949,6 +4949,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/coroutines/kt30858.kt");
}
@TestMetadata("kt31784.kt")
public void testKt31784() throws Exception {
runTest("compiler/testData/codegen/box/coroutines/kt31784.kt");
}
@TestMetadata("lastExpressionIsLoop.kt")
public void testLastExpressionIsLoop_1_3() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/lastExpressionIsLoop.kt", "kotlin.coroutines");
@@ -5174,6 +5174,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/coroutines/kt30858.kt");
}
@TestMetadata("kt31784.kt")
public void testKt31784() throws Exception {
runTest("compiler/testData/codegen/box/coroutines/kt31784.kt");
}
@TestMetadata("lastExpressionIsLoop.kt")
public void testLastExpressionIsLoop_1_2() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/lastExpressionIsLoop.kt", "kotlin.coroutines.experimental");