[NI] Update some testdata broken in NI
This commit is contained in:
Vendored
+1
-1
@@ -30,7 +30,7 @@ fun <T> test(x: T) {
|
||||
<!REIFIED_TYPE_FORBIDDEN_SUBSTITUTION, REIFIED_TYPE_FORBIDDEN_SUBSTITUTION!>baz<!>(null, null, ::foo)
|
||||
|
||||
val s3: Pair<Int, String?> = <!NI;TYPE_MISMATCH, OI;TYPE_INFERENCE_EXPECTED_TYPE_MISMATCH!>bar(null, null, ::<!OI;TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>foo<!>)<!>
|
||||
val s4: Pair<Int?, String> = <!NI;TYPE_MISMATCH, NI;TYPE_MISMATCH, NI;TYPE_MISMATCH, OI;TYPE_INFERENCE_EXPECTED_TYPE_MISMATCH!>bar(null, null, ::<!OI;TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>foo<!>)<!>
|
||||
val s4: Pair<Int?, String> = <!NI;TYPE_MISMATCH, NI;TYPE_MISMATCH, NI;TYPE_MISMATCH, OI;TYPE_INFERENCE_EXPECTED_TYPE_MISMATCH!>bar(null, null, ::<!NI;IMPLICIT_NOTHING_AS_TYPE_PARAMETER, OI;TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>foo<!>)<!>
|
||||
|
||||
val s5: Pair<Int, String> = <!NI;TYPE_MISMATCH, NI;TYPE_MISMATCH, OI;TYPE_INFERENCE_EXPECTED_TYPE_MISMATCH!>bar(1, "", ::foo)<!>
|
||||
val (a1: Int, b1: String) = <!COMPONENT_FUNCTION_RETURN_TYPE_MISMATCH!>bar(1, "", ::foo)<!>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// !DIAGNOSTICS: -DEBUG_INFO_SMARTCAST
|
||||
// !WITH_NEW_INFERENCE
|
||||
fun bar(x: Int) = x + 1
|
||||
|
||||
fun foo() {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// !DIAGNOSTICS: -DEBUG_INFO_SMARTCAST
|
||||
// !WITH_NEW_INFERENCE
|
||||
fun bar(x: Int) = x + 1
|
||||
|
||||
fun foo() {
|
||||
@@ -12,17 +13,17 @@ fun foo() {
|
||||
if (1 > 2) bar(x)
|
||||
}
|
||||
if (<!SENSELESS_COMPARISON!>x == null<!>) {
|
||||
bar(x)
|
||||
<!NI;UNREACHABLE_CODE!>bar(<!>x<!NI;UNREACHABLE_CODE!>)<!>
|
||||
}
|
||||
if (<!SENSELESS_COMPARISON!>x == null<!>) bar(x) else bar(x)
|
||||
if (<!SENSELESS_COMPARISON!>x == null<!>) <!NI;UNREACHABLE_CODE!>bar(<!>x<!NI;UNREACHABLE_CODE!>)<!> else bar(x)
|
||||
bar(bar(x))
|
||||
} else if (<!SENSELESS_COMPARISON!><!DEBUG_INFO_CONSTANT!>x<!> == null<!>) {
|
||||
bar(<!DEBUG_INFO_CONSTANT, TYPE_MISMATCH!>x<!>)
|
||||
if (<!SENSELESS_COMPARISON!><!DEBUG_INFO_CONSTANT!>x<!> != null<!>) {
|
||||
bar(x)
|
||||
if (<!SENSELESS_COMPARISON!>x == null<!>) bar(x)
|
||||
if (<!SENSELESS_COMPARISON!>x == null<!>) bar(x) else bar(x)
|
||||
bar(bar(x) + bar(x))
|
||||
<!NI;UNREACHABLE_CODE!>bar(<!>x<!NI;UNREACHABLE_CODE!>)<!>
|
||||
<!NI;UNREACHABLE_CODE!>if (<!SENSELESS_COMPARISON!>x == null<!>) bar(x)<!>
|
||||
<!NI;UNREACHABLE_CODE!>if (<!SENSELESS_COMPARISON!>x == null<!>) bar(x) else bar(x)<!>
|
||||
<!NI;UNREACHABLE_CODE!>bar(bar(x) + bar(x))<!>
|
||||
} else if (<!SENSELESS_COMPARISON!><!DEBUG_INFO_CONSTANT!>x<!> == null<!>) {
|
||||
bar(<!DEBUG_INFO_CONSTANT, TYPE_MISMATCH!>x<!>)
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// !WITH_NEW_INFERENCE
|
||||
fun bar(x: Int): Int = x + 1
|
||||
|
||||
fun foo() {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// !WITH_NEW_INFERENCE
|
||||
fun bar(x: Int): Int = x + 1
|
||||
|
||||
fun foo() {
|
||||
@@ -10,7 +11,7 @@ fun foo() {
|
||||
bar(<!DEBUG_INFO_SMARTCAST!>x<!>)
|
||||
for (q in a) {
|
||||
bar(<!DEBUG_INFO_SMARTCAST!>x<!>)
|
||||
if (<!SENSELESS_COMPARISON!>x == null<!>) bar(<!DEBUG_INFO_SMARTCAST!>x<!>)
|
||||
if (<!SENSELESS_COMPARISON!>x == null<!>) <!NI;UNREACHABLE_CODE!>bar(<!><!DEBUG_INFO_SMARTCAST!>x<!><!NI;UNREACHABLE_CODE!>)<!>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
// !WITH_NEW_INFERENCE
|
||||
|
||||
fun <T : Any> nullable(): T? = null
|
||||
|
||||
val value = nullable<Int>() ?: nullable()
|
||||
fun test() {
|
||||
val value = nullable<Int>() ?: nullable()
|
||||
}
|
||||
@@ -1,5 +1,8 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
// !WITH_NEW_INFERENCE
|
||||
|
||||
fun <T : Any> nullable(): T? = null
|
||||
|
||||
val value = nullable<Int>() ?: <!OI;TYPE_INFERENCE_EXPECTED_TYPE_MISMATCH!>nullable()<!>
|
||||
fun test() {
|
||||
val value = nullable<Int>() ?: <!OI;TYPE_INFERENCE_EXPECTED_TYPE_MISMATCH!>nullable()<!>
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package
|
||||
|
||||
public val value: kotlin.Int
|
||||
public fun </*0*/ T : kotlin.Any> nullable(): T?
|
||||
public fun test(): kotlin.Unit
|
||||
|
||||
+1
@@ -1,5 +1,6 @@
|
||||
// !LANGUAGE: -AllowAssigningArrayElementsToVarargsInNamedFormForFunctions
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// !WITH_NEW_INFERENCE
|
||||
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
@Target(AnnotationTarget.EXPRESSION)
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
// !LANGUAGE: -AllowAssigningArrayElementsToVarargsInNamedFormForFunctions
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// !WITH_NEW_INFERENCE
|
||||
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
@Target(AnnotationTarget.EXPRESSION)
|
||||
@@ -19,7 +20,7 @@ fun test_fun(s: String, arr: Array<String>) {
|
||||
}
|
||||
|
||||
fun test_ann(s: String, arr: Array<String>) {
|
||||
@Ann(<!TYPE_INFERENCE_EXPECTED_TYPE_MISMATCH, TYPE_MISMATCH!>[""]<!>, x = 1)
|
||||
@Ann(<!NI;TYPE_MISMATCH, OI;TYPE_INFERENCE_EXPECTED_TYPE_MISMATCH, TYPE_MISMATCH!>[""]<!>, x = 1)
|
||||
foo()
|
||||
@Ann(*[""], x = 1)
|
||||
foo()
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -UNCHECKED_CAST -USELESS_CAST
|
||||
// !LANGUAGE: +ProhibitNonReifiedArraysAsReifiedTypeArguments
|
||||
// !WITH_NEW_INFERENCE
|
||||
class A<T>
|
||||
|
||||
fun test1(
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -UNCHECKED_CAST -USELESS_CAST
|
||||
// !LANGUAGE: +ProhibitNonReifiedArraysAsReifiedTypeArguments
|
||||
// !WITH_NEW_INFERENCE
|
||||
class A<T>
|
||||
|
||||
fun test1(
|
||||
@@ -50,6 +51,6 @@ fun test6() = <!UNSUPPORTED!>foo<!><Nothing>()
|
||||
|
||||
class B<T>(val array: Array<T>)
|
||||
|
||||
fun <T> bar() = B<Array<T>>(<!TYPE_PARAMETER_AS_REIFIED_ARRAY!>arrayOf<!>())
|
||||
fun <T> bar() = B<Array<T>>(<!NI;TYPE_PARAMETER_AS_REIFIED_ARRAY, TYPE_PARAMETER_AS_REIFIED_ARRAY!>arrayOf<!>())
|
||||
|
||||
fun test7() = <!UNSUPPORTED!>bar<!><Nothing>()
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ val test6 = <!OI;TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>generate<!> {
|
||||
}
|
||||
|
||||
val test7 = <!OI;TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>generate<!> {
|
||||
yield("baz")
|
||||
yield(<!NI;TYPE_MISMATCH!>"baz"<!>)
|
||||
genericExtension<Int>()
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// !WITH_NEW_INFERENCE
|
||||
// NI_EXPECTED_FILE
|
||||
|
||||
fun foo(first: Array<Any?>, second: Array<Any?>) = <!NI;NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>Pair<!>(first.<!NI;NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>toCollection<!>(<!NO_VALUE_FOR_PARAMETER!>)<!>, second.<!NI;NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>toCollection<!>(<!NO_VALUE_FOR_PARAMETER!>)<!>)
|
||||
fun foo(first: Array<Any?>, second: Array<Any?>) = Pair(first.toCollection(<!NO_VALUE_FOR_PARAMETER!>)<!>, second.toCollection(<!NO_VALUE_FOR_PARAMETER!>)<!>)
|
||||
@@ -1,3 +1,3 @@
|
||||
package
|
||||
|
||||
public fun foo(/*0*/ first: kotlin.Array<kotlin.Any?>, /*1*/ second: kotlin.Array<kotlin.Any?>): [ERROR : Error function type]
|
||||
public fun foo(/*0*/ first: kotlin.Array<kotlin.Any?>, /*1*/ second: kotlin.Array<kotlin.Any?>): kotlin.Pair<kotlin.collections.MutableCollection<in kotlin.Any?>, kotlin.collections.MutableCollection<in kotlin.Any?>>
|
||||
|
||||
Vendored
+1
-1
@@ -22,5 +22,5 @@ class Foo {
|
||||
// FILE: 1.kt
|
||||
fun test() {
|
||||
Foo().foo {} checkType { _<Int>() }
|
||||
Foo().bar {} checkType { <!NI;DEBUG_INFO_UNRESOLVED_WITH_TARGET, NI;UNRESOLVED_REFERENCE_WRONG_RECEIVER!>_<!><Int>() }
|
||||
Foo().bar {} checkType { _<Int>() }
|
||||
}
|
||||
+1
-1
@@ -18,5 +18,5 @@ public class Foo {
|
||||
|
||||
// FILE: 1.kt
|
||||
fun bar() {
|
||||
Foo().test {} checkType { <!NI;DEBUG_INFO_UNRESOLVED_WITH_TARGET, NI;UNRESOLVED_REFERENCE_WRONG_RECEIVER!>_<!><Int>() }
|
||||
Foo().test {} checkType { _<Int>() }
|
||||
}
|
||||
Reference in New Issue
Block a user