[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
+1
-1
@@ -34,6 +34,6 @@ fun main() {
|
||||
}
|
||||
}
|
||||
|
||||
val <!UNUSED_VARIABLE!>f<!> : String = <!TYPE_MISMATCH!>a<!><!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>
|
||||
val f : String = <!TYPE_MISMATCH!>a<!><!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>
|
||||
checkSubtype<String>(<!TYPE_MISMATCH{NI}!><!TYPE_MISMATCH{OI}!>a<!><!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!><!>)
|
||||
}
|
||||
|
||||
+4
-4
@@ -1,12 +1,12 @@
|
||||
// !WITH_NEW_INFERENCE
|
||||
class A() {
|
||||
operator infix fun plus(<!UNUSED_PARAMETER!>i<!> : Int) {}
|
||||
operator infix fun plus(i : Int) {}
|
||||
operator fun unaryMinus() {}
|
||||
operator infix fun contains(<!UNUSED_PARAMETER!>a<!> : Any?) : Boolean = true
|
||||
operator infix fun contains(a : Any?) : Boolean = true
|
||||
}
|
||||
|
||||
operator infix fun A.div(<!UNUSED_PARAMETER!>i<!> : Int) {}
|
||||
operator infix fun A?.times(<!UNUSED_PARAMETER!>i<!> : Int) {}
|
||||
operator infix fun A.div(i : Int) {}
|
||||
operator infix fun A?.times(i : Int) {}
|
||||
|
||||
fun test(x : Int?, a : A?) {
|
||||
x<!UNSAFE_CALL!>.<!>plus(1)
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@ fun foo() {
|
||||
val i : Int? = 42
|
||||
if (i != null) {
|
||||
<!UNRESOLVED_REFERENCE!>doSmth<!> {
|
||||
val <!UNUSED_VARIABLE!>x<!> = <!DEBUG_INFO_SMARTCAST!>i<!> + 1
|
||||
val x = <!DEBUG_INFO_SMARTCAST!>i<!> + 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
//KT-2125 Inconsistent error message on UNSAFE_CALL
|
||||
|
||||
package e
|
||||
|
||||
fun main() {
|
||||
val compareTo = 1
|
||||
val s: String? = null
|
||||
s<!UNSAFE_CALL!>.<!>compareTo("")
|
||||
|
||||
val bar = 2
|
||||
s.<!UNRESOLVED_REFERENCE!>bar<!>()
|
||||
}
|
||||
@@ -1,12 +1,13 @@
|
||||
// FIR_IDENTICAL
|
||||
//KT-2125 Inconsistent error message on UNSAFE_CALL
|
||||
|
||||
package e
|
||||
|
||||
fun main() {
|
||||
val <!UNUSED_VARIABLE!>compareTo<!> = 1
|
||||
val compareTo = 1
|
||||
val s: String? = null
|
||||
s<!UNSAFE_CALL!>.<!>compareTo("")
|
||||
|
||||
val <!UNUSED_VARIABLE!>bar<!> = 2
|
||||
val bar = 2
|
||||
s.<!UNRESOLVED_REFERENCE!>bar<!>()
|
||||
}
|
||||
|
||||
@@ -18,8 +18,8 @@ fun main() {
|
||||
fun foo() {
|
||||
val x : Int? = 3
|
||||
if (x != null) {
|
||||
val <!UNUSED_VARIABLE!>u<!> = checkSubtype<Int>(x<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>)
|
||||
val u = checkSubtype<Int>(x<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>)
|
||||
val y = checkSubtype<Int>(<!DEBUG_INFO_SMARTCAST!>x<!>)
|
||||
val <!UNUSED_VARIABLE!>z<!> : Int = y
|
||||
val z : Int = y
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ package kt244
|
||||
fun f(s: String?) {
|
||||
if (s != null) {
|
||||
<!DEBUG_INFO_SMARTCAST!>s<!>.length //ok
|
||||
var <!UNUSED_VARIABLE!>i<!> = <!DEBUG_INFO_SMARTCAST!>s<!>.length //error: Only safe calls are allowed on a nullable receiver
|
||||
var i = <!DEBUG_INFO_SMARTCAST!>s<!>.length //error: Only safe calls are allowed on a nullable receiver
|
||||
System.out.println(<!DEBUG_INFO_SMARTCAST!>s<!>.length) //error
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@ class A(a: String?) {
|
||||
val b = if (a != null) <!DEBUG_INFO_SMARTCAST!>a<!>.length else 1
|
||||
init {
|
||||
if (a != null) {
|
||||
val <!UNUSED_VARIABLE!>c<!> = <!DEBUG_INFO_SMARTCAST!>a<!>.length
|
||||
val c = <!DEBUG_INFO_SMARTCAST!>a<!>.length
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user