Added tests for simple approximation (of Captured(out/in Int))
This commit is contained in:
+8
@@ -0,0 +1,8 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// !CHECK_TYPE
|
||||
|
||||
fun <T> foo(a: Array<T>): T = null!!
|
||||
|
||||
fun test(a: Array<in Int>) {
|
||||
foo(a) checkType { it : _<Any?> }
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
package
|
||||
|
||||
internal fun </*0*/ T> foo(/*0*/ a: kotlin.Array<T>): T
|
||||
internal fun test(/*0*/ a: kotlin.Array<in kotlin.Int>): kotlin.Unit
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// !CHECK_TYPE
|
||||
|
||||
fun <T> foo(a: Array<T>): T = null!!
|
||||
|
||||
fun test(a: Array<out Int>) {
|
||||
foo(a) checkType { it : _<Int> }
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
package
|
||||
|
||||
internal fun </*0*/ T> foo(/*0*/ a: kotlin.Array<T>): T
|
||||
internal fun test(/*0*/ a: kotlin.Array<out kotlin.Int>): kotlin.Unit
|
||||
@@ -5195,6 +5195,18 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/inference/capturedTypes/kt2872.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("overApproximationForInCaptured.kt")
|
||||
public void testOverApproximationForInCaptured() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/inference/capturedTypes/overApproximationForInCaptured.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("overApproximationForOutCaptured.kt")
|
||||
public void testOverApproximationForOutCaptured() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/inference/capturedTypes/overApproximationForOutCaptured.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/inference/constraints")
|
||||
|
||||
Reference in New Issue
Block a user