stop resolution if ambiguity is found
This commit is contained in:
@@ -262,10 +262,12 @@ public class CallResolver {
|
||||
for (ResolutionTask<D> task : prioritizedTasks) {
|
||||
TemporaryBindingTrace temporaryTrace = TemporaryBindingTrace.create(context.trace);
|
||||
OverloadResolutionResultsImpl<D> results = performResolutionGuardedForExtraFunctionLiteralArguments(task.withTrace(temporaryTrace));
|
||||
if (results.isSuccess()) {
|
||||
if (results.isSuccess() || results.isAmbiguity()) {
|
||||
temporaryTrace.commit();
|
||||
|
||||
debugInfo.set(ResolutionDebugInfo.RESULT, results.getResultingCall());
|
||||
if (results.isSuccess()) {
|
||||
debugInfo.set(ResolutionDebugInfo.RESULT, results.getResultingCall());
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package c
|
||||
|
||||
trait B {
|
||||
fun bar() {}
|
||||
}
|
||||
|
||||
class C() {
|
||||
fun bar() {
|
||||
}
|
||||
}
|
||||
|
||||
fun test(a : Any?) {
|
||||
if (a is B) {
|
||||
if (a is C) {
|
||||
a.<!OVERLOAD_RESOLUTION_AMBIGUITY!>bar()<!>;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun Any?.bar() {}
|
||||
Reference in New Issue
Block a user