Files
kotlin-fork/compiler/testData/diagnostics/testsWithStdLib/commonCollections.kt
T
Dmitriy Novozhilov 1b27d60307 [FIR] Support @OnlyInputTypes annotation
^KT-54807 Fixed
2022-11-22 15:46:17 +00:00

30 lines
586 B
Kotlin
Vendored

// FIR_IDENTICAL
import java.util.*
fun foo() {
val al = ArrayList<String>()
al.size
al.<!TYPE_INFERENCE_ONLY_INPUT_TYPES_ERROR!>contains<!>(1)
al.contains("")
al.remove("")
al.removeAt(1)
val hs = HashSet<String>()
hs.size
hs.<!TYPE_INFERENCE_ONLY_INPUT_TYPES_ERROR!>contains<!>(1)
hs.contains("")
hs.remove("")
val hm = HashMap<String, Int>()
hm.size
hm.<!TYPE_INFERENCE_ONLY_INPUT_TYPES_ERROR!>containsKey<!>(1)
hm.containsKey("")
<!TYPE_INFERENCE_ONLY_INPUT_TYPES_ERROR!>hm[1]<!>
hm[""]
hm.remove("")
}