Convert put to assignment: don't report when receiver object has custom 'set' method

#KT-33212 Fixed
This commit is contained in:
Toshiaki Kameyama
2019-12-09 12:26:02 +09:00
committed by Yan Zhulanow
parent 5abb6bc7a5
commit 653e20dcba
5 changed files with 54 additions and 12 deletions
@@ -0,0 +1,6 @@
import java.util.HashMap;
public class Foo extends HashMap<String, String> {
public void set(String x, String y) {
}
}
@@ -0,0 +1,5 @@
// PROBLEM: none
fun test() {
val foo = Foo()
foo.<caret>put("a", "b")
}
@@ -0,0 +1,11 @@
// PROBLEM: none
// WITH_RUNTIME
class Foo : HashMap<String, String>() {
operator fun set(x: String, y: String) {
println("wrong method")
}
}
fun main() {
Foo().<caret>put("x", "y")
}