Files
codeql/java/ql/test/kotlin/library-tests/java-map-methods/test.kt
Chris Smowton ce87a89009 Replace Map and similar functions with their Java cousins
This didn't appear to be necessary because the Kotlin and Java versions of Map (for example) are designed to be compatible, but in certain cases their functions have the same erasure but not the same type (e.g. Map.getOrDefault(K, V) vs. Map.getOrDefault(Object, V).

These have different erasures which was leading to callable-binding inconsistencies.
2022-05-12 22:36:28 +01:00

2 lines
50 B
Kotlin

fun test(m: Map<Int, Int>) = m.getOrDefault(1, 2)