[NI] Test data to understand changes in the next commit
##KT-31969 In Progress
This commit is contained in:
+15
@@ -10001,6 +10001,11 @@ public class FirDiagnosticsSmokeTestGenerated extends AbstractFirDiagnosticsSmok
|
|||||||
runTest("compiler/testData/diagnostics/tests/inference/commonSystem/kt30300.kt");
|
runTest("compiler/testData/diagnostics/tests/inference/commonSystem/kt30300.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt31969.kt")
|
||||||
|
public void testKt31969() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/inference/commonSystem/kt31969.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("kt3372toCollection.kt")
|
@TestMetadata("kt3372toCollection.kt")
|
||||||
public void testKt3372toCollection() throws Exception {
|
public void testKt3372toCollection() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/tests/inference/commonSystem/kt3372toCollection.kt");
|
runTest("compiler/testData/diagnostics/tests/inference/commonSystem/kt3372toCollection.kt");
|
||||||
@@ -10011,6 +10016,16 @@ public class FirDiagnosticsSmokeTestGenerated extends AbstractFirDiagnosticsSmok
|
|||||||
runTest("compiler/testData/diagnostics/tests/inference/commonSystem/nestedLambdas.kt");
|
runTest("compiler/testData/diagnostics/tests/inference/commonSystem/nestedLambdas.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("postponedCompletionWithExactAnnotation.kt")
|
||||||
|
public void testPostponedCompletionWithExactAnnotation() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/inference/commonSystem/postponedCompletionWithExactAnnotation.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("postponedCompletionWithExactAnnotation_ni.kt")
|
||||||
|
public void testPostponedCompletionWithExactAnnotation_ni() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/inference/commonSystem/postponedCompletionWithExactAnnotation_ni.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("selectFromCovariantAndContravariantTypes.kt")
|
@TestMetadata("selectFromCovariantAndContravariantTypes.kt")
|
||||||
public void testSelectFromCovariantAndContravariantTypes() throws Exception {
|
public void testSelectFromCovariantAndContravariantTypes() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/tests/inference/commonSystem/selectFromCovariantAndContravariantTypes.kt");
|
runTest("compiler/testData/diagnostics/tests/inference/commonSystem/selectFromCovariantAndContravariantTypes.kt");
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||||
|
// !WITH_NEW_INFERENCE
|
||||||
|
|
||||||
|
open class View
|
||||||
|
|
||||||
|
fun test() {
|
||||||
|
val target = foo<View>() ?: foo() <!NI;USELESS_ELVIS!>?: run {}<!>
|
||||||
|
}
|
||||||
|
|
||||||
|
fun <T : View> foo(): T? {
|
||||||
|
return null
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package
|
||||||
|
|
||||||
|
public fun </*0*/ T : View> foo(): T?
|
||||||
|
public fun test(): kotlin.Unit
|
||||||
|
|
||||||
|
public open class View {
|
||||||
|
public constructor View()
|
||||||
|
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
|
||||||
|
}
|
||||||
compiler/testData/diagnostics/tests/inference/commonSystem/postponedCompletionWithExactAnnotation.kt
Vendored
+27
@@ -0,0 +1,27 @@
|
|||||||
|
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||||
|
|
||||||
|
interface ISample
|
||||||
|
|
||||||
|
fun <K> elvisSimple(x: K?, y: K): K = y
|
||||||
|
|
||||||
|
@Suppress("INVISIBLE_REFERENCE")
|
||||||
|
fun <K> elvisExact(x: K?, y: K): @kotlin.internal.Exact K = y
|
||||||
|
|
||||||
|
fun <T : Number> materialize(): T? = TODO()
|
||||||
|
|
||||||
|
fun test(nullableSample: ISample, any: Any) {
|
||||||
|
<!DEBUG_INFO_EXPRESSION_TYPE("ISample")!>elvisSimple(
|
||||||
|
nullableSample,
|
||||||
|
<!TYPE_INFERENCE_CONFLICTING_SUBSTITUTIONS!>materialize<!>()
|
||||||
|
)<!>
|
||||||
|
|
||||||
|
elvisSimple(
|
||||||
|
<!DEBUG_INFO_EXPRESSION_TYPE("ISample")!>elvisSimple(nullableSample, <!TYPE_INFERENCE_CONFLICTING_SUBSTITUTIONS!>materialize<!>())<!>,
|
||||||
|
any
|
||||||
|
)
|
||||||
|
|
||||||
|
elvisSimple(
|
||||||
|
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>elvisExact(nullableSample, materialize())<!>,
|
||||||
|
any
|
||||||
|
)
|
||||||
|
}
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
package
|
||||||
|
|
||||||
|
@kotlin.Suppress(names = {"INVISIBLE_REFERENCE"}) public fun </*0*/ K> elvisExact(/*0*/ x: K?, /*1*/ y: K): K
|
||||||
|
public fun </*0*/ K> elvisSimple(/*0*/ x: K?, /*1*/ y: K): K
|
||||||
|
public fun </*0*/ T : kotlin.Number> materialize(): T?
|
||||||
|
public fun test(/*0*/ nullableSample: ISample, /*1*/ any: kotlin.Any): kotlin.Unit
|
||||||
|
|
||||||
|
public interface ISample {
|
||||||
|
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
|
||||||
|
}
|
||||||
+28
@@ -0,0 +1,28 @@
|
|||||||
|
// !LANGUAGE: +NewInference
|
||||||
|
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||||
|
|
||||||
|
interface ISample
|
||||||
|
|
||||||
|
fun <K> elvisSimple(x: K?, y: K): K = y
|
||||||
|
|
||||||
|
@Suppress("INVISIBLE_REFERENCE")
|
||||||
|
fun <K> elvisExact(x: K?, y: K): @kotlin.internal.Exact K = y
|
||||||
|
|
||||||
|
fun <T : Number> materialize(): T? = null
|
||||||
|
|
||||||
|
fun test(nullableSample: ISample, any: Any) {
|
||||||
|
<!DEBUG_INFO_EXPRESSION_TYPE("ISample")!>elvisSimple(
|
||||||
|
nullableSample,
|
||||||
|
<!DEBUG_INFO_EXPRESSION_TYPE("{ISample & Number}?")!>materialize()<!>
|
||||||
|
)<!>
|
||||||
|
|
||||||
|
elvisSimple(
|
||||||
|
<!DEBUG_INFO_EXPRESSION_TYPE("ISample")!>elvisSimple(nullableSample, materialize())<!>,
|
||||||
|
any
|
||||||
|
)
|
||||||
|
|
||||||
|
elvisSimple(
|
||||||
|
<!DEBUG_INFO_EXPRESSION_TYPE("ISample")!>elvisExact(nullableSample, materialize())<!>,
|
||||||
|
any
|
||||||
|
)
|
||||||
|
}
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
package
|
||||||
|
|
||||||
|
@kotlin.Suppress(names = {"INVISIBLE_REFERENCE"}) public fun </*0*/ K> elvisExact(/*0*/ x: K?, /*1*/ y: K): K
|
||||||
|
public fun </*0*/ K> elvisSimple(/*0*/ x: K?, /*1*/ y: K): K
|
||||||
|
public fun </*0*/ T : kotlin.Number> materialize(): T?
|
||||||
|
public fun test(/*0*/ nullableSample: ISample, /*1*/ any: kotlin.Any): kotlin.Unit
|
||||||
|
|
||||||
|
public interface ISample {
|
||||||
|
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
|
||||||
|
}
|
||||||
@@ -10008,6 +10008,11 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
|
|||||||
runTest("compiler/testData/diagnostics/tests/inference/commonSystem/kt30300.kt");
|
runTest("compiler/testData/diagnostics/tests/inference/commonSystem/kt30300.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt31969.kt")
|
||||||
|
public void testKt31969() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/inference/commonSystem/kt31969.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("kt3372toCollection.kt")
|
@TestMetadata("kt3372toCollection.kt")
|
||||||
public void testKt3372toCollection() throws Exception {
|
public void testKt3372toCollection() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/tests/inference/commonSystem/kt3372toCollection.kt");
|
runTest("compiler/testData/diagnostics/tests/inference/commonSystem/kt3372toCollection.kt");
|
||||||
@@ -10018,6 +10023,16 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
|
|||||||
runTest("compiler/testData/diagnostics/tests/inference/commonSystem/nestedLambdas.kt");
|
runTest("compiler/testData/diagnostics/tests/inference/commonSystem/nestedLambdas.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("postponedCompletionWithExactAnnotation.kt")
|
||||||
|
public void testPostponedCompletionWithExactAnnotation() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/inference/commonSystem/postponedCompletionWithExactAnnotation.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("postponedCompletionWithExactAnnotation_ni.kt")
|
||||||
|
public void testPostponedCompletionWithExactAnnotation_ni() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/inference/commonSystem/postponedCompletionWithExactAnnotation_ni.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("selectFromCovariantAndContravariantTypes.kt")
|
@TestMetadata("selectFromCovariantAndContravariantTypes.kt")
|
||||||
public void testSelectFromCovariantAndContravariantTypes() throws Exception {
|
public void testSelectFromCovariantAndContravariantTypes() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/tests/inference/commonSystem/selectFromCovariantAndContravariantTypes.kt");
|
runTest("compiler/testData/diagnostics/tests/inference/commonSystem/selectFromCovariantAndContravariantTypes.kt");
|
||||||
|
|||||||
Generated
+15
@@ -10003,6 +10003,11 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing
|
|||||||
runTest("compiler/testData/diagnostics/tests/inference/commonSystem/kt30300.kt");
|
runTest("compiler/testData/diagnostics/tests/inference/commonSystem/kt30300.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt31969.kt")
|
||||||
|
public void testKt31969() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/inference/commonSystem/kt31969.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("kt3372toCollection.kt")
|
@TestMetadata("kt3372toCollection.kt")
|
||||||
public void testKt3372toCollection() throws Exception {
|
public void testKt3372toCollection() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/tests/inference/commonSystem/kt3372toCollection.kt");
|
runTest("compiler/testData/diagnostics/tests/inference/commonSystem/kt3372toCollection.kt");
|
||||||
@@ -10013,6 +10018,16 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing
|
|||||||
runTest("compiler/testData/diagnostics/tests/inference/commonSystem/nestedLambdas.kt");
|
runTest("compiler/testData/diagnostics/tests/inference/commonSystem/nestedLambdas.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("postponedCompletionWithExactAnnotation.kt")
|
||||||
|
public void testPostponedCompletionWithExactAnnotation() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/inference/commonSystem/postponedCompletionWithExactAnnotation.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("postponedCompletionWithExactAnnotation_ni.kt")
|
||||||
|
public void testPostponedCompletionWithExactAnnotation_ni() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/inference/commonSystem/postponedCompletionWithExactAnnotation_ni.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("selectFromCovariantAndContravariantTypes.kt")
|
@TestMetadata("selectFromCovariantAndContravariantTypes.kt")
|
||||||
public void testSelectFromCovariantAndContravariantTypes() throws Exception {
|
public void testSelectFromCovariantAndContravariantTypes() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/tests/inference/commonSystem/selectFromCovariantAndContravariantTypes.kt");
|
runTest("compiler/testData/diagnostics/tests/inference/commonSystem/selectFromCovariantAndContravariantTypes.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user