Files
kotlin-fork/idea/testData/checker/ResolveToJava.fir.kt
T
Tianyu Geng f38c0cf348 FIR IDE: run FIR highlighting test on all test data
Similarly to FIR diagnostic tests. This commit enable all available test
data and check the reported error messages by FIR. This helps identify
some issues in formatting of FIR diagnostics.

The changes on the test file are mechanically generated. Failed tests
are disabled with `// IGNORE_FIR` and are re-enabled in the second
commit.
2021-03-29 12:45:27 +03:00

49 lines
1.3 KiB
Kotlin
Vendored

import java.*
import java.util.*
import utils.*
import java.io.PrintStream
import java.lang.Comparable as Com
fun <T> checkSubtype(t: T) = t
val l : MutableList<in Int> = ArrayList<Int>()
fun test(l : List<Int>) {
val x : <error descr="[UNRESOLVED_REFERENCE] Unresolved reference: java.List">java.List</error>
val y : List<Int>
val b : java.lang.Object
val a : java.util.List<Int>
val z : <error descr="[UNRESOLVED_REFERENCE] Unresolved reference: java.utils.List<R|kotlin/Int|>">java.utils.List<Int></error>
val f : java.io.File? = null
Collections.<error descr="[UNRESOLVED_REFERENCE] Unresolved reference: emptyList">emptyList</error>
Collections.<error descr="[UNRESOLVED_REFERENCE] Unresolved reference: emptyList">emptyList</error><Int>
Collections.emptyList<Int>()
Collections.emptyList()
checkSubtype<Set<Int>?>(Collections.singleton<Int>(1))
Collections.<error descr="[INAPPLICABLE_CANDIDATE] Inapplicable candidate(s): java/util/Collections.singleton">singleton</error><Int>(1.0)
List<Int>
val o = "sdf" as Object
try {
// ...
}
catch(e: Throwable) {
System.out.println(e.message)
}
PrintStream("sdf")
val c : Com<Int>? = null
checkSubtype<java.lang.Comparable<Int>?>(c)
// Collections.sort<Integer>(ArrayList<Integer>())
}