Add "map.get() with not-null assertion operator" inspection #KT-25171 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
c5c0cbccde
commit
d3908aeb2e
@@ -0,0 +1 @@
|
||||
org.jetbrains.kotlin.idea.inspections.MapGetWithNotNullAssertionOperatorInspection
|
||||
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(map: Map<Int, String>) {
|
||||
val s = map.get(1)!!<caret>
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(map: Map<Int, String>) {
|
||||
val s = map.getValue(1)<caret>
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
// PROBLEM: none
|
||||
// WITH_RUNTIME
|
||||
fun test(map: Map<Int, String>) {
|
||||
val s = map.getValue(1)!!<caret>
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(map: Map<Int, String>) {
|
||||
val s = map[1]<caret>!!
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(map: Map<Int, String>) {
|
||||
val s = map.getValue(1)<caret>
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
// PROBLEM: none
|
||||
// WITH_RUNTIME
|
||||
fun test(list: List<String>) {
|
||||
val s = list.get(1)!!<caret>
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// PROBLEM: none
|
||||
// WITH_RUNTIME
|
||||
fun test(map: Map<Int, String>) {
|
||||
val s = map.get(1)<caret>
|
||||
}
|
||||
Reference in New Issue
Block a user