FIR: Update test data (NEW_INFERENCE_ERROR)
Though these diagnostics look correct (the calls or constraint systems indeed contain errors), more precise diagnostic kinds should be chosen later.
This commit is contained in:
committed by
teamcityserver
parent
010a0c6cdc
commit
da3233c47d
+8
-8
@@ -38,7 +38,7 @@ fun <R> select(vararg x: R) = x[0]
|
||||
|
||||
fun poll0(): Flow<String> {
|
||||
return flow {
|
||||
val inv = select(::bar, ::foo)
|
||||
val inv = <!NEW_INFERENCE_ERROR!>select(::bar, ::foo)<!>
|
||||
inv(<!NO_VALUE_FOR_PARAMETER!>)<!>
|
||||
}
|
||||
}
|
||||
@@ -52,7 +52,7 @@ fun poll01(): Flow<String> {
|
||||
|
||||
fun poll02(): Flow<String> {
|
||||
return flow {
|
||||
val inv = select(::bar3, ::foo3)
|
||||
val inv = <!NEW_INFERENCE_ERROR!>select(::bar3, ::foo3)<!>
|
||||
inv()
|
||||
}
|
||||
}
|
||||
@@ -66,7 +66,7 @@ fun poll03(): Flow<String> {
|
||||
|
||||
fun poll04(): Flow<String> {
|
||||
return flow {
|
||||
val inv = select(::bar5, ::foo5)
|
||||
val inv = <!NEW_INFERENCE_ERROR!>select(::bar5, ::foo5)<!>
|
||||
inv
|
||||
}
|
||||
}
|
||||
@@ -437,7 +437,7 @@ fun poll76(): Flow<String> {
|
||||
|
||||
fun poll8(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar in setOf(::foo)
|
||||
val inv = <!NEW_INFERENCE_ERROR!>::bar in <!NEW_INFERENCE_ERROR!>setOf(::foo)<!><!>
|
||||
<!UNRESOLVED_REFERENCE!>inv<!>()
|
||||
}
|
||||
}
|
||||
@@ -451,7 +451,7 @@ fun poll81(): Flow<String> {
|
||||
|
||||
fun poll82(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar3 in setOf(::foo3)
|
||||
val inv = ::bar3 in <!NEW_INFERENCE_ERROR!>setOf(::foo3)<!>
|
||||
<!UNRESOLVED_REFERENCE!>inv<!>()
|
||||
}
|
||||
}
|
||||
@@ -465,7 +465,7 @@ fun poll83(): Flow<String> {
|
||||
|
||||
fun poll84(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar5 in setOf(::foo5)
|
||||
val inv = <!NEW_INFERENCE_ERROR!>::bar5 in <!NEW_INFERENCE_ERROR!>setOf(::foo5)<!><!>
|
||||
inv
|
||||
}
|
||||
}
|
||||
@@ -479,7 +479,7 @@ fun poll85(): Flow<String> {
|
||||
|
||||
fun poll86(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::Foo7 in setOf(::Foo7)
|
||||
val inv = <!NEW_INFERENCE_ERROR!>::Foo7 in <!NEW_INFERENCE_ERROR!>setOf(::Foo7)<!><!>
|
||||
inv
|
||||
}
|
||||
}
|
||||
@@ -493,7 +493,7 @@ fun poll87(): Flow<String> {
|
||||
|
||||
fun poll88(): Flow<String> {
|
||||
return flow {
|
||||
val inv = foo7() in setOf(::Foo7)
|
||||
val inv = foo7() in <!NEW_INFERENCE_ERROR!>setOf(::Foo7)<!>
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,5 +5,5 @@
|
||||
class Foo<T : Enum<T>>(val values: Array<T>)
|
||||
|
||||
fun foo(x: Array<out Enum<*>>) {
|
||||
val y = Foo(x)
|
||||
val y = <!NEW_INFERENCE_ERROR!>Foo(x)<!>
|
||||
}
|
||||
|
||||
compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithExpectedTypeAndBound.fir.kt
Vendored
+2
-2
@@ -3,11 +3,11 @@
|
||||
fun <T : Number> materializeNumber(): T = TODO()
|
||||
|
||||
fun a(): Unit = run {
|
||||
materializeNumber()
|
||||
<!NEW_INFERENCE_ERROR!>materializeNumber()<!>
|
||||
}
|
||||
|
||||
fun b(): Unit = run {
|
||||
run {
|
||||
materializeNumber()
|
||||
<!NEW_INFERENCE_ERROR!>materializeNumber()<!>
|
||||
}
|
||||
}
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
interface Base
|
||||
class Foo : Base
|
||||
|
||||
fun <T : Base> myRun(action: () -> T): T = action()
|
||||
|
||||
fun foo(f: (Foo) -> Unit) {}
|
||||
|
||||
fun main() {
|
||||
foo { f: Foo ->
|
||||
<!NEW_INFERENCE_ERROR!>myRun { f }<!>
|
||||
}
|
||||
}
|
||||
+1
-2
@@ -1,4 +1,3 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
interface Base
|
||||
@@ -12,4 +11,4 @@ fun main() {
|
||||
foo { f: Foo ->
|
||||
myRun { f }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -59,11 +59,11 @@ fun testVariableWithBound() {
|
||||
|
||||
c1
|
||||
|
||||
val c2 = select(SubInv<String>(), createWithNumberBound())
|
||||
val c2 = <!NEW_INFERENCE_ERROR!>select(SubInv<String>(), createWithNumberBound())<!>
|
||||
|
||||
c2
|
||||
|
||||
val c3 = select(SubInv<Double>(), createWithIntBound())
|
||||
val c3 = <!NEW_INFERENCE_ERROR!>select(SubInv<Double>(), createWithIntBound())<!>
|
||||
|
||||
c3
|
||||
}
|
||||
|
||||
+2
-2
@@ -5,9 +5,9 @@ fun <K> id(x: K) = x
|
||||
|
||||
fun main() {
|
||||
val x1 = select<Any?>(id { x, y -> }, { x: Int, y -> })
|
||||
val x2 = select(id { x, y -> }, { x: Int, y -> })
|
||||
val x2 = <!NEW_INFERENCE_ERROR!>select(id { x, y -> }, { x: Int, y -> })<!>
|
||||
|
||||
val x3 = select(id(fun (x, y) {}), fun (x: Int, y) {})
|
||||
val x3 = <!NEW_INFERENCE_ERROR!>select(id(fun (x, y) {}), fun (x: Int, y) {})<!>
|
||||
|
||||
val x4 = select<Any?>((fun (x, y) {}), fun (x: Int, y) {})
|
||||
val x5 = select<Any?>(id(fun (x, y) {}), fun (x: Int, y) {})
|
||||
|
||||
+2
-2
@@ -262,8 +262,8 @@ class Main<L>(x: L?, y: L) {
|
||||
val x471 = foo47(y)
|
||||
|
||||
fun <R> takeLambda(block: () -> R): R = materialize()
|
||||
val x480 = takeLambda { foo48 { x } }
|
||||
val x481 = takeLambda { foo48 { y } }
|
||||
val x480 = <!NEW_INFERENCE_ERROR!>takeLambda { foo48 { <!ARGUMENT_TYPE_MISMATCH!>x<!> } }<!>
|
||||
val x481 = <!NEW_INFERENCE_ERROR!>takeLambda { foo48 { <!ARGUMENT_TYPE_MISMATCH!>y<!> } }<!>
|
||||
val x482 = takeLambda { foo48 { null } }
|
||||
}
|
||||
|
||||
|
||||
@@ -9,5 +9,5 @@ fun <T: Inv2<T>> foo(klass: Inv<T>): String? = null
|
||||
fun <X> bar(): Inv<X> = null!!
|
||||
|
||||
fun test() {
|
||||
foo(bar())
|
||||
<!NEW_INFERENCE_ERROR!>foo(bar())<!>
|
||||
}
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ fun test(z: Z) {
|
||||
operator fun <T> Z.plus(a: A<T>): A<T> = a
|
||||
|
||||
fun test1(z: Z) {
|
||||
id(z + newA())
|
||||
<!NEW_INFERENCE_ERROR!>id(z + newA())<!>
|
||||
val a: A<Z> = z + newA()
|
||||
val b: A<Z> = z.plus(newA())
|
||||
val c: A<Z> = id(z + newA())
|
||||
|
||||
Vendored
+6
-6
@@ -17,19 +17,19 @@ fun test1(b: Boolean?) {
|
||||
}
|
||||
|
||||
fun test2() {
|
||||
select(
|
||||
<!NEW_INFERENCE_ERROR!>select(
|
||||
materialize()
|
||||
)
|
||||
)<!>
|
||||
select(materialize(), materialize<String>())
|
||||
select(materialize(), null, Inv<String>())
|
||||
select(
|
||||
<!NEW_INFERENCE_ERROR!>select(
|
||||
materialize(),
|
||||
null
|
||||
)
|
||||
select(
|
||||
)<!>
|
||||
<!NEW_INFERENCE_ERROR!>select(
|
||||
materialize(),
|
||||
materialize()
|
||||
)
|
||||
)<!>
|
||||
select(
|
||||
materialize(),
|
||||
materialize(),
|
||||
|
||||
+3
-3
@@ -284,7 +284,7 @@ fun poll82() {
|
||||
}
|
||||
|
||||
fun poll83() {
|
||||
val inv = ::bar4 in setOf(::foo4)
|
||||
val inv = <!NEW_INFERENCE_ERROR!>::bar4 in <!NEW_INFERENCE_ERROR!>setOf(::foo4)<!><!>
|
||||
inv
|
||||
}
|
||||
|
||||
@@ -299,7 +299,7 @@ fun poll85() {
|
||||
}
|
||||
|
||||
fun poll86() {
|
||||
val inv = ::Foo7 in setOf(::Foo7)
|
||||
val inv = <!NEW_INFERENCE_ERROR!>::Foo7 in <!NEW_INFERENCE_ERROR!>setOf(::Foo7)<!><!>
|
||||
inv
|
||||
}
|
||||
|
||||
@@ -309,6 +309,6 @@ fun poll87() {
|
||||
}
|
||||
|
||||
fun poll88() {
|
||||
val inv = foo7() in setOf(::Foo7)
|
||||
val inv = foo7() in <!NEW_INFERENCE_ERROR!>setOf(::Foo7)<!>
|
||||
inv
|
||||
}
|
||||
|
||||
+2
-2
@@ -6,5 +6,5 @@ fun <E : Enum<E>> createMap(enumClass: Class<E>) {}
|
||||
|
||||
fun reproduce() {
|
||||
val enumClass: Class<Enum<*>> = "any" as Class<Enum<*>>
|
||||
createMap(enumClass)
|
||||
}
|
||||
<!NEW_INFERENCE_ERROR!>createMap(enumClass)<!>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user