Don't mark parameters of get/set/propertyDelegated functions as unused.

#KT-5974 fixed
This commit is contained in:
Evgeny Gerashchenko
2015-02-18 15:31:55 +03:00
parent dbe9a70fbd
commit 056daeaadb
16 changed files with 52 additions and 29 deletions
@@ -1,4 +1,4 @@
fun set(<!UNUSED_PARAMETER!>key<!> : String, <!UNUSED_PARAMETER!>value<!> : String) {
fun set(key : String, value : String) {
val a : String? = ""
when (a) {
"" -> <!DEBUG_INFO_SMARTCAST!>a<!>.get(0)
@@ -35,13 +35,13 @@ fun main(args: Array<String>) {
}
class MyArray() {
fun get(<!UNUSED_PARAMETER!>i<!>: Int): Int = 1
fun set(<!UNUSED_PARAMETER!>i<!>: Int, <!UNUSED_PARAMETER!>value<!>: Int): Int = 1
fun get(i: Int): Int = 1
fun set(i: Int, value: Int): Int = 1
}
class MyArray1() {
fun get(<!UNUSED_PARAMETER!>i<!>: Int): Int = 1
fun set(<!UNUSED_PARAMETER!>i<!>: Int, <!UNUSED_PARAMETER!>value<!>: Int) {}
fun get(i: Int): Int = 1
fun set(i: Int, value: Int) {}
}
class MyNumber() {
@@ -7,4 +7,4 @@ fun test() {
attributes["href"] = "1" // inference fails, but it shouldn't
}
fun <K, V> MutableMap<K, V>.set(<!UNUSED_PARAMETER!>key<!> : K, <!UNUSED_PARAMETER!>value<!> : V) {}//= this.put(key, value)
fun <K, V> MutableMap<K, V>.set(key : K, value : V) {}//= this.put(key, value)
@@ -5,4 +5,4 @@ fun test() {
attributes["href"] = "1" // inference fails, but it shouldn't
}
fun <K, V> Map<K, V>.set(<!UNUSED_PARAMETER!>key<!> : K, <!UNUSED_PARAMETER!>value<!> : V) {}//= this.put(key, value)
fun <K, V> Map<K, V>.set(key : K, value : V) {}//= this.put(key, value)