[Test] Disable UNUSED_* diagnostics in tests which are not belong to contolFlowAnalysis suite

This commit is contained in:
Dmitriy Novozhilov
2021-03-29 12:14:16 +03:00
committed by TeamCityServer
parent 85949b387e
commit cd890d5833
758 changed files with 1832 additions and 3745 deletions
@@ -1,7 +1,7 @@
package a
fun <T> foo(u: T, <!UNUSED_PARAMETER!>v<!>: T): T = u
fun <T> foo(u: T, v: T): T = u
fun test(s: String?) {
val <!UNUSED_VARIABLE!>r<!>: String = foo(s!!, <!DEBUG_INFO_SMARTCAST!>s<!>)
}
val r: String = foo(s!!, <!DEBUG_INFO_SMARTCAST!>s<!>)
}
@@ -32,7 +32,7 @@ fun test(a: A, b: B, c: C) {
checkSubtype<A>(k)
<!INAPPLICABLE_CANDIDATE!>checkSubtype<!><B>(k)
val l: Int = three(a, b, c)
use(d, e, f, g, h, k, l)
}
}
@@ -7,9 +7,9 @@ import checkSubtype
fun <T> id(t: T): T = t
fun <T> two(u: T, <!UNUSED_PARAMETER!>v<!>: T): T = u
fun <T> two(u: T, v: T): T = u
fun <T> three(<!UNUSED_PARAMETER!>a<!>: T, <!UNUSED_PARAMETER!>b<!>: T, c: T): T = c
fun <T> three(a: T, b: T, c: T): T = c
interface A
interface B: A
@@ -32,12 +32,12 @@ fun test(a: A, b: B, c: C) {
checkSubtype<A>(k)
checkSubtype<B>(<!TYPE_MISMATCH!>k<!>)
val l: Int = <!TYPE_INFERENCE_EXPECTED_TYPE_MISMATCH{OI}, TYPE_MISMATCH{NI}, TYPE_MISMATCH{NI}, TYPE_MISMATCH{NI}, TYPE_MISMATCH{NI}!>three(a, b, c)<!>
use(d, e, f, g, h, k, l)
}
}
fun <T> foo(t: T, <!UNUSED_PARAMETER!>l<!>: MutableList<T>): T = t
fun <T> foo(t: T, l: MutableList<T>): T = t
fun testErrorMessages(a: A, ml: MutableList<String>) {
if (a is B && a is C) {
@@ -58,6 +58,6 @@ fun rr(s: String?) {
}
//from library
fun <T> arrayListOf(vararg <!UNUSED_PARAMETER!>values<!>: T): MutableList<T> = throw Exception()
fun <T> arrayListOf(vararg values: T): MutableList<T> = throw Exception()
fun use(vararg a: Any) = a
@@ -35,6 +35,4 @@ public data class Tag(public var tagName: String) {
//from library
operator fun <K, V> MutableMap<K, V>.set(key : K, value : V) = this.put(key, value)
fun <T> arrayListOf(vararg <!UNUSED_PARAMETER!>values<!>: T): MutableList<T> = throw Exception()
fun <T> arrayListOf(vararg values: T): MutableList<T> = throw Exception()
@@ -1,10 +1,10 @@
//KT-2746 Do.smartcasts in inference
class C<T>(<!UNUSED_PARAMETER!>t<!> :T)
class C<T>(t :T)
fun test1(a: Any) {
if (a is String) {
val <!UNUSED_VARIABLE!>c<!>: C<String> = C(<!DEBUG_INFO_SMARTCAST!>a<!>)
val c: C<String> = C(<!DEBUG_INFO_SMARTCAST!>a<!>)
}
}
@@ -13,6 +13,6 @@ fun <T> f(t :T): C<T> = C(t)
fun test2(a: Any) {
if (a is String) {
val <!UNUSED_VARIABLE!>c1<!>: C<String> = f(<!DEBUG_INFO_SMARTCAST!>a<!>)
val c1: C<String> = f(<!DEBUG_INFO_SMARTCAST!>a<!>)
}
}
@@ -10,7 +10,7 @@ fun main() {
}
}
fun foo(<!UNUSED_PARAMETER!>map<!>: Pair<String, String>) {}
fun foo(map: Pair<String, String>) {}
//from library
@@ -7,5 +7,5 @@ fun <T> T.f(): T = this
fun test(a: A) {
if (a !is B) return
val <!UNUSED_VARIABLE!>c<!> = <!DEBUG_INFO_SMARTCAST!>a<!>.f() // type mismatch
}
val c = <!DEBUG_INFO_SMARTCAST!>a<!>.f() // type mismatch
}
@@ -3,7 +3,7 @@
interface SelfJson
object A {
fun find(<!UNUSED_PARAMETER!>clz<!>:Class<*>){ }
fun find(clz:Class<*>){ }
fun toJson2(obj:Any){
if(obj is SelfJson){