cc244fad94
KT-1219 Incorrect 'unused value' error in closures
22 lines
492 B
Plaintext
22 lines
492 B
Plaintext
//KT-1191 Wrong detection of unused parameters
|
|
package kt1191
|
|
|
|
trait FunctionalList<T> {
|
|
val size: Int
|
|
val head: T
|
|
val tail: FunctionalList<T>
|
|
}
|
|
|
|
fun <erased T> FunctionalList<T>.plus(element: T) : FunctionalList<T> = object: FunctionalList<T> {
|
|
override val size: Int
|
|
get() = 1 + this@plus.size
|
|
override val tail: FunctionalList<T>
|
|
get() = this@plus
|
|
override val head: T
|
|
get() = element
|
|
}
|
|
|
|
fun foo(unused: Int) = object {
|
|
val a : Int get() = unused
|
|
}
|