[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
@@ -6,4 +6,4 @@ fun f() {
listOf(1).<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>map<!> { <!UNRESOLVED_REFERENCE!>it<!>.<!DEBUG_INFO_MISSING_UNRESOLVED!>hashCode<!>() }
}
fun g(<!UNUSED_PARAMETER!>a1<!>: KotlinArray<Int>, <!UNUSED_PARAMETER!>a2<!>: <!UNRESOLVED_REFERENCE!>Array<!><Int>){}
fun g(a1: KotlinArray<Int>, a2: <!UNRESOLVED_REFERENCE!>Array<!><Int>){}
@@ -11,7 +11,7 @@ interface My {
var v: String
<!SYNCHRONIZED_IN_INTERFACE!>@Synchronized<!> get() = ""
<!SYNCHRONIZED_IN_INTERFACE!>@Synchronized<!> set(<!UNUSED_PARAMETER!>value<!>) {}
<!SYNCHRONIZED_IN_INTERFACE!>@Synchronized<!> set(value) {}
}
abstract class Your {
@@ -25,7 +25,7 @@ abstract class Your {
var v: String
@Synchronized get() = ""
@Synchronized set(<!UNUSED_PARAMETER!>value<!>) {}
@Synchronized set(value) {}
}
@Synchronized fun gav() = 1
@@ -27,8 +27,8 @@ var mutable = ""
var mutableWithGetter
get() = ""
set(<!UNUSED_PARAMETER!>x<!>) = TODO()
set(x) = TODO()
object WithLateinit {
lateinit var kClass: KClass<*>
}
}
@@ -25,5 +25,5 @@ interface B {
<!JVM_DEFAULT_IN_DECLARATION!>@<!DEPRECATION!>JvmDefault<!>
var prop4: String<!>
get() = ""
set(<!UNUSED_PARAMETER!>value<!>) {}
set(value) {}
}
@@ -18,5 +18,5 @@ object B {
fun test() {}
<!JVM_DEFAULT_NOT_IN_INTERFACE!>@<!DEPRECATION!>JvmDefault<!><!>
fun test2(<!UNUSED_PARAMETER!>s<!>: String = "") {}
fun test2(s: String = "") {}
}
@@ -10,5 +10,5 @@ interface B {
var prop2: String
<!WRONG_ANNOTATION_TARGET!>@<!DEPRECATION!>JvmDefault<!><!> get() = ""
<!WRONG_ANNOTATION_TARGET!>@<!DEPRECATION!>JvmDefault<!><!> set(<!UNUSED_PARAMETER!>value<!>) {}
<!WRONG_ANNOTATION_TARGET!>@<!DEPRECATION!>JvmDefault<!><!> set(value) {}
}
@@ -25,5 +25,5 @@ interface B {
<!JVM_DEFAULT_IN_JVM6_TARGET!>@<!DEPRECATION!>JvmDefault<!><!>
var prop4: String
get() = ""
set(<!UNUSED_PARAMETER!>value<!>) {}
set(value) {}
}
@@ -26,5 +26,5 @@ interface B {
@<!DEPRECATION!>JvmDefault<!>
var prop4: String
get() = ""
set(<!UNUSED_PARAMETER!>value<!>) {}
set(value) {}
}
@@ -16,8 +16,8 @@ fun foo() {
}
}
val <!UNUSED_VARIABLE!>x<!> = object {
val x = object {
<!OVERLOADS_LOCAL!>@kotlin.jvm.JvmOverloads<!> fun foo(s: String = "OK") {
}
}
}
}
@@ -8,7 +8,7 @@ open class B {
class A {
companion object : B() {
var p1:Int = 1
@JvmStatic set(<!UNUSED_PARAMETER!>p<!>: Int) {
@JvmStatic set(p: Int) {
p1 = 1
}
@@ -22,7 +22,7 @@ class A {
object A : B() {
var p:Int = 1
@JvmStatic set(<!UNUSED_PARAMETER!>p1<!>: Int) {
@JvmStatic set(p1: Int) {
p = 1
}
@@ -37,9 +37,9 @@ class A {
}
var p:Int = 1
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION!>@JvmStatic set(<!UNUSED_PARAMETER!>p1<!>: Int)<!> {
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION!>@JvmStatic set(p1: Int)<!> {
p = 1
}
<!JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION!>@JvmStatic val z2<!> = 1;
}
}
@@ -8,7 +8,7 @@ open class B {
class A {
companion object : B() {
var p1:Int = 1
@JvmStatic set(<!UNUSED_PARAMETER!>p<!>: Int) {
@JvmStatic set(p: Int) {
p1 = 1
}
@@ -22,7 +22,7 @@ class A {
object A : B() {
var p:Int = 1
@JvmStatic set(<!UNUSED_PARAMETER!>p1<!>: Int) {
@JvmStatic set(p1: Int) {
p = 1
}
@@ -37,9 +37,9 @@ class A {
}
var p:Int = 1
<!JVM_STATIC_NOT_IN_OBJECT_OR_COMPANION!>@JvmStatic set(<!UNUSED_PARAMETER!>p1<!>: Int)<!> {
<!JVM_STATIC_NOT_IN_OBJECT_OR_COMPANION!>@JvmStatic set(p1: Int)<!> {
p = 1
}
<!JVM_STATIC_NOT_IN_OBJECT_OR_COMPANION!>@JvmStatic val z2<!> = 1;
}
}
@@ -1,20 +0,0 @@
// !LANGUAGE: +AllowContractsForCustomFunctions +UseCallsInPlaceEffect
// !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts
// !DIAGNOSTICS: -INVISIBLE_REFERENCE -INVISIBLE_MEMBER
import kotlin.contracts.*
fun <T> myRun(block: () -> T): T {
contract {
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
}
return block()
}
fun functionWithSideEffects(x: Int): Int = x + 1 // ...and some other useful side-effects
fun log(s: String) = Unit // some logging or println or whatever returning Unit
fun implicitCastWithIf(s: String) {
myRun { if (s == "") functionWithSideEffects(42) else log(s) }
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !LANGUAGE: +AllowContractsForCustomFunctions +UseCallsInPlaceEffect
// !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts
// !DIAGNOSTICS: -INVISIBLE_REFERENCE -INVISIBLE_MEMBER
@@ -13,8 +14,8 @@ fun <T> myRun(block: () -> T): T {
fun functionWithSideEffects(x: Int): Int = x + 1 // ...and some other useful side-effects
fun log(<!UNUSED_PARAMETER!>s<!>: String) = Unit // some logging or println or whatever returning Unit
fun log(s: String) = Unit // some logging or println or whatever returning Unit
fun implicitCastWithIf(s: String) {
myRun { if (s == "") functionWithSideEffects(42) else log(s) }
}
}
@@ -12,6 +12,6 @@ inline fun <T> myRun(block: () -> T): T {
}
fun throwInLambda(): Int {
<!UNREACHABLE_CODE!>val <!UNUSED_VARIABLE!>x<!> =<!> myRun { throw java.lang.IllegalArgumentException(); <!UNREACHABLE_CODE!>42<!> }
<!UNREACHABLE_CODE!>val x =<!> myRun { throw java.lang.IllegalArgumentException(); <!UNREACHABLE_CODE!>42<!> }
<!UNREACHABLE_CODE!>return x<!>
}
}
@@ -1,9 +0,0 @@
// !ALLOW_RESULT_RETURN_TYPE
// !LANGUAGE: -AllowNullOperatorsForResult
fun result(): Result<Int> = TODO()
val resultP: Result<Int> = result()
fun f(r1: Result<Int>?) {
r1 ?: 0
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !ALLOW_RESULT_RETURN_TYPE
// !LANGUAGE: -AllowNullOperatorsForResult
@@ -5,5 +6,5 @@ fun result(): Result<Int> = TODO()
val resultP: Result<Int> = result()
fun f(r1: Result<Int>?) {
r1 ?: <!UNUSED_EXPRESSION!>0<!>
}
r1 ?: 0
}
@@ -5,7 +5,7 @@ class Impl : Inv
class Scope<InterfaceT, ImplementationT : InterfaceT>(private val implClass: <!UNRESOLVED_REFERENCE!>j<!>.<!DEBUG_INFO_MISSING_UNRESOLVED!>Class<!><ImplementationT>) {
fun foo(c: Collection<InterfaceT>) {
val <!UNUSED_VARIABLE!>hm<!> = c.asSequence()
val hm = c.asSequence()
.filter(<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>implClass<!>::<!CALLABLE_REFERENCE_RESOLUTION_AMBIGUITY!>isInstance<!>)
.<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>map<!>(<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>implClass<!>::<!CALLABLE_REFERENCE_RESOLUTION_AMBIGUITY!>cast<!>)
.<!DEBUG_INFO_MISSING_UNRESOLVED!>toSet<!>()
@@ -10,25 +10,25 @@ class Controller<T> {
fun <S> generate(g: suspend Controller<S>.() -> Unit): S = TODO()
val test1 = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER{NI}, TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER{OI}!>generate<!> {
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NI;NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER{OI}!>apply<!> {
<!DEBUG_INFO_MISSING_UNRESOLVED, NI;DEBUG_INFO_MISSING_UNRESOLVED{OI}!>yield<!>(4)
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER{NI}!>apply<!> {
<!DEBUG_INFO_MISSING_UNRESOLVED{NI}!>yield<!>(4)
}
}
val test2 = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER{NI}, TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER{OI}!>generate<!> {
yield(B)
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NI;NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER{OI}!>apply<!> {
<!DEBUG_INFO_MISSING_UNRESOLVED, NI;DEBUG_INFO_MISSING_UNRESOLVED{OI}!>yield<!>(<!DEBUG_INFO_MISSING_UNRESOLVED, NI;DEBUG_INFO_MISSING_UNRESOLVED{OI}!>C<!>)
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER{NI}!>apply<!> {
<!DEBUG_INFO_MISSING_UNRESOLVED{NI}!>yield<!>(<!DEBUG_INFO_MISSING_UNRESOLVED{NI}!>C<!>)
}
}
val test3 = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NI;NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER{OI}, OI;TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER{OI}!>generate<!> {
this.<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, OI;TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER{OI}!>let<!> {
val test3 = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER{NI}, TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER{OI}!>generate<!> {
this.<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER{NI}, TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER{OI}!>let<!> {
yield(B)
}
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NI;NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER{OI}!>apply<!> {
<!DEBUG_INFO_MISSING_UNRESOLVED, NI;DEBUG_INFO_MISSING_UNRESOLVED{OI}!>yield<!>(<!DEBUG_INFO_MISSING_UNRESOLVED, NI;DEBUG_INFO_MISSING_UNRESOLVED{OI}!>C<!>)
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER{NI}!>apply<!> {
<!DEBUG_INFO_MISSING_UNRESOLVED{NI}!>yield<!>(<!DEBUG_INFO_MISSING_UNRESOLVED{NI}!>C<!>)
}
}
@@ -4,7 +4,7 @@ class StateMachine<Q> internal constructor() {
fun getInputStub(): Q = null <!UNCHECKED_CAST!>as Q<!>
}
fun <T> stateMachine(<!UNUSED_PARAMETER!>block<!>: suspend StateMachine<T>.() -> Unit): StateMachine<T> {
fun <T> stateMachine(block: suspend StateMachine<T>.() -> Unit): StateMachine<T> {
return StateMachine<T>()
}
@@ -16,7 +16,7 @@ fun <S> generate(@BuilderInference g: suspend GenericController<S>.() -> Unit):
@BuilderInference
suspend fun <S> GenericController<List<S>>.yieldGenerate(g: suspend GenericController<S>.() -> Unit): Unit = TODO()
val test1 = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NI;NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER{OI}!>generate<!> {
val test1 = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER{NI}!>generate<!> {
// TODO: KT-15185
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER{NI}, TYPE_INFERENCE_PARAMETER_CONSTRAINT_ERROR{OI}, TYPE_MISMATCH{OI}!>yieldGenerate<!> {
yield(4)
@@ -8,7 +8,7 @@ interface Job : CoroutineContext.Element {}
interface Deferred<out T> : Job {
suspend fun await(): T
}
fun <T> async(<!UNUSED_PARAMETER!>block<!>: suspend () -> T): Deferred<T> = TODO()
fun <T> async(block: suspend () -> T): Deferred<T> = TODO()
suspend fun fib(n: Long) =
async {
@@ -29,22 +29,22 @@ fun foo() {
i = genericBuilder { 1 }
genericBuilder { 1 }
genericBuilder<Int> { 1 }
genericBuilder<Int> { <!TYPE_MISMATCH{NI}, TYPE_MISMATCH!>""<!> }
genericBuilder<Int> { <!TYPE_MISMATCH, TYPE_MISMATCH!>""<!> }
val y = { 1 }
<!TYPE_INFERENCE_PARAMETER_CONSTRAINT_ERROR{OI}!>genericBuilder<!>(<!TYPE_MISMATCH{OI}, UNSUPPORTED_FEATURE{NI}!>y<!>)
unitBuilder {}
unitBuilder { <!UNUSED_EXPRESSION!>1<!> }
unitBuilder { 1 }
unitBuilder({})
unitBuilder({ <!UNUSED_EXPRESSION!>1<!> })
unitBuilder({ 1 })
manyArgumentsBuilder({}, { "" }) { 1 }
val s: String = manyArgumentsBuilder({}, { "" }) { 1 }
manyArgumentsBuilder<String>({}, { "" }, { 1 })
manyArgumentsBuilder<String>({}, { <!CONSTANT_EXPECTED_TYPE_MISMATCH, CONSTANT_EXPECTED_TYPE_MISMATCH{NI}!>1<!> }, { 2 })
manyArgumentsBuilder<String>({}, { <!CONSTANT_EXPECTED_TYPE_MISMATCH, CONSTANT_EXPECTED_TYPE_MISMATCH!>1<!> }, { 2 })
severalParamsInLambda { <!NAME_SHADOWING!>x<!>, <!NAME_SHADOWING!>y<!> ->
x checkType { _<String>() }
@@ -34,7 +34,7 @@ fun bar() {
println()
}
val <!UNUSED_VARIABLE!>w<!>: (suspend () -> Int) -> Any? = ::suspend
val w: (suspend () -> Int) -> Any? = ::suspend
A().<!MODIFIER_FORM_FOR_NON_BUILT_IN_SUSPEND!>suspend<!> {
println()
@@ -36,7 +36,7 @@ fun bar() {
suspend<Nothing?>(null)
val <!UNUSED_VARIABLE!>w<!>: (Any?) -> Any? = ::suspend
val w: (Any?) -> Any? = ::suspend
A().<!MODIFIER_FORM_FOR_NON_BUILT_IN_SUSPEND!>suspend<!> {
println()
@@ -1,7 +1,7 @@
// FILE: 1.kt
fun test(<!UNUSED_PARAMETER!>c<!>: <!UNRESOLVED_REFERENCE!>Continuation<!><Unit>) {}
fun test(c: <!UNRESOLVED_REFERENCE!>Continuation<!><Unit>) {}
// FILE: 2.kt
import kotlin.coroutines.*
fun test2(<!UNUSED_PARAMETER!>c<!>: Continuation<Unit>) {}
fun test2(c: Continuation<Unit>) {}
@@ -28,7 +28,7 @@ fun bar() {
println()
}
val <!UNUSED_VARIABLE!>w<!>: (suspend () -> Int) -> Any? = ::<!NON_MODIFIER_FORM_FOR_BUILT_IN_SUSPEND!>suspend<!>
val w: (suspend () -> Int) -> Any? = ::<!NON_MODIFIER_FORM_FOR_BUILT_IN_SUSPEND!>suspend<!>
}
@Target(AnnotationTarget.EXPRESSION)
@@ -41,5 +41,5 @@ fun main(suspend: WLambdaInvoke) {
}
class WLambdaInvoke {
operator fun invoke(<!UNUSED_PARAMETER!>l<!>: () -> Unit) {}
operator fun invoke(l: () -> Unit) {}
}
@@ -26,5 +26,5 @@ fun bar() {
println()
}
val <!UNUSED_VARIABLE!>w<!>: (suspend () -> Int) -> Any? = ::<!NON_MODIFIER_FORM_FOR_BUILT_IN_SUSPEND!>suspendLambda<!>
val w: (suspend () -> Int) -> Any? = ::<!NON_MODIFIER_FORM_FOR_BUILT_IN_SUSPEND!>suspendLambda<!>
}
@@ -20,9 +20,9 @@ suspend fun RestrictedController.ext() {
memberExt()
}
fun generate(<!UNUSED_PARAMETER!>c<!>: suspend RestrictedController.() -> Unit) {}
fun generate(c: suspend RestrictedController.() -> Unit) {}
fun runBlocking(<!UNUSED_PARAMETER!>x<!>: suspend () -> Unit) {}
fun runBlocking(x: suspend () -> Unit) {}
fun test() {
generate a@{
@@ -8,7 +8,7 @@ import kotlin.experimental.ExperimentalTypeInference
@kotlin.coroutines.RestrictsSuspension
class RestrictedController<T> {
suspend fun yield(<!UNUSED_PARAMETER!>x<!>: T) {}
suspend fun yield(x: T) {}
suspend fun anotherYield(x: T) {
yield(x)
@@ -27,10 +27,10 @@ class RestrictedController<T> {
}
}
fun <T> buildSequence(@BuilderInference <!UNUSED_PARAMETER!>c<!>: suspend RestrictedController<T>.() -> Unit) {}
fun <T> buildSequence(@BuilderInference c: suspend RestrictedController<T>.() -> Unit) {}
@BuilderInference
suspend fun <T> RestrictedController<T>.yield2(<!UNUSED_PARAMETER!>x<!>: T) {}
suspend fun <T> RestrictedController<T>.yield2(x: T) {}
fun test() {
buildSequence<Int> a@{
@@ -4,7 +4,7 @@ class RestrictedController
suspend fun Any?.extFun() {}
suspend fun suspendFun() {}
fun generate(<!UNUSED_PARAMETER!>c<!>: suspend RestrictedController.() -> Unit) {}
fun generate(c: suspend RestrictedController.() -> Unit) {}
fun test() {
generate {
@@ -4,9 +4,9 @@ class RestrictedController {
suspend fun yield() {}
}
fun generate(<!UNUSED_PARAMETER!>c<!>: suspend RestrictedController.() -> Unit) {}
fun generate(c: suspend RestrictedController.() -> Unit) {}
fun runBlocking(<!UNUSED_PARAMETER!>x<!>: suspend () -> Unit) {}
fun runBlocking(x: suspend () -> Unit) {}
fun test() {
generate {
@@ -18,7 +18,7 @@ fun bar() {
return@suspend
}
val <!UNUSED_VARIABLE!>x<!> = suspend@{
val x = suspend@{
suspend {
// Might be resolved to outer lambda, but doesn't make sense because suspend-lambdas here is noinline
<!RETURN_FOR_BUILT_IN_SUSPEND!>return<!LABEL_NAME_CLASH!>@suspend<!><!>
@@ -25,7 +25,7 @@ class K3 : JavaClass() {
<!NOTHING_TO_OVERRIDE!>override<!> fun foo(x: Int, y: Continuation<String>): Any? = null
}
fun builder(<!UNUSED_PARAMETER!>block<!>: suspend () -> Unit) {}
fun builder(block: suspend () -> Unit) {}
fun main(x: Continuation<String>) {
JavaClass().<!ILLEGAL_SUSPEND_FUNCTION_CALL!>foo<!>(5, <!TOO_MANY_ARGUMENTS!>x<!>)
@@ -1,13 +0,0 @@
// SKIP_TXT
class A {
suspend operator fun component1(): String = "K"
}
fun foo(c: suspend (A) -> Unit) {}
fun bar() {
foo {
(x) ->
x.length
}
}
@@ -1,9 +1,10 @@
// FIR_IDENTICAL
// SKIP_TXT
class A {
suspend operator fun component1(): String = "K"
}
fun foo(<!UNUSED_PARAMETER!>c<!>: suspend (A) -> Unit) {}
fun foo(c: suspend (A) -> Unit) {}
fun bar() {
foo {
@@ -37,7 +37,7 @@ fun test() {
severalParams("", 89) checkType { _<Double>() }
// TODO: should we allow somehow to call with passing continuation explicitly?
severalParams("", 89, <!TOO_MANY_ARGUMENTS!>6.9<!>) checkType { <!DEBUG_INFO_UNRESOLVED_WITH_TARGET{OI}, UNRESOLVED_REFERENCE_WRONG_RECEIVER{NI}!>_<!><Unit>() }
severalParams("", 89, <!TOO_MANY_ARGUMENTS!>this <!CAST_NEVER_SUCCEEDS!>as<!> Continuation<Double><!>) checkType { <!DEBUG_INFO_UNRESOLVED_WITH_TARGET{OI}, UNRESOLVED_REFERENCE_WRONG_RECEIVER{NI}!>_<!><Unit>() }
severalParams("", 89, <!TOO_MANY_ARGUMENTS!>6.9<!>) checkType { <!TYPE_MISMATCH{OI}, UNRESOLVED_REFERENCE_WRONG_RECEIVER{NI}!>_<!><Unit>() }
severalParams("", 89, <!TOO_MANY_ARGUMENTS!>this <!CAST_NEVER_SUCCEEDS!>as<!> Continuation<Double><!>) checkType { <!TYPE_MISMATCH{OI}, UNRESOLVED_REFERENCE_WRONG_RECEIVER{NI}!>_<!><Unit>() }
}
}
@@ -28,7 +28,7 @@ class K3 : JavaClass() {
<!NOTHING_TO_OVERRIDE!>override<!> fun foo(x: Int, y: Continuation<String>): Any? = null
}
fun builder(<!UNUSED_PARAMETER!>block<!>: suspend () -> Unit) {}
fun builder(block: suspend () -> Unit) {}
fun main(x: Continuation<String>) {
JavaClass().<!ILLEGAL_SUSPEND_FUNCTION_CALL!>foo<!>(5, <!TOO_MANY_ARGUMENTS!>x<!>)
@@ -25,7 +25,7 @@ class K3 : JavaClass() {
<!NOTHING_TO_OVERRIDE!>override<!> fun foo(x: Int, y: Continuation<String>): Any? = null
}
fun builder(<!UNUSED_PARAMETER!>block<!>: suspend () -> Unit) {}
fun builder(block: suspend () -> Unit) {}
fun main(x: Continuation<String>) {
JavaClass().<!ILLEGAL_SUSPEND_FUNCTION_CALL!>foo<!>(5, <!TOO_MANY_ARGUMENTS!>x<!>)
@@ -33,8 +33,8 @@ private val STRING = CompileTimeType<String>()
private val ANY = CompileTimeType<Any>()
private val emptyBinaryFun: Function2<BigInteger, BigInteger, BigInteger> = { <!UNUSED_ANONYMOUS_PARAMETER!>a<!>, <!UNUSED_ANONYMOUS_PARAMETER!>b<!> -> BigInteger("0") }
private val emptyUnaryFun: Function1<Long, Long> = { <!UNUSED_ANONYMOUS_PARAMETER!>a<!> -> 1.toLong() }
private val emptyBinaryFun: Function2<BigInteger, BigInteger, BigInteger> = { a, b -> BigInteger("0") }
private val emptyUnaryFun: Function1<Long, Long> = { a -> 1.toLong() }
private val unaryOperations: HashMap<UnaryOperationKey<*>, Pair<Function1<Any?, Any>, Function1<Long, Long>>>
= hashMapOf<UnaryOperationKey<*>, Pair<Function1<Any?, Any>, Function1<Long, Long>>>(
@@ -7,7 +7,7 @@ class Foo {
fun Foo.test() {}
class Bar
class Scope {
operator fun Bar.invoke(<!UNUSED_PARAMETER!>f<!>: () -> Unit) {}
operator fun Bar.invoke(f: () -> Unit) {}
}
fun Scope.bar(e: Foo) {
@@ -8,5 +8,5 @@ fun test1(l: List<Number>) {
val i: Int = l.firstTyped()
val s: String = <!TYPE_MISMATCH!>l.<!TYPE_INFERENCE_EXPECTED_TYPE_MISMATCH{OI}!><!TYPE_MISMATCH!>firstTyped<!>()<!><!>
val s: String = <!TYPE_MISMATCH{NI}!>l.<!TYPE_INFERENCE_EXPECTED_TYPE_MISMATCH{OI}!><!TYPE_MISMATCH{NI}!>firstTyped<!>()<!><!>
}
@@ -2,7 +2,7 @@
internal class Z<K> {
val map = HashMap<String, String>()
inline fun compute(key: String, <!UNUSED_PARAMETER!>producer<!>: () -> String): String {
inline fun compute(key: String, producer: () -> String): String {
return map.getOrPut(key, ::<!UNSUPPORTED, USAGE_IS_NOT_INLINABLE!>producer<!>)
}
}
@@ -1,12 +0,0 @@
// FULL_JDK
import java.util.*
fun foo(o: Optional<String>) {}
class Test(nullable: String?) {
private val nullableOptional = Optional.ofNullable(nullable)
fun doIt() {
foo(nullableOptional)
}
}
@@ -1,12 +1,13 @@
// FIR_IDENTICAL
// FULL_JDK
import java.util.*
fun foo(<!UNUSED_PARAMETER!>o<!>: Optional<String>) {}
fun foo(o: Optional<String>) {}
class Test(nullable: String?) {
private val nullableOptional = Optional.ofNullable(nullable)
fun doIt() {
foo(nullableOptional)
}
}
}
@@ -10,6 +10,6 @@ fun main2() = if (true) <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>Foo::<!CAL
fun main3() = if (true) { Foo::<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>minus<!> } else { Foo::<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>times<!> }
fun main4() = try { Foo::<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>minus<!> } finally { <!UNUSED_EXPRESSION!>Foo::<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>times<!><!> }
fun main4() = try { Foo::<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>minus<!> } finally { Foo::<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>times<!> }
fun main5() = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>Foo::<!CALLABLE_REFERENCE_RESOLUTION_AMBIGUITY!>minus<!><!> ?: <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>Foo::<!CALLABLE_REFERENCE_RESOLUTION_AMBIGUITY!>times<!><!>
@@ -3,7 +3,7 @@
// FULL_JDK
class A : java.util.concurrent.ConcurrentHashMap<String, Int>() {
operator fun contains(<!UNUSED_PARAMETER!>x<!>: Char): Boolean = true
operator fun contains(x: Char): Boolean = true
}
class B : java.util.concurrent.ConcurrentHashMap<String, Int>() {
override fun contains(value: Any?): Boolean {
@@ -77,4 +77,3 @@ fun main() {
1 <!TYPE_INFERENCE_CONFLICTING_SUBSTITUTIONS{OI}, TYPE_INFERENCE_ONLY_INPUT_TYPES{NI}!>in<!> (c as Map<String, Int>)
1 <!TYPE_INFERENCE_CONFLICTING_SUBSTITUTIONS{OI}, TYPE_INFERENCE_ONLY_INPUT_TYPES{NI}!>!in<!> (c as Map<String, Int>)
}
@@ -3,7 +3,7 @@
// FULL_JDK
class A : java.util.concurrent.ConcurrentHashMap<String, Int>() {
operator fun contains(<!UNUSED_PARAMETER!>x<!>: Char): Boolean = true
operator fun contains(x: Char): Boolean = true
}
class B : java.util.concurrent.ConcurrentHashMap<String, Int>() {
override fun contains(value: Any?): Boolean {
@@ -77,4 +77,3 @@ fun main() {
1 <!TYPE_INFERENCE_CONFLICTING_SUBSTITUTIONS{OI}, TYPE_INFERENCE_ONLY_INPUT_TYPES{NI}!>in<!> (c as Map<String, Int>)
1 <!TYPE_INFERENCE_CONFLICTING_SUBSTITUTIONS{OI}, TYPE_INFERENCE_ONLY_INPUT_TYPES{NI}!>!in<!> (c as Map<String, Int>)
}
@@ -63,8 +63,8 @@ public interface Other {
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public/*package*/ open class Properties {
public/*package*/ constructor Properties()
public open class Properties {
public constructor Properties()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
@@ -73,6 +73,15 @@ public/*package*/ open class Properties {
public/*package*/ open fun </*0*/ T : kotlin.Any!> calcVal(/*0*/ initializer: (() -> T!)!): Val<T!>!
}
public open class Val</*0*/ T : kotlin.Any!> {
public/*package*/ constructor Val</*0*/ T : kotlin.Any!>(/*0*/ initializer: (() -> T!)!)
public/*package*/ final var initializer: (() -> T!)!
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public/*package*/ open operator fun getValue(/*0*/ instance: kotlin.Any!, /*1*/ metadata: kotlin.Any!): T!
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public open class Wrapper</*0*/ out T : Base> {
public constructor Wrapper</*0*/ out T : Base>(/*0*/ v: T)
public final val v: T
+2 -2
View File
@@ -1,6 +1,6 @@
private class X
private operator fun X?.plus(<!UNUSED_PARAMETER!>p<!>: Int) = X()
private operator fun X?.plus(p: Int) = X()
class C {
private val map = hashMapOf<String, X>()
@@ -8,4 +8,4 @@ class C {
fun f() {
map<!NO_SET_METHOD!>[""]<!> += 1
}
}
}
@@ -4,7 +4,7 @@ class A {
<!WRONG_MODIFIER_TARGET!>external<!> constructor() {}
}
<!WRONG_MODIFIER_TARGET!>external<!> constructor(<!UNUSED_PARAMETER!>x<!>: Int)
<!WRONG_MODIFIER_TARGET!>external<!> constructor(x: Int)
}
class C <!WRONG_MODIFIER_TARGET!>external<!> constructor()
class C <!WRONG_MODIFIER_TARGET!>external<!> constructor()
@@ -4,7 +4,7 @@ class O : Function2<Int, String, Unit> {
}
fun test() {
val a = fun(<!UNUSED_ANONYMOUS_PARAMETER!>o<!>: O) {
val a = fun(o: O) {
}
a <!TYPE_MISMATCH!>{}<!>
}
@@ -13,5 +13,5 @@ fun test() {
}
fun test2() {
val <!UNUSED_VARIABLE!>f<!>: Ext = <!TYPE_MISMATCH!>{}<!>
val f: Ext = <!TYPE_MISMATCH!>{}<!>
}
@@ -1,10 +1,10 @@
fun foo(c : Collection<String>) = {
c.filter{
val s : String? = bar()
if (s == null) <!UNUSED_EXPRESSION!>false<!> // here!
if (s == null) false // here!
zoo(<!TYPE_MISMATCH!>s<!>)
}
}
fun bar() : String? = null
fun zoo(<!UNUSED_PARAMETER!>s<!> : String) : Boolean = true
fun zoo(s : String) : Boolean = true
@@ -2,8 +2,8 @@ class Inv<T>
inline operator fun <reified T> Inv<T>.invoke() {}
operator fun <K> Inv<K>.get(<!UNUSED_PARAMETER!>i<!>: Int): Inv<K> = this
operator fun <K> Inv<K>.get(i: Int): Inv<K> = this
fun <K> test(a: Inv<K>) {
<!TYPE_PARAMETER_AS_REIFIED!>a[1]()<!>
}
}
@@ -4,7 +4,7 @@
fun indexOfMax(a: IntArray): Int? {
var maxI: Int? = null
a.forEachIndexed { i, value ->
if (maxI == null || value >= a[<!SMARTCAST_IMPOSSIBLE{NI}, SMARTCAST_IMPOSSIBLE!>maxI<!>]) {
if (maxI == null || value >= a[<!SMARTCAST_IMPOSSIBLE, SMARTCAST_IMPOSSIBLE!>maxI<!>]) {
maxI = i
}
}
@@ -39,13 +39,13 @@ fun test4() {
null
}
finally {
<!UNUSED_EXPRESSION!>""<!>
""
}
s<!UNSAFE_CALL!>.<!>length
}
fun test5() {
<!UNREACHABLE_CODE!>val <!UNUSED_VARIABLE!>s<!>: String? =<!> try {
<!UNREACHABLE_CODE!>val s: String? =<!> try {
""
}
catch (e: ExcA) {
@@ -105,7 +105,7 @@ fun test10() {
val x = try {
""
} finally {
<!UNUSED_EXPRESSION!>42<!>
42
}
x.length
}
@@ -8,7 +8,7 @@ class MyException : Exception() {
}
fun test1() {
val <!UNUSED_VARIABLE!>e<!> = "something"
val e = "something"
try {}
catch (e: Exception) {
e.message
@@ -35,15 +35,15 @@ fun test3() {
fun test4() {
try {}
catch (e: Exception) {
val <!REDECLARATION, UNUSED_VARIABLE!>a<!> = 42
val <!NAME_SHADOWING, REDECLARATION, UNUSED_VARIABLE!>a<!> = "foo"
val <!REDECLARATION!>a<!> = 42
val <!NAME_SHADOWING, REDECLARATION!>a<!> = "foo"
}
}
fun test5() {
try {}
catch (e: Exception) {
val <!UNUSED_VARIABLE!>a<!>: Int = 42
val a: Int = 42
try {}
catch (e: MyException) {
e.myFun()
@@ -51,4 +51,4 @@ fun test5() {
a.length
}
}
}
}
@@ -9,7 +9,7 @@ fun test0(): List<Int> = run {
try {
emptyList()
} finally {
<!UNUSED_EXPRESSION!>""<!>
""
fun foo() {}
}
}
@@ -22,7 +22,7 @@ fun test1(): Map<Int, Int> = run {
} catch (e: ExcB) {
e.map
} finally {
<!UNUSED_EXPRESSION!>""<!>
""
}
}