[Test] Disable UNUSED_* diagnostics in tests which are not belong to contolFlowAnalysis suite
This commit is contained in:
committed by
TeamCityServer
parent
85949b387e
commit
cd890d5833
+10
-10
@@ -9,28 +9,28 @@ abstract class Usual<T> {}
|
||||
|
||||
fun foo(c: Consumer<Int>, p: Producer<Int>, u: Usual<Int>) {
|
||||
val c1: Consumer<Any> = <!TYPE_MISMATCH!>c<!>
|
||||
val <!UNUSED_VARIABLE!>c2<!>: Consumer<Int> = c1
|
||||
val c2: Consumer<Int> = c1
|
||||
|
||||
val p1: Producer<Any> = p
|
||||
val <!UNUSED_VARIABLE!>p2<!>: Producer<Int> = <!TYPE_MISMATCH!>p1<!>
|
||||
val p2: Producer<Int> = <!TYPE_MISMATCH!>p1<!>
|
||||
|
||||
val u1: Usual<Any> = <!TYPE_MISMATCH!>u<!>
|
||||
val <!UNUSED_VARIABLE!>u2<!>: Usual<Int> = <!TYPE_MISMATCH!>u1<!>
|
||||
val u2: Usual<Int> = <!TYPE_MISMATCH!>u1<!>
|
||||
}
|
||||
|
||||
//Arrays copy example
|
||||
class Array<T>(val length : Int, val t : T) {
|
||||
fun get(<!UNUSED_PARAMETER!>index<!> : Int) : T { return t }
|
||||
fun set(<!UNUSED_PARAMETER!>index<!> : Int, <!UNUSED_PARAMETER!>value<!> : T) { /* ... */ }
|
||||
fun get(index : Int) : T { return t }
|
||||
fun set(index : Int, value : T) { /* ... */ }
|
||||
}
|
||||
|
||||
fun copy1(<!UNUSED_PARAMETER!>from<!> : Array<Any>, <!UNUSED_PARAMETER!>to<!> : Array<Any>) {}
|
||||
fun copy1(from : Array<Any>, to : Array<Any>) {}
|
||||
|
||||
fun copy2(<!UNUSED_PARAMETER!>from<!> : Array<out Any>, <!UNUSED_PARAMETER!>to<!> : Array<in Any>) {}
|
||||
fun copy2(from : Array<out Any>, to : Array<in Any>) {}
|
||||
|
||||
fun <T> copy3(<!UNUSED_PARAMETER!>from<!> : Array<out T>, <!UNUSED_PARAMETER!>to<!> : Array<in T>) {}
|
||||
fun <T> copy3(from : Array<out T>, to : Array<in T>) {}
|
||||
|
||||
fun copy4(<!UNUSED_PARAMETER!>from<!> : Array<out Number>, <!UNUSED_PARAMETER!>to<!> : Array<in Int>) {}
|
||||
fun copy4(from : Array<out Number>, to : Array<in Int>) {}
|
||||
|
||||
fun f(ints: Array<Int>, any: Array<Any>, numbers: Array<Number>) {
|
||||
copy1(<!TYPE_MISMATCH!>ints<!>, any)
|
||||
@@ -38,4 +38,4 @@ fun f(ints: Array<Int>, any: Array<Any>, numbers: Array<Number>) {
|
||||
copy2(ints, <!TYPE_MISMATCH!>numbers<!>)
|
||||
copy3<Int>(ints, numbers)
|
||||
copy4(ints, numbers) //ok
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user