Report warning on unused entities that can be renamed to _
Currently it's all about lambda parameters/destructuring entries #KT-14347 In Progress
This commit is contained in:
+2
-1
@@ -1,3 +1,4 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
class My {
|
||||
@@ -6,4 +7,4 @@ class My {
|
||||
// Both Ok
|
||||
@get:JvmSynthetic val t: String by lazy { "t" }
|
||||
@set:JvmSynthetic var z: String by Delegates.observable("?") { prop, old, new -> old.hashCode() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
import kotlin.jvm.Volatile
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
@@ -9,4 +10,4 @@ class My {
|
||||
<!VOLATILE_ON_DELEGATE!>@delegate:Volatile<!> var z: String by Delegates.observable("?") { prop, old, new -> old.hashCode() }
|
||||
|
||||
<!VOLATILE_ON_VALUE!>@field:Volatile<!> val w = 2
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -33,8 +33,8 @@ private val STRING = CompileTimeType<String>()
|
||||
private val ANY = CompileTimeType<Any>()
|
||||
|
||||
|
||||
private val emptyBinaryFun: Function2<BigInteger, BigInteger, BigInteger> = { a, b -> BigInteger("0") }
|
||||
private val emptyUnaryFun: Function1<Long, Long> = { a -> 1.toLong() }
|
||||
private val emptyBinaryFun: Function2<BigInteger, BigInteger, BigInteger> = { <!UNUSED_PARAMETER!>a<!>, <!UNUSED_PARAMETER!>b<!> -> BigInteger("0") }
|
||||
private val emptyUnaryFun: Function1<Long, Long> = { <!UNUSED_PARAMETER!>a<!> -> 1.toLong() }
|
||||
|
||||
private val unaryOperations: HashMap<UnaryOperationKey<*>, Pair<Function1<Any?, Any>, Function1<Long, Long>>>
|
||||
= hashMapOf<UnaryOperationKey<*>, Pair<Function1<Any?, Any>, Function1<Long, Long>>>(
|
||||
@@ -368,4 +368,4 @@ class BigInteger(val value: String) {
|
||||
fun or(o: BigInteger): BigInteger = o
|
||||
fun and(o: BigInteger): BigInteger = o
|
||||
fun xor(o: BigInteger): BigInteger = o
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user