Add tests for obsolete issues
#KT-31784 Obsolete #KT-31757 Obsolete
This commit is contained in:
@@ -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"
|
||||||
|
}
|
||||||
@@ -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()()
|
||||||
|
}
|
||||||
+10
@@ -6054,6 +6054,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
runTest("compiler/testData/codegen/box/coroutines/kt30858.kt");
|
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")
|
@TestMetadata("lastExpressionIsLoop.kt")
|
||||||
public void testLastExpressionIsLoop_1_2() throws Exception {
|
public void testLastExpressionIsLoop_1_2() throws Exception {
|
||||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/lastExpressionIsLoop.kt", "kotlin.coroutines.experimental");
|
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");
|
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")
|
@TestMetadata("kt434.kt")
|
||||||
public void testKt434() throws Exception {
|
public void testKt434() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/fullJdk/kt434.kt");
|
runTest("compiler/testData/codegen/box/fullJdk/kt434.kt");
|
||||||
|
|||||||
+10
@@ -6054,6 +6054,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
|||||||
runTest("compiler/testData/codegen/box/coroutines/kt30858.kt");
|
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")
|
@TestMetadata("lastExpressionIsLoop.kt")
|
||||||
public void testLastExpressionIsLoop_1_2() throws Exception {
|
public void testLastExpressionIsLoop_1_2() throws Exception {
|
||||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/lastExpressionIsLoop.kt", "kotlin.coroutines.experimental");
|
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");
|
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")
|
@TestMetadata("kt434.kt")
|
||||||
public void testKt434() throws Exception {
|
public void testKt434() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/fullJdk/kt434.kt");
|
runTest("compiler/testData/codegen/box/fullJdk/kt434.kt");
|
||||||
|
|||||||
+10
@@ -6054,6 +6054,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
|||||||
runTest("compiler/testData/codegen/box/coroutines/kt30858.kt");
|
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")
|
@TestMetadata("lastExpressionIsLoop.kt")
|
||||||
public void testLastExpressionIsLoop_1_2() throws Exception {
|
public void testLastExpressionIsLoop_1_2() throws Exception {
|
||||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/lastExpressionIsLoop.kt", "kotlin.coroutines.experimental");
|
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");
|
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")
|
@TestMetadata("kt434.kt")
|
||||||
public void testKt434() throws Exception {
|
public void testKt434() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/fullJdk/kt434.kt");
|
runTest("compiler/testData/codegen/box/fullJdk/kt434.kt");
|
||||||
|
|||||||
Generated
+5
@@ -4949,6 +4949,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
|||||||
runTest("compiler/testData/codegen/box/coroutines/kt30858.kt");
|
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")
|
@TestMetadata("lastExpressionIsLoop.kt")
|
||||||
public void testLastExpressionIsLoop_1_3() throws Exception {
|
public void testLastExpressionIsLoop_1_3() throws Exception {
|
||||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/lastExpressionIsLoop.kt", "kotlin.coroutines");
|
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/lastExpressionIsLoop.kt", "kotlin.coroutines");
|
||||||
|
|||||||
+5
@@ -5174,6 +5174,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
|||||||
runTest("compiler/testData/codegen/box/coroutines/kt30858.kt");
|
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")
|
@TestMetadata("lastExpressionIsLoop.kt")
|
||||||
public void testLastExpressionIsLoop_1_2() throws Exception {
|
public void testLastExpressionIsLoop_1_2() throws Exception {
|
||||||
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/lastExpressionIsLoop.kt", "kotlin.coroutines.experimental");
|
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/lastExpressionIsLoop.kt", "kotlin.coroutines.experimental");
|
||||||
|
|||||||
Reference in New Issue
Block a user