Add test for KT-28654
This commit is contained in:
@@ -0,0 +1,10 @@
|
|||||||
|
// !WITH_NEW_INFERENCE
|
||||||
|
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||||
|
// Related issue: KT-28654
|
||||||
|
|
||||||
|
fun <K> select(): K = <!OI;TYPE_INFERENCE_EXPECTED_TYPE_MISMATCH!>run { <!OI;TYPE_MISMATCH!><!>}<!>
|
||||||
|
|
||||||
|
fun test() {
|
||||||
|
val x: Int = select()
|
||||||
|
<!NI;UNREACHABLE_CODE!>val t =<!> <!OI;TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>select<!>()
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
package
|
||||||
|
|
||||||
|
public fun </*0*/ K> select(): K
|
||||||
|
public fun test(): kotlin.Unit
|
||||||
@@ -9500,6 +9500,11 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
|
|||||||
runTest("compiler/testData/diagnostics/tests/inference/kt28598.kt");
|
runTest("compiler/testData/diagnostics/tests/inference/kt28598.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt28654.kt")
|
||||||
|
public void testKt28654() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/inference/kt28654.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("kt3184.kt")
|
@TestMetadata("kt3184.kt")
|
||||||
public void testKt3184() throws Exception {
|
public void testKt3184() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/tests/inference/kt3184.kt");
|
runTest("compiler/testData/diagnostics/tests/inference/kt3184.kt");
|
||||||
|
|||||||
Generated
+5
@@ -9495,6 +9495,11 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing
|
|||||||
runTest("compiler/testData/diagnostics/tests/inference/kt28598.kt");
|
runTest("compiler/testData/diagnostics/tests/inference/kt28598.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt28654.kt")
|
||||||
|
public void testKt28654() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/inference/kt28654.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("kt3184.kt")
|
@TestMetadata("kt3184.kt")
|
||||||
public void testKt3184() throws Exception {
|
public void testKt3184() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/tests/inference/kt3184.kt");
|
runTest("compiler/testData/diagnostics/tests/inference/kt3184.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user