Constraint incorporation
In a constraint system a new bound is incorporated: all new constrains that can be derived from it (and from existing ones) are added
This commit is contained in:
@@ -1,10 +1,8 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
interface Inv<I>
|
||||
|
||||
fun <S, T: S> Inv<T>.reduce2(): S = null!!
|
||||
|
||||
fun test(a: Inv<Int>): Int {
|
||||
val b = 1 <!OVERLOAD_RESOLUTION_AMBIGUITY!>+<!> a.reduce2()
|
||||
return <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>b<!>
|
||||
val b = 1 + a.reduce2()
|
||||
return b
|
||||
}
|
||||
+6
-1
@@ -6,7 +6,12 @@ fun <D, E : D> List<ResolutionTask<D, E>>.bar(t: ResolutionTask<D, E>) = t
|
||||
|
||||
public class ResolutionTaskHolder<F, G : F> {
|
||||
fun test(candidate: ResolutionCandidate<F>, tasks: MutableList<ResolutionTask<F, G>>) {
|
||||
tasks.bar(ResolutionTask(candidate))
|
||||
tasks.bar(ResolutionTask<F, G>(candidate))
|
||||
tasks.add(ResolutionTask<F, G>(candidate))
|
||||
|
||||
//todo the problem is the type of ResolutionTask is inferred as ResolutionTask<F, F> too early
|
||||
tasks.<!TYPE_INFERENCE_CONFLICTING_SUBSTITUTIONS!>bar<!>(ResolutionTask(candidate))
|
||||
tasks.<!NONE_APPLICABLE!>add<!>(ResolutionTask(candidate))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user