FIR: Update diagnostics test data
Green code correctly became red
This commit is contained in:
committed by
teamcityserver
parent
829f80179c
commit
b94335dd1c
+2
-2
@@ -48,9 +48,9 @@ fun bar(block: () -> String) {}
|
||||
|
||||
fun test_5(b: Boolean) {
|
||||
bar {
|
||||
if (b) {
|
||||
<!ARGUMENT_TYPE_MISMATCH!>if (b) {
|
||||
println("meh")
|
||||
}
|
||||
}<!>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -16,5 +16,5 @@ fun <S> test1(a: ParameterizedChild<S>?, b: Child): Base<S> = myRun {
|
||||
}
|
||||
|
||||
fun <S> test2(a: S?, b: S): S = myRun {
|
||||
select(a, b)
|
||||
<!ARGUMENT_TYPE_MISMATCH!>select(a, b)<!>
|
||||
}
|
||||
|
||||
+1
-1
@@ -20,5 +20,5 @@ fun testFunctions() {
|
||||
fun testNestedCalls() {
|
||||
id<String>(inferFromLambda { materialize() })
|
||||
id<String>(inferFromLambda(fun() = materialize()))
|
||||
id<String>(<!ARGUMENT_TYPE_MISMATCH!>inferFromLambda2(fun() = <!ARGUMENT_TYPE_MISMATCH!>materialize()<!>)<!>)
|
||||
id<String>(inferFromLambda2(<!ARGUMENT_TYPE_MISMATCH!>fun() = materialize()<!>))
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ fun f1(future: OurFuture<String>, e: Either.Left<String>) {
|
||||
true -> OurFuture.createOurFuture(e)
|
||||
else -> throw Exception()
|
||||
}
|
||||
x
|
||||
<!ARGUMENT_TYPE_MISMATCH!>x<!>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,4 +42,4 @@ fun f2(future: OurFuture<String>, e: Either.Left<String>) {
|
||||
else -> throw Exception()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+14
-14
@@ -78,11 +78,11 @@ fun main() {
|
||||
|
||||
// Interdependent lambdas by input-output types aren't supported
|
||||
takeInterdependentLambdas({}, {})
|
||||
takeInterdependentLambdas({ it }, { 10 })
|
||||
takeInterdependentLambdas({ 10 }, { it })
|
||||
takeInterdependentLambdas({ 10 }, { x -> x })
|
||||
takeInterdependentLambdas({ x -> 10 }, { it })
|
||||
takeInterdependentLambdas({ it }, { x -> 10 })
|
||||
takeInterdependentLambdas({ it }, { <!ARGUMENT_TYPE_MISMATCH!>10<!> })
|
||||
takeInterdependentLambdas({ <!ARGUMENT_TYPE_MISMATCH!>10<!> }, { it })
|
||||
takeInterdependentLambdas({ <!ARGUMENT_TYPE_MISMATCH!>10<!> }, { x -> x })
|
||||
takeInterdependentLambdas({ x -> <!ARGUMENT_TYPE_MISMATCH!>10<!> }, { it })
|
||||
takeInterdependentLambdas({ it }, { x -> <!ARGUMENT_TYPE_MISMATCH!>10<!> })
|
||||
|
||||
// Dependent lambdas by input-output types
|
||||
takeDependentLambdas({ <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>it<!> }, { it })
|
||||
@@ -138,8 +138,8 @@ fun main() {
|
||||
* K <: (C) -> Unit -> TypeVariable(_RP1) >: C
|
||||
* K == (B) -> Unit -> TypeVariable(_RP1) == B
|
||||
*/
|
||||
val x17: (C) -> Unit = <!INITIALIZER_TYPE_MISMATCH!>selectB(id { <!DEBUG_INFO_EXPRESSION_TYPE("B")!>it<!> }, id { it }, id<(B) -> Unit> { x -> x })<!>
|
||||
val x18: (C) -> Unit = select(id { <!DEBUG_INFO_EXPRESSION_TYPE("C")!>it<!> }, { <!DEBUG_INFO_EXPRESSION_TYPE("C")!>it<!> }, id<(B) -> Unit> { x -> x })
|
||||
val x17: (C) -> Unit = <!INITIALIZER_TYPE_MISMATCH, TYPE_MISMATCH!>selectB(id <!TYPE_MISMATCH!>{ <!DEBUG_INFO_EXPRESSION_TYPE("B")!>it<!> }<!>, id <!TYPE_MISMATCH!>{ it }<!>, id<(B) -> Unit> { x -> x })<!>
|
||||
val x18: (C) -> Unit = <!TYPE_MISMATCH!>select(id <!TYPE_MISMATCH!>{ <!DEBUG_INFO_EXPRESSION_TYPE("C")!>it<!> }<!>, <!TYPE_MISMATCH!>{ <!DEBUG_INFO_EXPRESSION_TYPE("C")!>it<!> }<!>, id<(B) -> Unit> { x -> x })<!>
|
||||
|
||||
// Resolution of extension/non-extension functions combination
|
||||
val x19: String.() -> Unit = select(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Function1<kotlin.String, kotlin.Unit>")!>id { <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>this<!> }<!>, <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Function1<kotlin.String, kotlin.Unit>")!>id(fun(x: String) {})<!>)
|
||||
@@ -149,14 +149,14 @@ fun main() {
|
||||
select(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Function2<kotlin.String, kotlin.String, kotlin.Unit>")!>id(fun String.(x: String) {})<!>, <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Function2<kotlin.String, kotlin.String, kotlin.Unit>")!>id(fun(x: String, y: String) {})<!>)
|
||||
select(id(fun String.(x: String) {}), id(fun(x: String, y: String) { }), { x: String -> <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>this<!> })
|
||||
select(id(fun String.(x: String) {}), id(fun(x: String, y: String) { }), { x -> <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>this<!> })
|
||||
select(id(fun String.(x: String) {}), id(fun(x: String, y: String) { }), { x: String, y: String -> x })
|
||||
select(id(fun String.(x: String) {}), id(fun(x: String, y: String) { }), <!TYPE_MISMATCH!>{ x: String, y: String -> x }<!>)
|
||||
// Convert to extension lambda is impossible because the lambda parameter types aren't specified explicitly
|
||||
select(id(fun String.(x: String) {}), id(fun(x: String, y: String) { }), { x, <!CANNOT_INFER_PARAMETER_TYPE!>y<!> -> x })
|
||||
select(id(fun String.(x: String) {}), id(fun(x: String, y: String) { }), <!TYPE_MISMATCH!>{ x, <!CANNOT_INFER_PARAMETER_TYPE!>y<!> -> x }<!>)
|
||||
select(id(id(fun(x: String, y: String) { }), <!TOO_MANY_ARGUMENTS!>fun String.(x: String) {}<!>), { x, y -> x })
|
||||
val x26: Int.(String) -> Int = fun (x: String) = 10 // it must be error, see KT-38439
|
||||
// Receiver must be specified in anonymous function declaration
|
||||
val x27: Int.(String) -> Int = id(fun (x: String) = 10)
|
||||
select(id<Int.(String) -> Unit> {}, { x: Int, y: String -> x })
|
||||
val x27: Int.(String) -> Int = id(<!TYPE_MISMATCH!>fun (x: String) = 10<!>)
|
||||
select(id<Int.(String) -> Unit> {}, <!TYPE_MISMATCH!>{ x: Int, y: String -> x }<!>)
|
||||
|
||||
// Inferring lambda parameter types by partially specified parameter types of other lambdas
|
||||
select(id { x, y -> x.inv() + y.toByte() }, { x: Int, y -> y.toByte() }, { x, y: Number -> x.inv() })
|
||||
@@ -218,7 +218,7 @@ fun main() {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Function<kotlin.Any>")!>select({ x: Int -> TODO() }, id { x: Int, y: Number -> Any() })<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Function1<*, kotlin.String?>")!>select(id { x: Int -> null }, id { x: String -> "" })<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Function<kotlin.Int>")!>select(id { x: Int -> 10 }, id { x: Int, y: Number -> TODO() })<!>
|
||||
val x68: String.(String) -> String = select(id { x: String, y: String -> "10" }, id { x: String, y: String -> "TODO()" })
|
||||
val x68: String.(String) -> String = select(id <!TYPE_MISMATCH!>{ x: String, y: String -> "10" }<!>, id <!TYPE_MISMATCH!>{ x: String, y: String -> "TODO()" }<!>)
|
||||
|
||||
// Anonymous functions
|
||||
val x69: (C) -> Unit = selectB({ it }, { }, id(fun (x) { <!DEBUG_INFO_EXPRESSION_TYPE("A")!>x<!> }))
|
||||
@@ -229,7 +229,7 @@ fun main() {
|
||||
val x71: String.() -> Unit = select(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Function1<kotlin.String, kotlin.Unit>")!>id(fun String.() { })<!>, <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Function1<kotlin.String, kotlin.Unit>")!>id(fun(x: String) {})<!>)
|
||||
val x72: String.() -> Unit = select(fun String.() { }, fun(x: String) {}) // must be error
|
||||
select(id(fun String.(x: String) {}), id(fun(x: String, y: String) { }), fun (x, y) { <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>x<!>;<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>y<!> })
|
||||
select(id<Int.(String) -> Unit>(fun (x, y) {}), { x: Int, y: String -> x }) // receiver of anonymous function must be specified explicitly
|
||||
select(id<Int.(String) -> Unit>(fun Int.(y) {}), { x: Int, y: String -> x })
|
||||
select(id<Int.(String) -> Unit>(fun (x, y) {}), <!TYPE_MISMATCH!>{ x: Int, y: String -> x }<!>) // receiver of anonymous function must be specified explicitly
|
||||
select(id<Int.(String) -> Unit>(fun Int.(y) {}), <!TYPE_MISMATCH!>{ x: Int, y: String -> x }<!>)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Function1<kotlin.Number, java.io.Serializable>")!>select(A3(), fun (x) = "", { a -> <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number")!>a<!> })<!>
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ fun <T> readFromMyList(l: MyList<out T>, t: T) {}
|
||||
fun test1(int: Int, any: Any) {
|
||||
val a0 : MyList<Any> = getMyList(int)
|
||||
|
||||
val a1 : MyList<Int> = getMyList(any)
|
||||
val a1 : MyList<Int> = <!TYPE_MISMATCH, TYPE_MISMATCH!>getMyList(any)<!>
|
||||
|
||||
val a2 : MyList<out Any> = getMyList(int)
|
||||
|
||||
|
||||
+4
-4
@@ -13,7 +13,7 @@ fun insideJob1() = doTheJob1()
|
||||
suspend fun insideJob2() = doTheJob2()
|
||||
suspend fun insideJob3() = doTheJob3()
|
||||
|
||||
fun doTheJob0() = simpleAsync0 { insideJob0() }
|
||||
fun doTheJob1() = simpleAsync1 { insideJob1() }
|
||||
suspend fun doTheJob2() = simpleAsync2 { insideJob2() }
|
||||
suspend fun doTheJob3() = simpleAsync3 { insideJob3() }
|
||||
fun doTheJob0() = simpleAsync0 { <!ARGUMENT_TYPE_MISMATCH!>insideJob0()<!> }
|
||||
fun doTheJob1() = simpleAsync1 { <!ARGUMENT_TYPE_MISMATCH!>insideJob1()<!> }
|
||||
suspend fun doTheJob2() = simpleAsync2 { <!ARGUMENT_TYPE_MISMATCH!>insideJob2()<!> }
|
||||
suspend fun doTheJob3() = simpleAsync3 { <!ARGUMENT_TYPE_MISMATCH!>insideJob3()<!> }
|
||||
|
||||
@@ -10,5 +10,5 @@ fun <A, B> Foo<A>.map(f: (A) -> B): Foo<B> = object : Foo<B> {}
|
||||
|
||||
fun foo() {
|
||||
val l: Foo<String> = object : Foo<String> {}
|
||||
val m: Foo<String> = l.map { ppp -> 1 }
|
||||
val m: Foo<String> = l.map { ppp -> <!ARGUMENT_TYPE_MISMATCH!>1<!> }
|
||||
}
|
||||
|
||||
@@ -12,14 +12,14 @@ abstract class Buggy {
|
||||
}
|
||||
|
||||
val anotherThree : Int
|
||||
get() = coll.find{ it > 3 } // does not work here
|
||||
get() = <!TYPE_MISMATCH!>coll.find{ it > 3 }<!> // does not work here
|
||||
|
||||
val yetAnotherThree : Int
|
||||
get() = coll.find({ v:Int -> v > 3 }) // neither here
|
||||
get() = <!TYPE_MISMATCH!>coll.find({ v:Int -> v > 3 })<!> // neither here
|
||||
|
||||
val extendedGetter : Int
|
||||
get() {
|
||||
return coll.find{ it > 3 } // not even here!
|
||||
return <!TYPE_MISMATCH!>coll.find{ it > 3 }<!> // not even here!
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -16,6 +16,6 @@ fun <T, G> A<T>.foo(x: (T)-> G): G {
|
||||
|
||||
fun main() {
|
||||
val a = A(1)
|
||||
val t: String = a.foo({p -> p})
|
||||
val t: String = a.foo({p -> <!ARGUMENT_TYPE_MISMATCH!>p<!>})
|
||||
checkSubtype<String>(t)
|
||||
}
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@ package typeInferenceExpectedTypeMismatch
|
||||
import java.util.*
|
||||
|
||||
fun test() {
|
||||
val s : Set<Int> = <!INITIALIZER_TYPE_MISMATCH!>newList()<!>
|
||||
val s : Set<Int> = <!INITIALIZER_TYPE_MISMATCH, TYPE_MISMATCH!>newList()<!>
|
||||
use(s)
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ fun <T, R> foo(o: Out<T>, i: In<R>): Two<T, R> = throw Exception("$o $i")
|
||||
fun test1(outA: Out<A>, inB: In<B>) {
|
||||
foo(outA, inB)
|
||||
|
||||
val b: Two<A, C> = foo(outA, inB)
|
||||
val b: Two<A, C> = <!TYPE_MISMATCH!>foo(outA, inB)<!>
|
||||
use(b)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user