Files
kotlin-fork/compiler/testData/ir/irText/firProblems/AllCandidates.kt
T
Ivan Kylchik c7435ba760 Replace all occurrences of WITH_RUNTIME with WITH_STDLIB
We are going to deprecate `WITH_RUNTIME` directive. The main reason
behind this change is that `WITH_STDLIB` directive better describes
its meaning, specifically it will add kotlin stdlib to test's classpath.
2021-11-17 15:26:38 +03:00

35 lines
964 B
Kotlin
Vendored

// TARGET_BACKEND: JVM
// WITH_STDLIB
// FULL_JDK
// FILE: OverloadResolutionResultsImpl.java
import java.util.*;
public class OverloadResolutionResultsImpl<D> {
public Collection<ResolvedCall<D>> getAllCandidates() {
return Collections.emptyList();
}
public void setAllCandidates(Collection<ResolvedCall<D>> allCandidates) {
}
public static <R> OverloadResolutionResultsImpl<R> nameNotFound() {
OverloadResolutionResultsImpl<R> results = new OverloadResolutionResultsImpl<>();
results.setAllCandidates(Collections.emptyList());
return results;
}
}
// FILE: AllCandidates.kt
class ResolvedCall<C>
class MyCandidate(val resolvedCall: ResolvedCall<*>)
private fun <A> allCandidatesResult(allCandidates: Collection<MyCandidate>) =
OverloadResolutionResultsImpl.nameNotFound<A>().apply {
this.allCandidates = allCandidates.map {
it.resolvedCall as ResolvedCall<A>
}
}