[FIR-TEST] Move analysis tests to separate module

This commit is contained in:
Dmitriy Novozhilov
2020-03-18 15:10:46 +03:00
parent 3a479d5d16
commit cc07ae96b3
1477 changed files with 1001 additions and 980 deletions
@@ -0,0 +1,43 @@
// FULL_JDK
// FILE: MyMap.java
public abstract class MyMap implements java.util.Map<String, String> {}
// FILE: test.kt
fun test(map: MyMap) {
val result = map.getOrPut("key") { "value" } // Cannot be resolved without early J2K mapping
// In contrast, should be taken from JDK
val otherResult = map.getOrDefault("key", "value")
val anotherResult = map.replace("key", "value")
// Java forEach
map.forEach { key, value ->
println("$key: $value")
key.length
value.length
}
// Kotlin forEach
map.forEach { (key, value) ->
println("$key: $value")
key.length
value.length
}
}
fun test(map: MutableMap<String, String>) {
val result = map.getOrPut("key") { "value" } // Cannot be resolved without early J2K mapping
// In contrast, should be taken from JDK
val otherResult = map.getOrDefault("key", "value")
val anotherResult = map.replace("key", "value")
// Java forEach
map.forEach { key, value ->
println("$key: $value")
key.length
value.length
}
// Kotlin forEach
map.forEach { (key, value) ->
println("$key: $value")
key.length
value.length
}
}