Back to Intellij Community

MapGetWithNotNullAssertionOperator

plugins/kotlin/code-insight/descriptions/resources-en/inspectionDescriptions/MapGetWithNotNullAssertionOperator.html

2025.3-rc-2273 B
Original Source

Reports map.get()!! that can be replaced with map.getValue(), map.getOrElse(), and so on.

Example:

fun test(map: Map<Int, String>): String = map.get(0)!!

After the quick-fix is applied:

fun test(map: Map<Int, String>): String = map.getValue(0)