From e802049fd09ba73de5cdac25d3d348836bb302fa Mon Sep 17 00:00:00 2001 From: Denis Zharkov Date: Wed, 8 Jun 2016 13:02:42 +0300 Subject: [PATCH] Ignore handleReturn calls if functions is not operator --- .../src/org/jetbrains/kotlin/coroutines/coroutineUtil.kt | 2 +- compiler/testData/codegen/java8/box/async.kt | 2 +- compiler/testData/codegen/java8/box/asyncException.kt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/frontend/src/org/jetbrains/kotlin/coroutines/coroutineUtil.kt b/compiler/frontend/src/org/jetbrains/kotlin/coroutines/coroutineUtil.kt index 3501b4b5a11..d675495b831 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/coroutines/coroutineUtil.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/coroutines/coroutineUtil.kt @@ -83,7 +83,7 @@ fun FakeCallResolver.resolveCoroutineHandleResultCallIfNeeded( OperatorNameConventions.COROUTINE_HANDLE_RESULT, callElement, callElement, FakeCallKind.OTHER, listOf(firstArgument, continuation)) - if (resolutionResults.isSuccess) { + if (resolutionResults.isSuccess && resolutionResults.resultingDescriptor.isOperator) { context.trace.record(BindingContext.RETURN_HANDLE_RESULT_RESOLVED_CALL, callElement, resolutionResults.resultingCall) } } diff --git a/compiler/testData/codegen/java8/box/async.kt b/compiler/testData/codegen/java8/box/async.kt index 24fd446c764..d791792e1c1 100644 --- a/compiler/testData/codegen/java8/box/async.kt +++ b/compiler/testData/codegen/java8/box/async.kt @@ -71,7 +71,7 @@ class FutureController { } } - fun handleResult(value: T, c: Continuation) { + operator fun handleResult(value: T, c: Continuation) { future.complete(value) } diff --git a/compiler/testData/codegen/java8/box/asyncException.kt b/compiler/testData/codegen/java8/box/asyncException.kt index 5c6787df7e4..f11773ba909 100644 --- a/compiler/testData/codegen/java8/box/asyncException.kt +++ b/compiler/testData/codegen/java8/box/asyncException.kt @@ -51,7 +51,7 @@ class FutureController { } } - fun handleResult(value: T, c: Continuation) { + operator fun handleResult(value: T, c: Continuation) { future.complete(value) }