Fixed priorities for synthetic functions.

This commit is contained in:
Evgeny Gerashchenko
2013-03-29 13:10:31 +04:00
parent 73bbda5b93
commit dcb95fc5ac
3 changed files with 18 additions and 1 deletions
@@ -89,7 +89,7 @@ public class TaskPrioritizer {
ResolutionTaskHolder.PriorityProvider<ResolutionCandidate<D>> visibleStrategy = new ResolutionTaskHolder.PriorityProvider<ResolutionCandidate<D>>() {
@Override
public int getPriority(ResolutionCandidate<D> call) {
return (isVisible(call) ? 2 : 0) + (isSynthesized(call) ? 1 : 0);
return (isVisible(call) ? 2 : 0) + (isSynthesized(call) ? 0 : 1);
}
@Override
@@ -0,0 +1,12 @@
var global = ""
fun Runnable(f: () -> Unit) = object : Runnable {
public override fun run() {
global = "OK"
}
}
fun box(): String {
Runnable { global = "FAIL" } .run()
return global
}
@@ -3194,6 +3194,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
doTest("compiler/testData/codegen/box/sam/runnableAccessingClosure2.kt");
}
@TestMetadata("syntheticVsReal.kt")
public void testSyntheticVsReal() throws Exception {
doTest("compiler/testData/codegen/box/sam/syntheticVsReal.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/strings")