KT-66411 [AA] Add more tests for resolving compound set operators
This commit is contained in:
committed by
Space Team
parent
324d079111
commit
83a80a45a9
+8
@@ -0,0 +1,8 @@
|
||||
<caret> resolved to:
|
||||
0: (in kotlin.collections.MutableList) operator fun set(index: kotlin.Int, element: E): E
|
||||
|
||||
<caret_singleIfStatement> resolved to:
|
||||
0: (in kotlin.collections.MutableList) operator fun set(index: kotlin.Int, element: E): E
|
||||
|
||||
<caret_singleWhenStatement> resolved to:
|
||||
0: (in kotlin.collections.MutableList) operator fun set(index: kotlin.Int, element: E): E
|
||||
@@ -2,4 +2,8 @@
|
||||
fun a () {
|
||||
val list = mutableListOf(1)
|
||||
list<caret>[0] = 1
|
||||
|
||||
if (true) list<caret_singleIfStatement>[0] = 1
|
||||
|
||||
when { else -> list<caret_singleWhenStatement>[0] = 1 }
|
||||
}
|
||||
|
||||
@@ -1,2 +1,8 @@
|
||||
Resolved to:
|
||||
<caret> resolved to:
|
||||
0: (in kotlin.collections.MutableList) operator fun set(index: kotlin.Int, element: E): E
|
||||
|
||||
<caret_singleIfStatement> resolved to:
|
||||
Nothing (Unresolved reference)
|
||||
|
||||
<caret_singleWhenStatement> resolved to:
|
||||
Nothing (Unresolved reference)
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
// IGNORE_FE10
|
||||
|
||||
// MODULE: context
|
||||
|
||||
interface MyList {
|
||||
operator fun set(index: Int, value: String)
|
||||
}
|
||||
|
||||
// FILE: context.kt
|
||||
fun test(list: MyList) {
|
||||
<caret_context>Unit
|
||||
}
|
||||
|
||||
// MODULE: main
|
||||
// MODULE_KIND: CodeFragment
|
||||
// CONTEXT_MODULE: context
|
||||
|
||||
// FILE: fragment.kt
|
||||
// CODE_FRAGMENT_KIND: EXPRESSION
|
||||
list[10] <caret>= "value"
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
Resolved to:
|
||||
Nothing (Unresolved reference)
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
// IGNORE_FE10
|
||||
|
||||
// MODULE: context
|
||||
|
||||
interface MyList {
|
||||
operator fun get(index: Int): String
|
||||
operator fun set(index: Int, value: String)
|
||||
}
|
||||
|
||||
// FILE: context.kt
|
||||
fun test(list: MyList) {
|
||||
<caret_context>Unit
|
||||
}
|
||||
|
||||
// MODULE: main
|
||||
// MODULE_KIND: CodeFragment
|
||||
// CONTEXT_MODULE: context
|
||||
|
||||
// FILE: fragment.kt
|
||||
// CODE_FRAGMENT_KIND: EXPRESSION
|
||||
list[10] <caret>+= "value"
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
Resolved to:
|
||||
Nothing (Unresolved reference)
|
||||
Reference in New Issue
Block a user