[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
-16
@@ -1,16 +0,0 @@
|
||||
package j
|
||||
|
||||
interface MyFunc<T> {}
|
||||
|
||||
class A(val b: B) {
|
||||
}
|
||||
|
||||
class B {
|
||||
operator fun <T> invoke(f: (T) -> T): MyFunc<T> = throw Exception()
|
||||
}
|
||||
|
||||
fun <R> id(r: R) = r
|
||||
|
||||
fun foo(a: A) {
|
||||
val r : MyFunc<Int> = id (a.b { x -> x + 14 })
|
||||
}
|
||||
compiler/testData/diagnostics/tests/inference/nestedCalls/completeNestedForVariableAsFunctionCall.kt
Vendored
+4
-3
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
package j
|
||||
|
||||
interface MyFunc<T> {}
|
||||
@@ -6,11 +7,11 @@ class A(val b: B) {
|
||||
}
|
||||
|
||||
class B {
|
||||
operator fun <T> invoke(<!UNUSED_PARAMETER!>f<!>: (T) -> T): MyFunc<T> = throw Exception()
|
||||
operator fun <T> invoke(f: (T) -> T): MyFunc<T> = throw Exception()
|
||||
}
|
||||
|
||||
fun <R> id(r: R) = r
|
||||
|
||||
fun foo(a: A) {
|
||||
val <!UNUSED_VARIABLE!>r<!> : MyFunc<Int> = id (a.b { x -> x + 14 })
|
||||
}
|
||||
val r : MyFunc<Int> = id (a.b { x -> x + 14 })
|
||||
}
|
||||
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
class A<T> {
|
||||
fun <S> foo(s: S): S = s
|
||||
fun <U> bar(s: U): List<T> = null!!
|
||||
|
||||
fun test() = foo(bar(""))
|
||||
}
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
// FIR_IDENTICAL
|
||||
class A<T> {
|
||||
fun <S> foo(s: S): S = s
|
||||
fun <U> bar(<!UNUSED_PARAMETER!>s<!>: U): List<T> = null!!
|
||||
fun <U> bar(s: U): List<T> = null!!
|
||||
|
||||
fun test() = foo(bar(""))
|
||||
}
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
//KT-3395 mapOf function can't be used as literal
|
||||
package b
|
||||
|
||||
import java.util.ArrayList
|
||||
|
||||
public fun <T> query(t: T, args: Map<String, Any>): List<T> {
|
||||
return ArrayList<T>()
|
||||
}
|
||||
|
||||
fun test(pair: Pair<String, Int>) {
|
||||
val id = "Hello" // variable is marked as unused
|
||||
|
||||
println("Some" + query(0, mapOf(id to 1)))
|
||||
|
||||
println("Some" + query(0, mapOf(pair)))
|
||||
}
|
||||
|
||||
|
||||
//from standard library
|
||||
fun <K, V> mapOf(vararg values: Pair<K, V>): Map<K, V> { throw Exception() }
|
||||
|
||||
infix fun <A,B> A.to(that: B): Pair<A, B> { throw Exception() }
|
||||
|
||||
fun println(message : Any?) { throw Exception() }
|
||||
|
||||
class Pair<out A, out B> () {}
|
||||
|
||||
//short example
|
||||
fun <T> foo(t: T) = t
|
||||
|
||||
fun test(t: String) {
|
||||
|
||||
println("Some" + foo(t)) // t was marked with black square
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
// FIR_IDENTICAL
|
||||
//KT-3395 mapOf function can't be used as literal
|
||||
package b
|
||||
|
||||
import java.util.ArrayList
|
||||
|
||||
public fun <T> query(<!UNUSED_PARAMETER!>t<!>: T, <!UNUSED_PARAMETER!>args<!>: Map<String, Any>): List<T> {
|
||||
public fun <T> query(t: T, args: Map<String, Any>): List<T> {
|
||||
return ArrayList<T>()
|
||||
}
|
||||
|
||||
@@ -17,11 +18,11 @@ fun test(pair: Pair<String, Int>) {
|
||||
|
||||
|
||||
//from standard library
|
||||
fun <K, V> mapOf(vararg <!UNUSED_PARAMETER!>values<!>: Pair<K, V>): Map<K, V> { throw Exception() }
|
||||
fun <K, V> mapOf(vararg values: Pair<K, V>): Map<K, V> { throw Exception() }
|
||||
|
||||
infix fun <A,B> A.to(<!UNUSED_PARAMETER!>that<!>: B): Pair<A, B> { throw Exception() }
|
||||
infix fun <A,B> A.to(that: B): Pair<A, B> { throw Exception() }
|
||||
|
||||
fun println(<!UNUSED_PARAMETER!>message<!> : Any?) { throw Exception() }
|
||||
fun println(message : Any?) { throw Exception() }
|
||||
|
||||
class Pair<out A, out B> () {}
|
||||
|
||||
@@ -32,4 +33,3 @@ fun test(t: String) {
|
||||
|
||||
println("Some" + foo(t)) // t was marked with black square
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -5,11 +5,11 @@ class F {
|
||||
fun p(): String? = null
|
||||
}
|
||||
|
||||
fun foo(<!UNUSED_PARAMETER!>s<!>: String) {}
|
||||
fun foo(s: String) {}
|
||||
|
||||
fun r(): Int? = null
|
||||
|
||||
fun test() {
|
||||
foo(<!TYPE_MISMATCH!>F().p()<!>)
|
||||
foo(<!TYPE_MISMATCH!>r()<!>)
|
||||
}
|
||||
}
|
||||
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
package a
|
||||
|
||||
fun foo(l: List<Int>): Int = l.get(0)
|
||||
|
||||
fun <T> emptyList(): List<T> = throw Exception()
|
||||
|
||||
fun <T: Any> makeNullable(t: T): T? = null
|
||||
|
||||
fun bar(i: Int) = i
|
||||
fun bar(a: Any) = a
|
||||
|
||||
fun test(array: Array<Int>) {
|
||||
bar(array[foo(emptyList())])
|
||||
|
||||
bar(foo(emptyList()) + foo(a.emptyList()))
|
||||
|
||||
bar(makeNullable(foo(emptyList())) ?: 0)
|
||||
}
|
||||
+3
-2
@@ -1,10 +1,11 @@
|
||||
// FIR_IDENTICAL
|
||||
package a
|
||||
|
||||
fun foo(l: List<Int>): Int = l.get(0)
|
||||
|
||||
fun <T> emptyList(): List<T> = throw Exception()
|
||||
|
||||
fun <T: Any> makeNullable(<!UNUSED_PARAMETER!>t<!>: T): T? = null
|
||||
fun <T: Any> makeNullable(t: T): T? = null
|
||||
|
||||
fun bar(i: Int) = i
|
||||
fun bar(a: Any) = a
|
||||
@@ -15,4 +16,4 @@ fun test(array: Array<Int>) {
|
||||
bar(foo(emptyList()) + foo(a.emptyList()))
|
||||
|
||||
bar(makeNullable(foo(emptyList())) ?: 0)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user