Report resolution ambiguity on '+=' by taking into account full resolution result including post type checking for '+'
^KT-45503 Fixed
This commit is contained in:
Vendored
+31
@@ -0,0 +1,31 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test1() {
|
||||
var list = ArrayList<Int>()
|
||||
<!ASSIGN_OPERATOR_AMBIGUITY!>list -= 2<!>
|
||||
}
|
||||
|
||||
fun test2() {
|
||||
var set = HashMap<Int, Int>()
|
||||
<!ASSIGN_OPERATOR_AMBIGUITY!>set += 2 to 2<!>
|
||||
}
|
||||
|
||||
fun test3() {
|
||||
var set = HashSet<Int>()
|
||||
<!ASSIGN_OPERATOR_AMBIGUITY!>set -= 2<!>
|
||||
}
|
||||
|
||||
fun test4() {
|
||||
var list = mutableListOf(1)
|
||||
<!ASSIGN_OPERATOR_AMBIGUITY!>list += 2<!>
|
||||
}
|
||||
|
||||
fun test5() {
|
||||
var map = mutableMapOf(1 to 1)
|
||||
<!ASSIGN_OPERATOR_AMBIGUITY!>map += 2 to 2<!>
|
||||
}
|
||||
|
||||
fun test6() {
|
||||
var set = mutableSetOf(1)
|
||||
<!ASSIGN_OPERATOR_AMBIGUITY!>set += 2<!>
|
||||
}
|
||||
Reference in New Issue
Block a user