[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,6 +1,6 @@
// !CHECK_TYPE
infix fun Int.compareTo(<!UNUSED_PARAMETER!>o<!>: Int) = 0
infix fun Int.compareTo(o: Int) = 0
fun foo(a: Number): Int {
val result = (a as Int) compareTo <!DEBUG_INFO_SMARTCAST!>a<!>
@@ -12,4 +12,4 @@ fun bar(a: Number): Int {
val result = 42 compareTo (a as Int)
checkSubtype<Int>(<!DEBUG_INFO_SMARTCAST!>a<!>)
return result
}
}
@@ -5,7 +5,7 @@ fun bar(x: Int): Int = x + 1
fun foo() {
val x: Int? = null
val <!UNUSED_VARIABLE!>a<!> = object {
val a = object {
fun baz() = bar(if (x == null) 0 else <!DEBUG_INFO_SMARTCAST!>x<!>)
fun quux(): Int = if (x == null) <!DEBUG_INFO_CONSTANT, TYPE_MISMATCH!>x<!> else <!DEBUG_INFO_SMARTCAST!>x<!>
}
@@ -2,10 +2,10 @@
fun foo(s: String?) {
when {
s == null -> <!UNUSED_EXPRESSION!>1<!>
<!DEBUG_INFO_SMARTCAST!>s<!>.foo() -> <!UNUSED_EXPRESSION!>2<!>
else -> <!UNUSED_EXPRESSION!>3<!>
s == null -> 1
<!DEBUG_INFO_SMARTCAST!>s<!>.foo() -> 2
else -> 3
}
}
fun String.foo() = true
fun String.foo() = true
@@ -20,34 +20,34 @@ class AClass() {
val x : Any? = 1
fun Any?.vars(<!UNUSED_PARAMETER!>a<!>: Any?) : Int {
fun Any?.vars(a: Any?) : Int {
var <!ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE!>b<!>: Int = 0
if (example.ns.y is Int) {
<!UNUSED_VALUE!>b =<!> <!DEBUG_INFO_SMARTCAST!>y<!>
b = <!DEBUG_INFO_SMARTCAST!>y<!>
}
if (example.ns.y is Int) {
<!UNUSED_VALUE!>b =<!> <!DEBUG_INFO_SMARTCAST!>example.ns.y<!>
b = <!DEBUG_INFO_SMARTCAST!>example.ns.y<!>
}
if (Obj.y is Int) {
<!UNUSED_VALUE!>b =<!> <!DEBUG_INFO_SMARTCAST!>Obj.y<!>
b = <!DEBUG_INFO_SMARTCAST!>Obj.y<!>
}
if (example.Obj.y is Int) {
<!UNUSED_VALUE!>b =<!> <!DEBUG_INFO_SMARTCAST!>Obj.y<!>
b = <!DEBUG_INFO_SMARTCAST!>Obj.y<!>
}
if (AClass.y is Int) {
<!UNUSED_VALUE!>b =<!> <!DEBUG_INFO_SMARTCAST!>AClass.y<!>
b = <!DEBUG_INFO_SMARTCAST!>AClass.y<!>
}
if (example.AClass.y is Int) {
<!UNUSED_VALUE!>b =<!> <!DEBUG_INFO_SMARTCAST!>AClass.y<!>
b = <!DEBUG_INFO_SMARTCAST!>AClass.y<!>
}
if (x is Int) {
<!UNUSED_VALUE!>b =<!> <!DEBUG_INFO_SMARTCAST!>x<!>
b = <!DEBUG_INFO_SMARTCAST!>x<!>
}
if (example.x is Int) {
<!UNUSED_VALUE!>b =<!> <!DEBUG_INFO_SMARTCAST!>x<!>
b = <!DEBUG_INFO_SMARTCAST!>x<!>
}
if (example.x is Int) {
<!UNUSED_VALUE!>b =<!> <!DEBUG_INFO_SMARTCAST!>example.x<!>
b = <!DEBUG_INFO_SMARTCAST!>example.x<!>
}
return 1
}
@@ -71,16 +71,16 @@ open class C {
fun foo() {
var <!ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE!>t<!> : T? = null
if (this is T) {
<!UNUSED_VALUE!>t =<!> <!DEBUG_INFO_SMARTCAST!>this<!>
t = <!DEBUG_INFO_SMARTCAST!>this<!>
}
if (this is T) {
<!UNUSED_VALUE!>t =<!> <!DEBUG_INFO_SMARTCAST!>this@C<!>
t = <!DEBUG_INFO_SMARTCAST!>this@C<!>
}
if (this@C is T) {
<!UNUSED_VALUE!>t =<!> <!DEBUG_INFO_SMARTCAST!>this<!>
t = <!DEBUG_INFO_SMARTCAST!>this<!>
}
if (this@C is T) {
<!UNUSED_VALUE!>t =<!> <!DEBUG_INFO_SMARTCAST!>this@C<!>
t = <!DEBUG_INFO_SMARTCAST!>this@C<!>
}
}
}