diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java index bb88ab97b5b..259c9150d16 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java @@ -981,8 +981,16 @@ public class ExpressionCodegen extends KtVisitor impleme ); ClosureCodegen coroutineCodegen = CoroutineCodegenForLambda.create(this, descriptor, declaration, cv); + ClosureContext closureContext = descriptor.isSuspend() ? this.context.intoCoroutineClosure( + CoroutineCodegenUtilKt.getOrCreateJvmSuspendFunctionView( + descriptor, + state.getLanguageVersionSettings().supportsFeature(LanguageFeature.ReleaseCoroutines), + state.getBindingContext() + ), + descriptor, this, state.getTypeMapper() + ) : this.context.intoClosure(descriptor, this, typeMapper); ClosureCodegen closureCodegen = coroutineCodegen != null ? coroutineCodegen : new ClosureCodegen( - state, declaration, samType, context.intoClosure(descriptor, this, typeMapper), + state, declaration, samType, closureContext, functionReferenceTarget, strategy, parentCodegen, cv ); @@ -1120,6 +1128,9 @@ public class ExpressionCodegen extends KtVisitor impleme if (!isCrossinlineLambda) { v.aconst(null); } + } else if (superClass != null && superClass.equals(state.getJvmRuntimeTypes().getFunctionReference())) { + // Constructor of callable reference to suspend function does not accept continuation: + // do nothing. } else { assert context.getFunctionDescriptor().isSuspend() : "Coroutines closure must be created only inside suspend functions"; @@ -1128,7 +1139,7 @@ public class ExpressionCodegen extends KtVisitor impleme assert continuationValue != null : "Couldn't find a value for continuation parameter of " + context.getFunctionDescriptor(); - callGenerator.putCapturedValueOnStack(continuationValue, continuationValue.type, paramIndex++); + callGenerator.putCapturedValueOnStack(continuationValue, continuationValue.type, paramIndex); } } } diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/FunctionReferenceGenerationStrategy.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/FunctionReferenceGenerationStrategy.java index 5d701011cd8..fa2d1a69b4c 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/FunctionReferenceGenerationStrategy.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/FunctionReferenceGenerationStrategy.java @@ -20,11 +20,16 @@ import kotlin.collections.CollectionsKt; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.kotlin.backend.common.CodegenUtil; +import org.jetbrains.kotlin.codegen.coroutines.CoroutineCodegenUtilKt; import org.jetbrains.kotlin.codegen.state.GenerationState; +import org.jetbrains.kotlin.config.LanguageFeature; import org.jetbrains.kotlin.descriptors.*; import org.jetbrains.kotlin.psi.*; import org.jetbrains.kotlin.resolve.BindingContext; -import org.jetbrains.kotlin.resolve.calls.model.*; +import org.jetbrains.kotlin.resolve.calls.model.DelegatingResolvedCall; +import org.jetbrains.kotlin.resolve.calls.model.ExpressionValueArgument; +import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall; +import org.jetbrains.kotlin.resolve.calls.model.ResolvedValueArgument; import org.jetbrains.kotlin.resolve.calls.util.CallMaker; import org.jetbrains.kotlin.resolve.jvm.jvmSignature.JvmMethodSignature; import org.jetbrains.kotlin.resolve.scopes.receivers.ExpressionReceiver; @@ -73,8 +78,21 @@ public class FunctionReferenceGenerationStrategy extends FunctionGenerationStrat ) { super(state); this.resolvedCall = resolvedCall; - this.referencedFunction = (FunctionDescriptor) resolvedCall.getResultingDescriptor(); - this.functionDescriptor = functionDescriptor; + if (resolvedCall.getResultingDescriptor() instanceof FunctionDescriptor && + ((FunctionDescriptor) resolvedCall.getResultingDescriptor()).isSuspend()) { + this.referencedFunction = CoroutineCodegenUtilKt.getOrCreateJvmSuspendFunctionView( + (FunctionDescriptor) resolvedCall.getResultingDescriptor(), + state.getLanguageVersionSettings().supportsFeature(LanguageFeature.ReleaseCoroutines), + state.getBindingContext()); + this.functionDescriptor = CoroutineCodegenUtilKt.getOrCreateJvmSuspendFunctionView( + functionDescriptor, + state.getLanguageVersionSettings().supportsFeature(LanguageFeature.ReleaseCoroutines), + state.getBindingContext()); + } + else { + this.referencedFunction = (FunctionDescriptor) resolvedCall.getResultingDescriptor(); + this.functionDescriptor = functionDescriptor; + } this.receiverType = receiverType; this.receiverValue = receiverValue; this.isInliningStrategy = isInliningStrategy; @@ -137,6 +155,18 @@ public class FunctionReferenceGenerationStrategy extends FunctionGenerationStrat public Map getValueArguments() { return argumentMap; } + + @NotNull + @Override + public CallableDescriptor getCandidateDescriptor() { + return referencedFunction; + } + + @NotNull + @Override + public CallableDescriptor getResultingDescriptor() { + return referencedFunction; + } }; StackValue result; @@ -172,7 +202,12 @@ public class FunctionReferenceGenerationStrategy extends FunctionGenerationStrat Type type = state.getTypeMapper().mapType(parameter); int localIndex = codegen.myFrameMap.getIndex(parameter); - codegen.tempVariables.put(fakeArgument.getArgumentExpression(), StackValue.local(localIndex, type)); + if (localIndex > 0) { + codegen.tempVariables.put(fakeArgument.getArgumentExpression(), StackValue.local(localIndex, type)); + } + else { + codegen.tempVariables.put(fakeArgument.getArgumentExpression(), StackValue.local(parameter.getIndex() + 1 + receivers, type)); + } } } diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/JvmRuntimeTypes.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/JvmRuntimeTypes.kt index c9dc12ab7aa..d86b15bcb0c 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/JvmRuntimeTypes.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/JvmRuntimeTypes.kt @@ -31,7 +31,7 @@ class JvmRuntimeTypes(module: ModuleDescriptor, private val languageVersionSetti private fun klass(name: String) = lazy { createClass(kotlinJvmInternalPackage, name) } private val lambda: ClassDescriptor by klass("Lambda") - private val functionReference: ClassDescriptor by klass("FunctionReference") + val functionReference: ClassDescriptor by klass("FunctionReference") private val localVariableReference: ClassDescriptor by klass("LocalVariableReference") private val mutableLocalVariableReference: ClassDescriptor by klass("MutableLocalVariableReference") private val coroutineImplClass by lazy { createClass(kotlinCoroutinesJvmInternalPackage, "CoroutineImpl") } @@ -94,12 +94,14 @@ class JvmRuntimeTypes(module: ModuleDescriptor, private val languageVersionSetti val receivers = computeExpectedNumberOfReceivers(referencedFunction, isBound) val functionType = createFunctionType( - referencedFunction.builtIns, - Annotations.EMPTY, - if (isBound) null else referencedFunction.extensionReceiverParameter?.type ?: referencedFunction.dispatchReceiverParameter?.type, - anonymousFunctionDescriptor.valueParameters.drop(receivers).map { it.type }, - null, - referencedFunction.returnType!! + referencedFunction.builtIns, + Annotations.EMPTY, + if (isBound) null else referencedFunction.extensionReceiverParameter?.type + ?: referencedFunction.dispatchReceiverParameter?.type, + anonymousFunctionDescriptor.valueParameters.drop(receivers).map { it.type }, + null, + referencedFunction.returnType!!, + referencedFunction.isSuspend ) return listOf(functionReference.defaultType, functionType) diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/binding/CodegenAnnotatingVisitor.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/binding/CodegenAnnotatingVisitor.java index 0583f114f12..2def85cb29e 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/binding/CodegenAnnotatingVisitor.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/binding/CodegenAnnotatingVisitor.java @@ -404,6 +404,26 @@ class CodegenAnnotatingVisitor extends KtVisitorVoid { ClassDescriptor classDescriptor = recordClassForCallable(expression, callableDescriptor, supertypes, name); MutableClosure closure = recordClosure(classDescriptor, name); + if (callableDescriptor instanceof SimpleFunctionDescriptor) { + SimpleFunctionDescriptor functionDescriptor = (SimpleFunctionDescriptor) callableDescriptor; + if (functionDescriptor.isSuspend()){ + SimpleFunctionDescriptor jvmSuspendFunctionView = + CoroutineCodegenUtilKt.getOrCreateJvmSuspendFunctionView( + functionDescriptor, + languageVersionSettings.supportsFeature(LanguageFeature.ReleaseCoroutines), + /*bindingContext*/ null + ); + + bindingTrace.record( + CodegenBinding.SUSPEND_FUNCTION_TO_JVM_VIEW, + functionDescriptor, + jvmSuspendFunctionView + ); + + closure.setSuspend(true); + } + } + if (receiverType != null) { closure.setCaptureReceiverType(receiverType); } diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/coroutines/CoroutineCodegen.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/coroutines/CoroutineCodegen.kt index 3385e3028ad..bfcc1727508 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/coroutines/CoroutineCodegen.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/coroutines/CoroutineCodegen.kt @@ -332,7 +332,7 @@ class CoroutineCodegenForLambda private constructor( declaration: KtElement, classBuilder: ClassBuilder ): ClosureCodegen? { - if (!originalSuspendLambdaDescriptor.isSuspendLambdaOrLocalFunction()) return null + if (!originalSuspendLambdaDescriptor.isSuspendLambdaOrLocalFunction() || declaration is KtCallableReferenceExpression) return null return CoroutineCodegenForLambda( expressionCodegen, diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/state/KotlinTypeMapper.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/state/KotlinTypeMapper.java index d6f7d91d965..e21ae7ce574 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/state/KotlinTypeMapper.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/state/KotlinTypeMapper.java @@ -42,10 +42,7 @@ import org.jetbrains.kotlin.load.kotlin.incremental.IncrementalPackageFragmentPr import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmBytecodeBinaryVersion; import org.jetbrains.kotlin.name.*; import org.jetbrains.kotlin.platform.JavaToKotlinClassMap; -import org.jetbrains.kotlin.psi.KtExpression; -import org.jetbrains.kotlin.psi.KtFile; -import org.jetbrains.kotlin.psi.KtFunctionLiteral; -import org.jetbrains.kotlin.psi.KtLambdaExpression; +import org.jetbrains.kotlin.psi.*; import org.jetbrains.kotlin.resolve.*; import org.jetbrains.kotlin.resolve.calls.model.DefaultValueArgument; import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall; @@ -56,6 +53,7 @@ import org.jetbrains.kotlin.resolve.jvm.jvmSignature.JvmMethodGenericSignature; import org.jetbrains.kotlin.resolve.jvm.jvmSignature.JvmMethodParameterKind; import org.jetbrains.kotlin.resolve.jvm.jvmSignature.JvmMethodParameterSignature; import org.jetbrains.kotlin.resolve.jvm.jvmSignature.JvmMethodSignature; +import org.jetbrains.kotlin.resolve.source.KotlinSourceElement; import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedCallableMemberDescriptor; import org.jetbrains.kotlin.types.*; import org.jetbrains.kotlin.util.OperatorNameConventions; @@ -1017,7 +1015,7 @@ public class KotlinTypeMapper { return OperatorNameConventions.INVOKE.asString(); } - else if (isLocalFunction(descriptor) || isFunctionExpression(descriptor)) { + else if (isLocalFunction(descriptor) || isFunctionExpression(descriptor) || isSuspendFunctionReference(descriptor)) { return OperatorNameConventions.INVOKE.asString(); } else { @@ -1025,6 +1023,13 @@ public class KotlinTypeMapper { } } + private static boolean isSuspendFunctionReference(FunctionDescriptor descriptor) { + return descriptor.getSource() instanceof KotlinSourceElement && + ((KotlinSourceElement) descriptor.getSource()).getPsi() instanceof KtCallableReferenceExpression && + CoroutineCodegenUtilKt.unwrapInitialDescriptorForSuspendFunction(descriptor) != null && + CoroutineCodegenUtilKt.unwrapInitialDescriptorForSuspendFunction(descriptor).isSuspend(); + } + @NotNull private static OwnerKind getKindForDefaultImplCall(@NotNull FunctionDescriptor baseMethodDescriptor) { DeclarationDescriptor containingDeclaration = baseMethodDescriptor.getContainingDeclaration(); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/CallCompleter.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/CallCompleter.kt index 840743e1329..dae04ef66da 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/CallCompleter.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/CallCompleter.kt @@ -19,6 +19,7 @@ package org.jetbrains.kotlin.resolve.calls import org.jetbrains.kotlin.builtins.getReturnTypeFromFunctionType import org.jetbrains.kotlin.builtins.getValueParameterTypesFromFunctionType import org.jetbrains.kotlin.builtins.isFunctionType +import org.jetbrains.kotlin.builtins.isSuspendFunctionType import org.jetbrains.kotlin.contracts.EffectSystem import org.jetbrains.kotlin.descriptors.CallableDescriptor import org.jetbrains.kotlin.descriptors.ModuleDescriptor @@ -160,7 +161,8 @@ class CallCompleter( val expectedReturnType = if (call.isCallableReference()) { // TODO: compute generic type argument for R in the kotlin.Function supertype (KT-12963) - if (!TypeUtils.noExpectedType(expectedType) && expectedType.isFunctionType) expectedType.getReturnTypeFromFunctionType() + if (!TypeUtils.noExpectedType(expectedType) && (expectedType.isFunctionType || expectedType.isSuspendFunctionType)) + expectedType.getReturnTypeFromFunctionType() else TypeUtils.NO_EXPECTED_TYPE } else expectedType @@ -211,7 +213,7 @@ class CallCompleter( } } - if (call.isCallableReference() && !TypeUtils.noExpectedType(expectedType) && expectedType.isFunctionType) { + if (call.isCallableReference() && !TypeUtils.noExpectedType(expectedType) && (expectedType.isFunctionType || expectedType.isSuspendFunctionType)) { updateSystemIfNeeded { builder -> candidateDescriptor.valueParameters.zip(expectedType.getValueParameterTypesFromFunctionType()) .forEach { (parameter, argument) -> diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/checkers/coroutineCallChecker.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/checkers/coroutineCallChecker.kt index 8e1f35646b3..b4be6aeb46d 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/checkers/coroutineCallChecker.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/checkers/coroutineCallChecker.kt @@ -15,6 +15,7 @@ import org.jetbrains.kotlin.descriptors.* import org.jetbrains.kotlin.diagnostics.DiagnosticSink import org.jetbrains.kotlin.diagnostics.Errors import org.jetbrains.kotlin.name.Name +import org.jetbrains.kotlin.psi.KtCallableReferenceExpression import org.jetbrains.kotlin.psi.KtExpression import org.jetbrains.kotlin.psi.KtThisExpression import org.jetbrains.kotlin.resolve.BindingContext @@ -59,6 +60,8 @@ object CoroutineSuspendCallChecker : CallChecker { it.ownerDescriptor.safeAs()?.isSuspend == true }?.cast()?.ownerDescriptor?.cast() + val isCallableReference = resolvedCall.call.callElement.parent is KtCallableReferenceExpression + when { enclosingSuspendFunction != null -> { val callElement = resolvedCall.call.callElement as KtExpression @@ -77,6 +80,9 @@ object CoroutineSuspendCallChecker : CallChecker { checkRestrictsSuspension(enclosingSuspendFunction, resolvedCall, reportOn, context) } + isCallableReference -> { + // do nothing: we can get callable reference to suspend function outside suspend context + } else -> { when (descriptor) { is FunctionDescriptor -> context.trace.report( diff --git a/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/DoubleColonExpressionResolver.kt b/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/DoubleColonExpressionResolver.kt index 7e4cdd50249..01880b77b2f 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/DoubleColonExpressionResolver.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/DoubleColonExpressionResolver.kt @@ -18,6 +18,7 @@ package org.jetbrains.kotlin.types.expressions import org.jetbrains.kotlin.builtins.KotlinBuiltIns import org.jetbrains.kotlin.builtins.ReflectionTypes +import org.jetbrains.kotlin.builtins.isSuspendFunctionType import org.jetbrains.kotlin.config.LanguageFeature import org.jetbrains.kotlin.config.LanguageVersionSettings import org.jetbrains.kotlin.descriptors.* @@ -45,6 +46,7 @@ import org.jetbrains.kotlin.resolve.calls.util.CallMaker import org.jetbrains.kotlin.resolve.calls.util.FakeCallableDescriptorForObject import org.jetbrains.kotlin.resolve.calls.util.createValueParametersForInvokeInFunctionType import org.jetbrains.kotlin.resolve.descriptorUtil.builtIns +import org.jetbrains.kotlin.resolve.descriptorUtil.isExtensionProperty import org.jetbrains.kotlin.resolve.scopes.receivers.ClassQualifier import org.jetbrains.kotlin.resolve.scopes.receivers.ExpressionReceiver import org.jetbrains.kotlin.resolve.scopes.receivers.Receiver @@ -585,7 +587,7 @@ class DoubleColonExpressionResolver( Annotations.EMPTY, CallableMemberDescriptor.Kind.DECLARATION, expression.toSourceElement(), - /* isCoroutine = */ false + /* isCoroutine = */ ReflectionTypes.isKSuspendFunction(type) ) functionDescriptor.initialize( @@ -636,8 +638,8 @@ class DoubleColonExpressionResolver( ) { val descriptor = if (resolutionResults?.isSingleResult == true) resolutionResults.resultingDescriptor as? FunctionDescriptor else null - if (descriptor?.isSuspend == true) { - context.trace.report(UNSUPPORTED.on(expression.callableReference, "Callable references to suspend functions")) + if (descriptor?.isSuspend == true && descriptor is PropertyDescriptor) { + context.trace.report(UNSUPPORTED.on(expression.callableReference, "Callable references to suspend property")) } val expressionResult = lhsResult as? DoubleColonLHS.Expression ?: return @@ -783,7 +785,11 @@ class DoubleColonExpressionResolver( val returnType = descriptor.returnType ?: return null val parametersTypes = descriptor.valueParameters.map { it.type } val parametersNames = descriptor.valueParameters.map { it.name } - return reflectionTypes.getKFunctionType( + return if (descriptor.isSuspend) reflectionTypes.getKSuspendFunctionType( + Annotations.EMPTY, receiverType, + parametersTypes, parametersNames, returnType, descriptor.builtIns + ) + else reflectionTypes.getKFunctionType( Annotations.EMPTY, receiverType, parametersTypes, parametersNames, returnType, descriptor.builtIns ) diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/companionObjectReceiver.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/companionObjectReceiver.kt new file mode 100644 index 00000000000..7094511e59a --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/companionObjectReceiver.kt @@ -0,0 +1,26 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +class A { + companion object { + suspend fun ok() = "OK" + } +} + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +fun box(): String { + var res = "FAIL" + builder { + res = (A.Companion::ok)() + } + return res +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/coroutineContext.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/coroutineContext.kt new file mode 100644 index 00000000000..5506fb5614f --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/coroutineContext.kt @@ -0,0 +1,16 @@ +// IGNORE_BACKEND: JS + +// SKIP_SOURCEMAP_REMAPPING + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import COROUTINES_PACKAGE.* + +fun box(): String { + val name = ::coroutineContext.name + if (name != "coroutineContext") return "Fail 1: $name" + + return "OK" +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/emptyLHS.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/emptyLHS.kt new file mode 100644 index 00000000000..9ae9ffa7c25 --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/emptyLHS.kt @@ -0,0 +1,97 @@ +// IGNORE_BACKEND: JS + +// LANGUAGE_VERSION: 1.2 +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import kotlin.coroutines.experimental.* + +var result = "" + +class A { + suspend fun memberFunction() { + result += "A.mf," + } + + suspend fun aMemberFunction() { + result += "A.amf," + } + + suspend fun test(): String { + (::memberFunction)() + (::aExtensionFunction)() + + return result + } + + inner class B { + suspend fun memberFunction() { + result += "B.mf," + } + + suspend fun test(): String { + (::aMemberFunction)() + (::aExtensionFunction)() + + (::memberFunction)() + + (::bExtensionFunction)() + + return result + } + } +} + +suspend fun A.aExtensionFunction() { + result += "A.ef," +} + +suspend fun A.B.bExtensionFunction() { + result += "B.ef," +} + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +fun box(): String { + var a = "FAIL 1" + builder { + a = A().test() + } + if (a != "A.mf,A.ef,") return "Fail $a" + + result = "" + var b = "FAIL 2" + builder { + b = A().B().test() + } + if (b != "A.amf,A.ef,B.mf,B.ef,") return "Fail $b" + + result = "" + builder { + with(A()) { + (::memberFunction)() + (::aExtensionFunction)() + } + } + if (result != "A.mf,A.ef,") return "Fail $result" + + result = "" + builder { + with(A()) { + with(B()) { + (::aMemberFunction)() + (::aExtensionFunction)() + + (::memberFunction)() + + (::bExtensionFunction)() + } + } + } + if (result != "A.amf,A.ef,B.mf,B.ef,") return "Fail $result" + + return "OK" +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/enumEntryMember.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/enumEntryMember.kt new file mode 100644 index 00000000000..6b9e11acded --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/enumEntryMember.kt @@ -0,0 +1,31 @@ +// IGNORE_BACKEND: JS +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +enum class E { + A, B; + + suspend fun foo() = this.name +} + +fun box(): String { + val f = E.A::foo + val ef = E::foo + + var res = "" + builder { + if (f() != "A") res = "Fail 1: ${f()}" + else if (f == E.B::foo) res = "Fail 2" + else if (ef != E::foo) res = "Fail 3" + } + + return "OK" +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/equals/nullableReceiverInEquals.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/equals/nullableReceiverInEquals.kt new file mode 100644 index 00000000000..bd097bc3d6d --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/equals/nullableReceiverInEquals.kt @@ -0,0 +1,25 @@ +// TODO: investigate should it be ran for JS or not +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_REFLECT + +class A + +val a = A() +val aa = A() + +suspend fun A?.foo() {} + +val aFoo = a::foo +val A_foo = A::foo +val nullFoo = null::foo + +fun box(): String = + when { + nullFoo != null::foo -> "Bound extension refs with same receiver SHOULD be equal" + nullFoo == aFoo -> "Bound extension refs with different receivers SHOULD NOT be equal" + nullFoo == A_foo -> "Bound extension ref with receiver 'null' SHOULD NOT be equal to free ref" + + else -> "OK" + } diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/equals/receiverInEquals.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/equals/receiverInEquals.kt new file mode 100644 index 00000000000..7b78d1423df --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/equals/receiverInEquals.kt @@ -0,0 +1,29 @@ +// TODO: investigate should it be ran for JS or not +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST + +package test + +class A { + suspend fun foo() {} + suspend fun bar() {} +} + +val a = A() +val aa = A() + +val aFoo = a::foo +val aBar = a::bar +val aaFoo = aa::foo +val A_foo = A::foo + +fun box(): String = + when { + aFoo != a::foo -> "Bound refs with same receiver SHOULD be equal" + aFoo == aBar -> "Bound refs to different members SHOULD NOT be equal" + aFoo == aaFoo -> "Bound refs with different receiver SHOULD NOT be equal" + aFoo == A_foo -> "Bound ref SHOULD NOT be equal to free ref" + + else -> "OK" + } \ No newline at end of file diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/equals/reflectionReference.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/equals/reflectionReference.kt new file mode 100644 index 00000000000..a371c4859f9 --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/equals/reflectionReference.kt @@ -0,0 +1,27 @@ +// TODO: investigate should it be ran for JS or not +// IGNORE_BACKEND: JS, NATIVE + +// COMMON_COROUTINES_TEST +// WITH_REFLECT + +import kotlin.reflect.full.* + +class C { + suspend fun foo() {} +} + +val C_fooReflect = C::class.functions.find { it.name == "foo" }!! +val C_foo = C::foo +val cFoo = C()::foo + +val Any.className: String + get() = this::class.qualifiedName!! + +fun box(): String = + when { + C_fooReflect != C_foo -> "C_fooReflect != C_foo, ${C_fooReflect.className}" + C_foo != C_fooReflect -> "C_foo != C_fooReflect, ${C_foo.className}" + C_fooReflect == cFoo -> "C_fooReflect == cFoo, ${C_fooReflect.className}" + cFoo == C_fooReflect -> "cFoo == C_fooReflect, ${cFoo.className}" + else -> "OK" + } diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/inline/simple.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/inline/simple.kt new file mode 100644 index 00000000000..16b3d080139 --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/inline/simple.kt @@ -0,0 +1,24 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +inline suspend fun foo(x: suspend () -> String) = x() + +suspend fun String.id() = this + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +fun box(): String { + var res = "" + builder { + res = foo("OK"::id) + } + return res +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/inline/simpleVal.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/inline/simpleVal.kt new file mode 100644 index 00000000000..c380732bbcc --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/inline/simpleVal.kt @@ -0,0 +1,25 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +inline suspend fun go(f: suspend () -> String) = f() + +suspend fun String.id(): String = this + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +fun box(): String { + val x = "OK" + var res = "FAIL" + builder { + res = go(x::id) + } + return res +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/localUnitFunction.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/localUnitFunction.kt new file mode 100644 index 00000000000..78024435ef7 --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/localUnitFunction.kt @@ -0,0 +1,20 @@ +// TARGET_BACKEND: JVM +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +fun box(): String { + suspend fun foo(): Unit {} + builder { + assert(Unit.javaClass.equals(foo().javaClass)) + assert(Unit.javaClass.equals(foo()::class.java)) + } + return "OK" +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/multiCase.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/multiCase.kt new file mode 100644 index 00000000000..4e20ca3ab36 --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/multiCase.kt @@ -0,0 +1,66 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +class A(var v: Int) { + suspend fun f(x: Int) = x * v +} + +suspend fun A.g(x: Int) = x * f(x); + +var A.w: Int + get() = 1000 * v + set(c: Int) { + v = c + 10 + } + +object F { + var u = 0 +} + +fun box(): String { + builder { + val a = A(5) + + val av = a::v + if (av() != 5) throw RuntimeException("fail1: ${av()}") + if (av.get() != 5) throw RuntimeException("fail2: ${av.get()}") + av.set(7) + if (a.v != 7) throw RuntimeException("fail3: ${a.v}") + + val af = a::f + if (af(10) != 70) throw RuntimeException("fail4: ${af(10)}") + + val ag = a::g + if (ag(10) != 700) throw RuntimeException("fail5: ${ag(10)}") + + val aw = a::w + if (aw() != 7000) throw RuntimeException("fail6: ${aw()}") + if (aw.get() != 7000) throw RuntimeException("fail7: ${aw.get()}") + aw.set(5) + if (a.v != 15) throw RuntimeException("fail8: ${a.v}") + + val fu = F::u + if (fu() != 0) throw RuntimeException("fail9: ${fu()}") + if (fu.get() != 0) throw RuntimeException("fail10: ${fu.get()}") + fu.set(8) + if (F.u != 8) throw RuntimeException("fail11: ${F.u}") + + val x = 100 + + fun A.lf() = v * x; + val alf = a::lf + if (alf() != 1500) throw RuntimeException("fail9: ${alf()}") + } + + return "OK" +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/nullReceiver.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/nullReceiver.kt new file mode 100644 index 00000000000..881cbba7ad9 --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/nullReceiver.kt @@ -0,0 +1,22 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +suspend fun String?.ok() = "OK" + +fun box(): String { + var res = "FAIL" + builder { + res = (null::ok)() + } + return res +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/objectReceiver.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/objectReceiver.kt new file mode 100644 index 00000000000..ceccf069d28 --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/objectReceiver.kt @@ -0,0 +1,24 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +object Singleton { + suspend fun ok() = "OK" +} + +fun box(): String { + var res = "FAIL" + builder { + res = (Singleton::ok)() + } + return res +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/primitiveReceiver.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/primitiveReceiver.kt new file mode 100644 index 00000000000..b19ece92c76 --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/primitiveReceiver.kt @@ -0,0 +1,41 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +suspend fun Boolean.foo() = 1 +suspend fun Byte.foo() = 2 +suspend fun Short.foo() = 3 +suspend fun Int.foo() = 4 +suspend fun Long.foo() = 5 +suspend fun Char.foo() = 6 +suspend fun Float.foo() = 7 +suspend fun Double.foo() = 8 + +fun testRef(name: String, f: suspend () -> Int, expected: Int) { + builder { + val actual = f() + if (actual != expected) throw AssertionError("$name: $actual != $expected") + } +} + +fun box(): String { + testRef("Boolean", true::foo, 1) + testRef("Byte", 1.toByte()::foo, 2) + testRef("Short", 1.toShort()::foo, 3) + testRef("Int", 1::foo, 4) + testRef("Long", 1L::foo, 5) + testRef("Char", '1'::foo, 6) + testRef("Float", 1.0F::foo, 7) + testRef("Double", 1.0::foo, 8) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/smartCastForExtensionReceiver.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/smartCastForExtensionReceiver.kt new file mode 100644 index 00000000000..55de1de40df --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/smartCastForExtensionReceiver.kt @@ -0,0 +1,30 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +class B + +suspend fun B.magic() { +} + +suspend fun suspendRun(c: suspend() -> Unit) = c() + +fun boom(a: Any) { + when (a) { + is B -> builder { suspendRun(a::magic) } + } +} + +fun box(): String { + boom(B()) + return "OK" +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/abstractClassMember.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/abstractClassMember.kt new file mode 100644 index 00000000000..ff7559e4269 --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/abstractClassMember.kt @@ -0,0 +1,26 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +abstract class A { + abstract suspend fun foo(): String +} + +class B : A() { + override suspend fun foo() = "OK" +} + +fun box(): String { + var res = "FAIL" + builder { res = (A::foo)(B()) } + return res +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromClass.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromClass.kt new file mode 100644 index 00000000000..eea86bd5afe --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromClass.kt @@ -0,0 +1,25 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +class A { + suspend fun foo(k: Int) = k + + suspend fun result() = (A::foo)(this, 111) +} + +fun box(): String { + var result = 0 + builder { result = A().result() } + if (result != 111) return "Fail $result" + return "OK" +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromExtension.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromExtension.kt new file mode 100644 index 00000000000..7af039afe30 --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromExtension.kt @@ -0,0 +1,26 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +class A { + suspend fun o() = 111 + suspend fun k(k: Int) = k +} + +suspend fun A.foo() = (A::o)(this) + (A::k)(this, 222) + +fun box(): String { + var result = 0 + builder { result = A().foo() } + if (result != 333) return "Fail $result" + return "OK" +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelStringNoArgs.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelStringNoArgs.kt new file mode 100644 index 00000000000..6cf4c977462 --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelStringNoArgs.kt @@ -0,0 +1,25 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +class A { + suspend fun foo() = "OK" +} + +fun box(): String { + val x = A::foo + var res = "FAIL" + builder { + res = x(A()) + } + return res +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelStringOneStringArg.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelStringOneStringArg.kt new file mode 100644 index 00000000000..10896f81f08 --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelStringOneStringArg.kt @@ -0,0 +1,25 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +class A { + suspend fun foo(result: String) = result +} + +fun box(): String { + val x = A::foo + var res = "FAIL" + builder { + res = x(A(), "OK") + } + return res +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelUnitNoArgs.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelUnitNoArgs.kt new file mode 100644 index 00000000000..e10cd78589b --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelUnitNoArgs.kt @@ -0,0 +1,27 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +class A { + var result = "Fail" + + suspend fun foo() { + result = "OK" + } +} + +fun box(): String { + val a = A() + val x = A::foo + builder { x(a) } + return a.result +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelUnitOneStringArg.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelUnitOneStringArg.kt new file mode 100644 index 00000000000..439434e730c --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelUnitOneStringArg.kt @@ -0,0 +1,27 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +class A { + var result = "Fail" + + suspend fun foo(newResult: String) { + result = newResult + } +} + +fun box(): String { + val a = A() + val x = A::foo + builder { x(a, "OK") } + return a.result +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromClass.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromClass.kt new file mode 100644 index 00000000000..2c5886389f4 --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromClass.kt @@ -0,0 +1,24 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +class A { + suspend fun result() = (A::foo)(this, "OK") +} + +suspend fun A.foo(x: String) = x + +fun box(): String { + var res = "FAIL" + builder { res = A().result() } + return res +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromExtension.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromExtension.kt new file mode 100644 index 00000000000..5de79973a91 --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromExtension.kt @@ -0,0 +1,26 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +class A + +suspend fun A.foo() = (A::bar)(this, "OK") + +suspend fun A.bar(x: String) = x + +fun box(): String { + var res = "FAIL" + builder { + res = A().foo() + } + return res +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelStringNoArgs.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelStringNoArgs.kt new file mode 100644 index 00000000000..faf47bb13dc --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelStringNoArgs.kt @@ -0,0 +1,23 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +class A + +suspend fun A.foo() = "OK" + +fun box(): String { + val x = A::foo + var res = "FAIL" + builder { res = x(A()) } + return res +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelStringOneStringArg.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelStringOneStringArg.kt new file mode 100644 index 00000000000..32e17e323ef --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelStringOneStringArg.kt @@ -0,0 +1,23 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +class A + +suspend fun A.foo(result: String) = result + +fun box(): String { + val x = A::foo + var res = "FAIL" + builder { res = x(A(), "OK") } + return res +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelUnitNoArgs.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelUnitNoArgs.kt new file mode 100644 index 00000000000..1afae874ef6 --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelUnitNoArgs.kt @@ -0,0 +1,27 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +class A { + var result = "Fail" +} + +suspend fun A.foo() { + result = "OK" +} + +fun box(): String { + val a = A() + val x = A::foo + builder { x(a) } + return a.result +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelUnitOneStringArg.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelUnitOneStringArg.kt new file mode 100644 index 00000000000..02fb30d1e60 --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelUnitOneStringArg.kt @@ -0,0 +1,27 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +class A { + var result = "Fail" +} + +suspend fun A.foo(newResult: String) { + result = newResult +} + +fun box(): String { + val a = A() + val x = A::foo + builder { x(a, "OK") } + return a.result +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferenceArguments.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferenceArguments.kt new file mode 100644 index 00000000000..e328e02b466 --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferenceArguments.kt @@ -0,0 +1,41 @@ +// IGNORE_BACKEND: JS, NATIVE + +// WITH_REFLECT +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import kotlin.test.assertEquals + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +suspend fun foo(x: T): R = TODO() +suspend fun fooReturnInt(x: T): Int = 1 +suspend fun Int.suspendToString(): String = toString() + +suspend inline fun check(x: T, y: R, f: suspend (T) -> R, tType: String, rType: String) { + assertEquals(tType, T::class.simpleName) + assertEquals(rType, R::class.simpleName) +} + +suspend inline fun check(f: suspend (T) -> R, g: suspend (T) -> R, tType: String, rType: String) { + assertEquals(tType, T::class.simpleName) + assertEquals(rType, R::class.simpleName) +} + +fun box(): String { + builder { + check("", 1, ::foo, "String", "Int") + check("", 1, ::fooReturnInt, "String", "Int") + check("", "", ::fooReturnInt, "String", "Any") + + check(Int::suspendToString, ::foo, "Int", "String") + } + + return "OK" +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithNullableTypes.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithNullableTypes.kt new file mode 100644 index 00000000000..cfe1081b1b5 --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithNullableTypes.kt @@ -0,0 +1,41 @@ +// IGNORE_BACKEND: JS, NATIVE + +// WITH_REFLECT +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import kotlin.test.assertEquals + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +suspend fun foo(x: T): R = TODO() + +suspend inline fun bar(x: T, y: R, f: suspend (T) -> R, tType: String, rType: String): Pair { + assertEquals(tType, T::class.simpleName) + assertEquals(rType, R::class.simpleName) + return Pair(x, y) +} + +data class Pair(val a: A, val b: B) + +fun box(): String { + builder { + bar(1, "", ::foo, "Int", "String") + + val s1: Pair = bar(1, "", ::foo, "Int", "String") + val (a: Int, b: String?) = bar(1, "", ::foo, "Int", "String") + + val ns: String? = null + bar(ns, ns, ::foo, "String", "String") + + val s2: Pair = bar(null, null, ::foo, "Int", "String") + } + + return "OK" +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithOverload.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithOverload.kt new file mode 100644 index 00000000000..ecff003e56d --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithOverload.kt @@ -0,0 +1,33 @@ +// IGNORE_BACKEND: JS, NATIVE + +// WITH_REFLECT +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* +import kotlin.test.assertEquals + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +suspend fun foo(x: Int?) {} +suspend fun foo(y: String?) {} +suspend fun foo(z: Boolean) {} + +suspend inline fun bar(f: suspend (T) -> Unit, tType: String): T? { + assertEquals(tType, T::class.simpleName) + return null +} + +fun box(): String { + builder { + val a1: Int? = bar(::foo, "Int") + val a2: String? = bar(::foo, "String") + val a3: Boolean? = bar(::foo, "Boolean") + } + + return "OK" +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericMember.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericMember.kt new file mode 100644 index 00000000000..abdda2e0b72 --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericMember.kt @@ -0,0 +1,24 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +class A(val t: T) { + suspend fun foo(): T = t +} + +fun box(): String { + var res = "FAIL" + builder { + res = (A::foo)(A("OK")) + } + return res +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/getArityViaFunctionImpl.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/getArityViaFunctionImpl.kt new file mode 100644 index 00000000000..f69252db570 --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/getArityViaFunctionImpl.kt @@ -0,0 +1,45 @@ +// TODO: muted automatically, investigate should it be ran for JS or not +// IGNORE_BACKEND: JS, NATIVE +// IGNORE_LIGHT_ANALYSIS + +// LANGUAGE_VERSION: 1.2 +// WITH_RUNTIME +// WITH_COROUTINES + +import kotlin.test.assertEquals +import kotlin.jvm.internal.FunctionBase +import helpers.* +import kotlin.coroutines.experimental.* + +suspend fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +fun test(f: Function<*>, arity: Int) { + assertEquals(arity, (f as FunctionBase).getArity()) +} + +suspend fun foo(s: String, i: Int) {} +class A { + suspend fun bar(s: String, i: Int) {} +} + +suspend fun Double.baz(s: String, i: Int) {} + +fun box(): String { + test(::foo, 2 + 1) + test(A::bar, 3 + 1) + test(Double::baz, 3 + 1) + + test(::box, 0) + + suspend fun local(x: Int) {} + test(::local, 1 + 1) + + // TODO: Uncomment when `suspend fun` will be supported + // test(suspend fun(s: String) = s, 1) + // test(suspend fun(){}, 0) + test(suspend {}, 1) + + return "OK" +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/captureOuter.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/captureOuter.kt new file mode 100644 index 00000000000..0f4c4b08bcf --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/captureOuter.kt @@ -0,0 +1,27 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +class Outer { + val result = "OK" + + inner class Inner { + suspend fun foo() = result + } +} + +fun box(): String { + val f = Outer.Inner::foo + var res = "FAIL" + builder { res = f(Outer().Inner()) } + return res +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/classMember.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/classMember.kt new file mode 100644 index 00000000000..2790ef815ec --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/classMember.kt @@ -0,0 +1,23 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +fun box(): String { + class Local { + suspend fun foo() = "OK" + } + + val ref = Local::foo + var res = "FAIL" + builder { res = ref(Local()) } + return res +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/closureWithSideEffect.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/closureWithSideEffect.kt new file mode 100644 index 00000000000..eda7fff2919 --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/closureWithSideEffect.kt @@ -0,0 +1,22 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +fun box(): String { + var result = "Fail" + + suspend fun changeToOK() { result = "OK" } + + val ok = ::changeToOK + builder { ok() } + return result +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/enumExtendsTrait.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/enumExtendsTrait.kt new file mode 100644 index 00000000000..7cf5fc29a9c --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/enumExtendsTrait.kt @@ -0,0 +1,26 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +interface Named { + suspend fun name() = "OK" +} + +enum class E : Named { + OK +} + +fun box(): String { + var res = "FAIL" + builder { res = E.OK.name } + return res +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/equalsHashCode.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/equalsHashCode.kt new file mode 100644 index 00000000000..aee553282aa --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/equalsHashCode.kt @@ -0,0 +1,14 @@ +// IGNORE_BACKEND: JS, NATIVE +// COMMON_COROUTINES_TEST + +fun box(): String { + suspend fun bar() {} + suspend fun baz() {} + + if (!::bar.equals(::bar)) return "Fail 1" + if (::bar.hashCode() != ::bar.hashCode()) return "Fail 2" + + if (::bar == ::baz) return "Fail 3" + + return "OK" +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extension.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extension.kt new file mode 100644 index 00000000000..a47ba5847aa --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extension.kt @@ -0,0 +1,21 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +class A + +fun box(): String { + suspend fun A.foo() = "OK" + var res = "FAIL" + builder { res = (A::foo)(A()) } + return res +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extensionToLocalClass.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extensionToLocalClass.kt new file mode 100644 index 00000000000..a337d2b6fab --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extensionToLocalClass.kt @@ -0,0 +1,20 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +fun box(): String { + class A + suspend fun A.foo() = "OK" + var res = "FAIL" + builder { res = (A::foo)((::A)()) } + return res +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extensionToPrimitive.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extensionToPrimitive.kt new file mode 100644 index 00000000000..210ec94aafc --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extensionToPrimitive.kt @@ -0,0 +1,19 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +fun box(): String { + suspend fun Int.is42With(that: Int) = this + 2 * that == 42 + var res = "" + builder { res = if ((Int::is42With)(16, 13)) "OK" else "Fail" } + return res +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extensionWithClosure.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extensionWithClosure.kt new file mode 100644 index 00000000000..22f585c88a9 --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extensionWithClosure.kt @@ -0,0 +1,24 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +class A + +fun box(): String { + var result = "Fail" + + suspend fun A.ext() { result = "OK" } + + val f = A::ext + builder { f(A()) } + return result +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/genericMember.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/genericMember.kt new file mode 100644 index 00000000000..fab0d883de5 --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/genericMember.kt @@ -0,0 +1,23 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +fun box(): String { + class Id { + suspend fun invoke(t: T) = t + } + + val ref = Id::invoke + var res = "FAIL" + builder { res = ref(Id(), "OK") } + return res +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/localClassMember.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/localClassMember.kt new file mode 100644 index 00000000000..7fcfb9dc63f --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/localClassMember.kt @@ -0,0 +1,26 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +fun box(): String { + val result = "OK" + + class Local { + suspend fun foo() = result + } + + val member = Local::foo + val instance = Local() + var res = "FAIL" + builder { res = member(instance) } + return res +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/localFunctionName.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/localFunctionName.kt new file mode 100644 index 00000000000..87ba6845a9f --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/localFunctionName.kt @@ -0,0 +1,9 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST + +fun box(): String { + suspend fun OK() {} + + return ::OK.name +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/localLocal.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/localLocal.kt new file mode 100644 index 00000000000..f6ea549dbd8 --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/localLocal.kt @@ -0,0 +1,25 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +fun box(): String { + suspend fun foo(): String { + suspend fun bar() = "OK" + val ref = ::bar + return ref() + } + + val ref = ::foo + var res = "FAIL" + builder { res = ref() } + return res +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/simple.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/simple.kt new file mode 100644 index 00000000000..92c45cdf24b --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/simple.kt @@ -0,0 +1,21 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +fun box(): String { + suspend fun foo() = "OK" + var res = "FAIL" + builder { + res = (::foo)() + } + return res +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/simpleClosure.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/simpleClosure.kt new file mode 100644 index 00000000000..2224577cc7f --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/simpleClosure.kt @@ -0,0 +1,25 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +fun box(): String { + val result = "OK" + + suspend fun foo() = result + + var res = "FAIL" + + builder { + res = (::foo)() + } + return res +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/simpleWithArg.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/simpleWithArg.kt new file mode 100644 index 00000000000..3c2401ea9c5 --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/simpleWithArg.kt @@ -0,0 +1,19 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +fun box(): String { + suspend fun foo(s: String) = s + var res = "FAIL" + builder { res = (::foo)("OK") } + return res +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/unitWithSideEffect.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/unitWithSideEffect.kt new file mode 100644 index 00000000000..40d27a33a92 --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/unitWithSideEffect.kt @@ -0,0 +1,30 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +var state = 23 + +fun box(): String { + suspend fun incrementState(inc: Int) { + state += inc + } + + val inc = ::incrementState + builder { + inc(12) + inc(-5) + inc(27) + inc(-15) + } + + return if (state == 42) "OK" else "Fail $state" +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/overloadedFun.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/overloadedFun.kt new file mode 100644 index 00000000000..a5ffc85e7b1 --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/overloadedFun.kt @@ -0,0 +1,42 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +suspend fun foo(): String = "foo1" +suspend fun foo(i: Int): String = "foo2" + +val f1: suspend () -> String = ::foo +val f2: suspend (Int) -> String = ::foo + +suspend fun foo1() {} +suspend fun foo2(i: Int) {} + +suspend fun bar(f: suspend () -> Unit): String = "bar1" +suspend fun bar(f: suspend (Int) -> Unit): String = "bar2" + +fun box(): String { + builder { + val x1 = f1() + if (x1 != "foo1") throw RuntimeException("Fail 1: $x1") + + val x2 = f2(0) + if (x2 != "foo2") throw RuntimeException("Fail 2: $x2") + + val y1 = bar(::foo1) + if (y1 != "bar1") throw RuntimeException("Fail 3: $y1") + + val y2 = bar(::foo2) + if (y2 != "bar2") throw RuntimeException("Fail 4: $y2") + } + + return "OK" +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/overloadedFunVsVal.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/overloadedFunVsVal.kt new file mode 100644 index 00000000000..92bf7af7aae --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/overloadedFunVsVal.kt @@ -0,0 +1,34 @@ +// TODO: muted automatically, investigate should it be ran for JS or not +// IGNORE_BACKEND: JS +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import kotlin.reflect.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +class A { + val x = 1 + suspend fun x(): String = "OK" +} + +val f1: KProperty1 = A::x +val f2: suspend (A) -> String = A::x + +fun box(): String { + val a = A() + + val x1 = f1.get(a) + if (x1 != 1) return "Fail 1: $x1" + + var res = "FAIL" + builder { + res = f2(a) + } + return res +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/privateClassMember.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/privateClassMember.kt new file mode 100644 index 00000000000..c8cafe3ce69 --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/privateClassMember.kt @@ -0,0 +1,26 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +class A { + private suspend fun foo() = "OK" + + suspend fun bar() = (A::foo)(this) +} + +fun box(): String { + var res = "FAIL" + builder { + res = A().bar() + } + return res +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/specialCalls.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/specialCalls.kt new file mode 100644 index 00000000000..e6ddbc6a0cb --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/specialCalls.kt @@ -0,0 +1,44 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +suspend fun baz(i: Int) = i +suspend fun bar(x: T): T = x + +suspend fun nullableFun(): (suspend (Int) -> Int)? = null + +fun box(): String { + builder { + val x1: suspend (Int) -> Int = bar(if (true) ::baz else ::baz) + val x2: suspend (Int) -> Int = bar(nullableFun() ?: ::baz) + val x3: suspend (Int) -> Int = bar(::baz ?: ::baz) + + val i = 0 + val x4: suspend (Int) -> Int = bar(when (i) { + 10 -> ::baz + 20 -> ::baz + else -> ::baz + }) + + val x5: suspend (Int) -> Int = bar(::baz!!) + + if (x1(1) != 1) throw RuntimeException("fail 1") + if (x2(1) != 1) throw RuntimeException("fail 2") + if (x3(1) != 1) throw RuntimeException("fail 3") + if (x4(1) != 1) throw RuntimeException("fail 4") + if (x5(1) != 1) throw RuntimeException("fail 5") + + if ((if (true) ::baz else ::baz)(1) != 1) throw RuntimeException("fail 6") + } + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromClass.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromClass.kt new file mode 100644 index 00000000000..9e6a04d57ec --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromClass.kt @@ -0,0 +1,25 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +suspend fun foo(o: Int, k: Int) = o + k + +class A { + suspend fun bar() = (::foo)(111, 222) +} + +fun box(): String { + var result = 0 + builder { result = A().bar() } + if (result != 333) return "Fail $result" + return "OK" +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromExtension.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromExtension.kt new file mode 100644 index 00000000000..929e5767b79 --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromExtension.kt @@ -0,0 +1,25 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +suspend fun foo(o: Int, k: Int) = o + k + +class A + +suspend fun A.bar() = (::foo)(111, 222) + +fun box(): String { + var result = 0 + builder { result = A().bar() } + if (result != 333) return "Fail $result" + return "OK" +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelStringNoArgs.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelStringNoArgs.kt new file mode 100644 index 00000000000..ef1b371acbc --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelStringNoArgs.kt @@ -0,0 +1,21 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +suspend fun foo() = "OK" + +fun box(): String { + val x = ::foo + var res = "FAIL" + builder { res = x() } + return res +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelStringOneStringArg.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelStringOneStringArg.kt new file mode 100644 index 00000000000..5e8d1e5e601 --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelStringOneStringArg.kt @@ -0,0 +1,21 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +suspend fun foo(x: String) = x + +fun box(): String { + val x = ::foo + var res = "FAIL" + builder { res = x("OK") } + return res +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelUnitNoArgs.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelUnitNoArgs.kt new file mode 100644 index 00000000000..5f2a37bad10 --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelUnitNoArgs.kt @@ -0,0 +1,24 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +var result = "Fail" + +suspend fun foo() { + result = "OK" +} + +fun box(): String { + val x = ::foo + builder { x() } + return result +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelUnitOneStringArg.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelUnitOneStringArg.kt new file mode 100644 index 00000000000..f6ec044ccd6 --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelUnitOneStringArg.kt @@ -0,0 +1,24 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +var result = "Fail" + +suspend fun foo(newResult: String) { + result = newResult +} + +fun box(): String { + val x = ::foo + builder { x("OK") } + return result +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/traitImplMethodWithClassReceiver.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/traitImplMethodWithClassReceiver.kt new file mode 100644 index 00000000000..59cf82d8bdf --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/traitImplMethodWithClassReceiver.kt @@ -0,0 +1,30 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +interface T { + suspend fun foo() = "OK" +} + +class B : T { + inner class C { + suspend fun bar() = (T::foo)(this@B) + } +} + +fun box(): String { + var res = "FAIL" + builder { + res = B().C().bar() + } + return res +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/traitMember.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/traitMember.kt new file mode 100644 index 00000000000..809dc3efd59 --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/traitMember.kt @@ -0,0 +1,28 @@ +// IGNORE_BACKEND: JS + +// COMMON_COROUTINES_TEST +// WITH_RUNTIME +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +interface A { + suspend fun foo(): String +} + +class B : A { + override suspend fun foo() = "OK" +} + +fun box(): String { + var res = "FAIL" + builder { + res = (A::foo)(B()) + } + return res +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability/noReflect.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability/noReflect.kt new file mode 100644 index 00000000000..6b17d975baa --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability/noReflect.kt @@ -0,0 +1,26 @@ +// IGNORE_BACKEND: JS, NATIVE +// WITH_RUNTIME +// COMMON_COROUTINES_TEST + +import java.io.* +import kotlin.test.* + +class Foo { + suspend fun method() {} +} + +fun box(): String { + val baos = ByteArrayOutputStream() + val oos = ObjectOutputStream(baos) + oos.writeObject(Foo::method) + oos.writeObject(::Foo) + oos.close() + + val bais = ByteArrayInputStream(baos.toByteArray()) + val ois = ObjectInputStream(bais) + assertEquals(Foo::method, ois.readObject()) + assertEquals(::Foo, ois.readObject()) + ois.close() + + return "OK" +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability/reflectedIsNotSerialized.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability/reflectedIsNotSerialized.kt new file mode 100644 index 00000000000..3ee30ee04eb --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability/reflectedIsNotSerialized.kt @@ -0,0 +1,27 @@ +// IGNORE_BACKEND: JS, NATIVE +// WITH_REFLECT +// COMMON_COROUTINES_TEST +// WITH_RUNTIME + +import java.io.* +import kotlin.test.* + +suspend fun bar() {} + +fun box(): String { + val baos = ByteArrayOutputStream() + val oos = ObjectOutputStream(baos) + oos.writeObject(::bar) + oos.close() + + val bais = ByteArrayInputStream(baos.toByteArray()) + val ois = ObjectInputStream(bais) + val o = ois.readObject() + ois.close() + + // Test that we don't serialize the reflected view of the reference: it's not needed because it can be restored at runtime + val field = kotlin.jvm.internal.CallableReference::class.java.getDeclaredField("reflected").apply { isAccessible = true } + assertNull(field.get(o)) + + return "OK" +} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability/withReflect.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability/withReflect.kt new file mode 100644 index 00000000000..859aacfd9d7 --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability/withReflect.kt @@ -0,0 +1,27 @@ +// IGNORE_BACKEND: JS, NATIVE +// WITH_REFLECT +// COMMON_COROUTINES_TEST +// WITH_RUNTIME + +import java.io.* +import kotlin.test.* + +class Foo { + suspend fun method() {} +} + +fun box(): String { + val baos = ByteArrayOutputStream() + val oos = ObjectOutputStream(baos) + oos.writeObject(Foo::method) + oos.writeObject(::Foo) + oos.close() + + val bais = ByteArrayInputStream(baos.toByteArray()) + val ois = ObjectInputStream(bais) + assertEquals(Foo::method, ois.readObject()) + assertEquals(::Foo, ois.readObject()) + ois.close() + + return "OK" +} diff --git a/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java index 7d833548c72..560f24a7a07 100644 --- a/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java @@ -6282,6 +6282,863 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlus.kt", "kotlin.coroutines"); } + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class CallableReference extends AbstractIrBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInCallableReference() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Bound extends AbstractIrBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInBound() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("companionObjectReceiver.kt") + public void testCompanionObjectReceiver_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/companionObjectReceiver.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("companionObjectReceiver.kt") + public void testCompanionObjectReceiver_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/companionObjectReceiver.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("coroutineContext.kt") + public void testCoroutineContext_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/coroutineContext.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("coroutineContext.kt") + public void testCoroutineContext_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/coroutineContext.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("emptyLHS.kt") + public void testEmptyLHS() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/emptyLHS.kt"); + } + + @TestMetadata("enumEntryMember.kt") + public void testEnumEntryMember_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/enumEntryMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("enumEntryMember.kt") + public void testEnumEntryMember_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/enumEntryMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("localUnitFunction.kt") + public void testLocalUnitFunction_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/localUnitFunction.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("localUnitFunction.kt") + public void testLocalUnitFunction_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/localUnitFunction.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("multiCase.kt") + public void testMultiCase_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/multiCase.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("multiCase.kt") + public void testMultiCase_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/multiCase.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("nullReceiver.kt") + public void testNullReceiver_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/nullReceiver.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("nullReceiver.kt") + public void testNullReceiver_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/nullReceiver.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("objectReceiver.kt") + public void testObjectReceiver_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/objectReceiver.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("objectReceiver.kt") + public void testObjectReceiver_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/objectReceiver.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("primitiveReceiver.kt") + public void testPrimitiveReceiver_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/primitiveReceiver.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("primitiveReceiver.kt") + public void testPrimitiveReceiver_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/primitiveReceiver.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("smartCastForExtensionReceiver.kt") + public void testSmartCastForExtensionReceiver_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/smartCastForExtensionReceiver.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("smartCastForExtensionReceiver.kt") + public void testSmartCastForExtensionReceiver_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/smartCastForExtensionReceiver.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/equals") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Equals extends AbstractIrBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInEquals() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/equals"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("nullableReceiverInEquals.kt") + public void testNullableReceiverInEquals_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/equals/nullableReceiverInEquals.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("nullableReceiverInEquals.kt") + public void testNullableReceiverInEquals_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/equals/nullableReceiverInEquals.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("receiverInEquals.kt") + public void testReceiverInEquals_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/equals/receiverInEquals.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("receiverInEquals.kt") + public void testReceiverInEquals_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/equals/receiverInEquals.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("reflectionReference.kt") + public void testReflectionReference_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/equals/reflectionReference.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("reflectionReference.kt") + public void testReflectionReference_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/equals/reflectionReference.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + } + + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/inline") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Inline extends AbstractIrBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInInline() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/inline"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("simpleVal.kt") + public void testSimpleVal_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/inline/simpleVal.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("simpleVal.kt") + public void testSimpleVal_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/inline/simpleVal.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("simple.kt") + public void testSimple_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/inline/simple.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("simple.kt") + public void testSimple_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/inline/simple.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + } + } + + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Function extends AbstractIrBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + @TestMetadata("abstractClassMember.kt") + public void testAbstractClassMember_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/abstractClassMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("abstractClassMember.kt") + public void testAbstractClassMember_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/abstractClassMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + public void testAllFilesPresentInFunction() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("classMemberFromClass.kt") + public void testClassMemberFromClass_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromClass.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("classMemberFromClass.kt") + public void testClassMemberFromClass_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromClass.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("classMemberFromExtension.kt") + public void testClassMemberFromExtension_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromExtension.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("classMemberFromExtension.kt") + public void testClassMemberFromExtension_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromExtension.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("classMemberFromTopLevelStringNoArgs.kt") + public void testClassMemberFromTopLevelStringNoArgs_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelStringNoArgs.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("classMemberFromTopLevelStringNoArgs.kt") + public void testClassMemberFromTopLevelStringNoArgs_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelStringNoArgs.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("classMemberFromTopLevelStringOneStringArg.kt") + public void testClassMemberFromTopLevelStringOneStringArg_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelStringOneStringArg.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("classMemberFromTopLevelStringOneStringArg.kt") + public void testClassMemberFromTopLevelStringOneStringArg_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelStringOneStringArg.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("classMemberFromTopLevelUnitNoArgs.kt") + public void testClassMemberFromTopLevelUnitNoArgs_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelUnitNoArgs.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("classMemberFromTopLevelUnitNoArgs.kt") + public void testClassMemberFromTopLevelUnitNoArgs_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelUnitNoArgs.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("classMemberFromTopLevelUnitOneStringArg.kt") + public void testClassMemberFromTopLevelUnitOneStringArg_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelUnitOneStringArg.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("classMemberFromTopLevelUnitOneStringArg.kt") + public void testClassMemberFromTopLevelUnitOneStringArg_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelUnitOneStringArg.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("extensionFromClass.kt") + public void testExtensionFromClass_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromClass.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("extensionFromClass.kt") + public void testExtensionFromClass_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromClass.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("extensionFromExtension.kt") + public void testExtensionFromExtension_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromExtension.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("extensionFromExtension.kt") + public void testExtensionFromExtension_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromExtension.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("extensionFromTopLevelStringNoArgs.kt") + public void testExtensionFromTopLevelStringNoArgs_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelStringNoArgs.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("extensionFromTopLevelStringNoArgs.kt") + public void testExtensionFromTopLevelStringNoArgs_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelStringNoArgs.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("extensionFromTopLevelStringOneStringArg.kt") + public void testExtensionFromTopLevelStringOneStringArg_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelStringOneStringArg.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("extensionFromTopLevelStringOneStringArg.kt") + public void testExtensionFromTopLevelStringOneStringArg_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelStringOneStringArg.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("extensionFromTopLevelUnitNoArgs.kt") + public void testExtensionFromTopLevelUnitNoArgs_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelUnitNoArgs.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("extensionFromTopLevelUnitNoArgs.kt") + public void testExtensionFromTopLevelUnitNoArgs_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelUnitNoArgs.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("extensionFromTopLevelUnitOneStringArg.kt") + public void testExtensionFromTopLevelUnitOneStringArg_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelUnitOneStringArg.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("extensionFromTopLevelUnitOneStringArg.kt") + public void testExtensionFromTopLevelUnitOneStringArg_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelUnitOneStringArg.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("genericCallableReferenceArguments.kt") + public void testGenericCallableReferenceArguments_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferenceArguments.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("genericCallableReferenceArguments.kt") + public void testGenericCallableReferenceArguments_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferenceArguments.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("genericCallableReferencesWithNullableTypes.kt") + public void testGenericCallableReferencesWithNullableTypes_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithNullableTypes.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("genericCallableReferencesWithNullableTypes.kt") + public void testGenericCallableReferencesWithNullableTypes_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithNullableTypes.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("genericCallableReferencesWithOverload.kt") + public void testGenericCallableReferencesWithOverload_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithOverload.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("genericCallableReferencesWithOverload.kt") + public void testGenericCallableReferencesWithOverload_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithOverload.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("genericMember.kt") + public void testGenericMember_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("genericMember.kt") + public void testGenericMember_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("getArityViaFunctionImpl.kt") + public void testGetArityViaFunctionImpl() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/getArityViaFunctionImpl.kt"); + } + + @TestMetadata("overloadedFunVsVal.kt") + public void testOverloadedFunVsVal_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/overloadedFunVsVal.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("overloadedFunVsVal.kt") + public void testOverloadedFunVsVal_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/overloadedFunVsVal.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("overloadedFun.kt") + public void testOverloadedFun_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/overloadedFun.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("overloadedFun.kt") + public void testOverloadedFun_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/overloadedFun.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("privateClassMember.kt") + public void testPrivateClassMember_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/privateClassMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("privateClassMember.kt") + public void testPrivateClassMember_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/privateClassMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("specialCalls.kt") + public void testSpecialCalls_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/specialCalls.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("specialCalls.kt") + public void testSpecialCalls_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/specialCalls.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("topLevelFromClass.kt") + public void testTopLevelFromClass_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromClass.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("topLevelFromClass.kt") + public void testTopLevelFromClass_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromClass.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("topLevelFromExtension.kt") + public void testTopLevelFromExtension_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromExtension.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("topLevelFromExtension.kt") + public void testTopLevelFromExtension_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromExtension.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("topLevelFromTopLevelStringNoArgs.kt") + public void testTopLevelFromTopLevelStringNoArgs_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelStringNoArgs.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("topLevelFromTopLevelStringNoArgs.kt") + public void testTopLevelFromTopLevelStringNoArgs_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelStringNoArgs.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("topLevelFromTopLevelStringOneStringArg.kt") + public void testTopLevelFromTopLevelStringOneStringArg_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelStringOneStringArg.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("topLevelFromTopLevelStringOneStringArg.kt") + public void testTopLevelFromTopLevelStringOneStringArg_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelStringOneStringArg.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("topLevelFromTopLevelUnitNoArgs.kt") + public void testTopLevelFromTopLevelUnitNoArgs_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelUnitNoArgs.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("topLevelFromTopLevelUnitNoArgs.kt") + public void testTopLevelFromTopLevelUnitNoArgs_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelUnitNoArgs.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("topLevelFromTopLevelUnitOneStringArg.kt") + public void testTopLevelFromTopLevelUnitOneStringArg_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelUnitOneStringArg.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("topLevelFromTopLevelUnitOneStringArg.kt") + public void testTopLevelFromTopLevelUnitOneStringArg_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelUnitOneStringArg.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("traitImplMethodWithClassReceiver.kt") + public void testTraitImplMethodWithClassReceiver_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/traitImplMethodWithClassReceiver.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("traitImplMethodWithClassReceiver.kt") + public void testTraitImplMethodWithClassReceiver_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/traitImplMethodWithClassReceiver.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("traitMember.kt") + public void testTraitMember_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/traitMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("traitMember.kt") + public void testTraitMember_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/traitMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Local extends AbstractIrBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInLocal() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("captureOuter.kt") + public void testCaptureOuter_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/captureOuter.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("captureOuter.kt") + public void testCaptureOuter_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/captureOuter.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("classMember.kt") + public void testClassMember_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/classMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("classMember.kt") + public void testClassMember_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/classMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("closureWithSideEffect.kt") + public void testClosureWithSideEffect_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/closureWithSideEffect.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("closureWithSideEffect.kt") + public void testClosureWithSideEffect_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/closureWithSideEffect.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("enumExtendsTrait.kt") + public void testEnumExtendsTrait_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/enumExtendsTrait.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("enumExtendsTrait.kt") + public void testEnumExtendsTrait_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/enumExtendsTrait.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("equalsHashCode.kt") + public void testEqualsHashCode_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/equalsHashCode.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("equalsHashCode.kt") + public void testEqualsHashCode_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/equalsHashCode.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("extensionToLocalClass.kt") + public void testExtensionToLocalClass_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extensionToLocalClass.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("extensionToLocalClass.kt") + public void testExtensionToLocalClass_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extensionToLocalClass.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("extensionToPrimitive.kt") + public void testExtensionToPrimitive_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extensionToPrimitive.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("extensionToPrimitive.kt") + public void testExtensionToPrimitive_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extensionToPrimitive.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("extensionWithClosure.kt") + public void testExtensionWithClosure_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extensionWithClosure.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("extensionWithClosure.kt") + public void testExtensionWithClosure_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extensionWithClosure.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("extension.kt") + public void testExtension_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extension.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("extension.kt") + public void testExtension_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extension.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("genericMember.kt") + public void testGenericMember_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/genericMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("genericMember.kt") + public void testGenericMember_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/genericMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("localClassMember.kt") + public void testLocalClassMember_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/localClassMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("localClassMember.kt") + public void testLocalClassMember_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/localClassMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("localFunctionName.kt") + public void testLocalFunctionName_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/localFunctionName.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("localFunctionName.kt") + public void testLocalFunctionName_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/localFunctionName.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("localLocal.kt") + public void testLocalLocal_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/localLocal.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("localLocal.kt") + public void testLocalLocal_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/localLocal.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("simpleClosure.kt") + public void testSimpleClosure_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/simpleClosure.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("simpleClosure.kt") + public void testSimpleClosure_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/simpleClosure.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("simpleWithArg.kt") + public void testSimpleWithArg_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/simpleWithArg.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("simpleWithArg.kt") + public void testSimpleWithArg_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/simpleWithArg.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("simple.kt") + public void testSimple_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/simple.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("simple.kt") + public void testSimple_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/simple.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("unitWithSideEffect.kt") + public void testUnitWithSideEffect_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/unitWithSideEffect.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("unitWithSideEffect.kt") + public void testUnitWithSideEffect_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/unitWithSideEffect.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + } + } + + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Serializability extends AbstractIrBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInSerializability() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("noReflect.kt") + public void testNoReflect_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability/noReflect.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("noReflect.kt") + public void testNoReflect_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability/noReflect.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("reflectedIsNotSerialized.kt") + public void testReflectedIsNotSerialized_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability/reflectedIsNotSerialized.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("reflectedIsNotSerialized.kt") + public void testReflectedIsNotSerialized_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability/reflectedIsNotSerialized.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("withReflect.kt") + public void testWithReflect_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability/withReflect.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("withReflect.kt") + public void testWithReflect_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability/withReflect.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + } + } + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java index 5dc8f1f2a74..94a340dcb74 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java @@ -6282,6 +6282,863 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlus.kt", "kotlin.coroutines"); } + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class CallableReference extends AbstractBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInCallableReference() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Bound extends AbstractBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInBound() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("companionObjectReceiver.kt") + public void testCompanionObjectReceiver_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/companionObjectReceiver.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("companionObjectReceiver.kt") + public void testCompanionObjectReceiver_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/companionObjectReceiver.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("coroutineContext.kt") + public void testCoroutineContext_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/coroutineContext.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("coroutineContext.kt") + public void testCoroutineContext_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/coroutineContext.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("emptyLHS.kt") + public void testEmptyLHS() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/emptyLHS.kt"); + } + + @TestMetadata("enumEntryMember.kt") + public void testEnumEntryMember_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/enumEntryMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("enumEntryMember.kt") + public void testEnumEntryMember_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/enumEntryMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("localUnitFunction.kt") + public void testLocalUnitFunction_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/localUnitFunction.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("localUnitFunction.kt") + public void testLocalUnitFunction_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/localUnitFunction.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("multiCase.kt") + public void testMultiCase_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/multiCase.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("multiCase.kt") + public void testMultiCase_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/multiCase.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("nullReceiver.kt") + public void testNullReceiver_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/nullReceiver.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("nullReceiver.kt") + public void testNullReceiver_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/nullReceiver.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("objectReceiver.kt") + public void testObjectReceiver_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/objectReceiver.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("objectReceiver.kt") + public void testObjectReceiver_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/objectReceiver.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("primitiveReceiver.kt") + public void testPrimitiveReceiver_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/primitiveReceiver.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("primitiveReceiver.kt") + public void testPrimitiveReceiver_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/primitiveReceiver.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("smartCastForExtensionReceiver.kt") + public void testSmartCastForExtensionReceiver_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/smartCastForExtensionReceiver.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("smartCastForExtensionReceiver.kt") + public void testSmartCastForExtensionReceiver_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/smartCastForExtensionReceiver.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/equals") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Equals extends AbstractBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInEquals() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/equals"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("nullableReceiverInEquals.kt") + public void testNullableReceiverInEquals_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/equals/nullableReceiverInEquals.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("nullableReceiverInEquals.kt") + public void testNullableReceiverInEquals_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/equals/nullableReceiverInEquals.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("receiverInEquals.kt") + public void testReceiverInEquals_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/equals/receiverInEquals.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("receiverInEquals.kt") + public void testReceiverInEquals_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/equals/receiverInEquals.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("reflectionReference.kt") + public void testReflectionReference_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/equals/reflectionReference.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("reflectionReference.kt") + public void testReflectionReference_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/equals/reflectionReference.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + } + + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/inline") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Inline extends AbstractBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInInline() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/inline"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("simpleVal.kt") + public void testSimpleVal_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/inline/simpleVal.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("simpleVal.kt") + public void testSimpleVal_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/inline/simpleVal.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("simple.kt") + public void testSimple_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/inline/simple.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("simple.kt") + public void testSimple_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/inline/simple.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + } + } + + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Function extends AbstractBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + @TestMetadata("abstractClassMember.kt") + public void testAbstractClassMember_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/abstractClassMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("abstractClassMember.kt") + public void testAbstractClassMember_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/abstractClassMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + public void testAllFilesPresentInFunction() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("classMemberFromClass.kt") + public void testClassMemberFromClass_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromClass.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("classMemberFromClass.kt") + public void testClassMemberFromClass_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromClass.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("classMemberFromExtension.kt") + public void testClassMemberFromExtension_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromExtension.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("classMemberFromExtension.kt") + public void testClassMemberFromExtension_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromExtension.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("classMemberFromTopLevelStringNoArgs.kt") + public void testClassMemberFromTopLevelStringNoArgs_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelStringNoArgs.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("classMemberFromTopLevelStringNoArgs.kt") + public void testClassMemberFromTopLevelStringNoArgs_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelStringNoArgs.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("classMemberFromTopLevelStringOneStringArg.kt") + public void testClassMemberFromTopLevelStringOneStringArg_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelStringOneStringArg.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("classMemberFromTopLevelStringOneStringArg.kt") + public void testClassMemberFromTopLevelStringOneStringArg_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelStringOneStringArg.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("classMemberFromTopLevelUnitNoArgs.kt") + public void testClassMemberFromTopLevelUnitNoArgs_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelUnitNoArgs.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("classMemberFromTopLevelUnitNoArgs.kt") + public void testClassMemberFromTopLevelUnitNoArgs_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelUnitNoArgs.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("classMemberFromTopLevelUnitOneStringArg.kt") + public void testClassMemberFromTopLevelUnitOneStringArg_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelUnitOneStringArg.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("classMemberFromTopLevelUnitOneStringArg.kt") + public void testClassMemberFromTopLevelUnitOneStringArg_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelUnitOneStringArg.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("extensionFromClass.kt") + public void testExtensionFromClass_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromClass.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("extensionFromClass.kt") + public void testExtensionFromClass_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromClass.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("extensionFromExtension.kt") + public void testExtensionFromExtension_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromExtension.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("extensionFromExtension.kt") + public void testExtensionFromExtension_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromExtension.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("extensionFromTopLevelStringNoArgs.kt") + public void testExtensionFromTopLevelStringNoArgs_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelStringNoArgs.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("extensionFromTopLevelStringNoArgs.kt") + public void testExtensionFromTopLevelStringNoArgs_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelStringNoArgs.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("extensionFromTopLevelStringOneStringArg.kt") + public void testExtensionFromTopLevelStringOneStringArg_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelStringOneStringArg.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("extensionFromTopLevelStringOneStringArg.kt") + public void testExtensionFromTopLevelStringOneStringArg_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelStringOneStringArg.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("extensionFromTopLevelUnitNoArgs.kt") + public void testExtensionFromTopLevelUnitNoArgs_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelUnitNoArgs.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("extensionFromTopLevelUnitNoArgs.kt") + public void testExtensionFromTopLevelUnitNoArgs_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelUnitNoArgs.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("extensionFromTopLevelUnitOneStringArg.kt") + public void testExtensionFromTopLevelUnitOneStringArg_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelUnitOneStringArg.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("extensionFromTopLevelUnitOneStringArg.kt") + public void testExtensionFromTopLevelUnitOneStringArg_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelUnitOneStringArg.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("genericCallableReferenceArguments.kt") + public void testGenericCallableReferenceArguments_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferenceArguments.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("genericCallableReferenceArguments.kt") + public void testGenericCallableReferenceArguments_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferenceArguments.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("genericCallableReferencesWithNullableTypes.kt") + public void testGenericCallableReferencesWithNullableTypes_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithNullableTypes.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("genericCallableReferencesWithNullableTypes.kt") + public void testGenericCallableReferencesWithNullableTypes_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithNullableTypes.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("genericCallableReferencesWithOverload.kt") + public void testGenericCallableReferencesWithOverload_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithOverload.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("genericCallableReferencesWithOverload.kt") + public void testGenericCallableReferencesWithOverload_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithOverload.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("genericMember.kt") + public void testGenericMember_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("genericMember.kt") + public void testGenericMember_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("getArityViaFunctionImpl.kt") + public void testGetArityViaFunctionImpl() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/getArityViaFunctionImpl.kt"); + } + + @TestMetadata("overloadedFunVsVal.kt") + public void testOverloadedFunVsVal_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/overloadedFunVsVal.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("overloadedFunVsVal.kt") + public void testOverloadedFunVsVal_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/overloadedFunVsVal.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("overloadedFun.kt") + public void testOverloadedFun_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/overloadedFun.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("overloadedFun.kt") + public void testOverloadedFun_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/overloadedFun.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("privateClassMember.kt") + public void testPrivateClassMember_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/privateClassMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("privateClassMember.kt") + public void testPrivateClassMember_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/privateClassMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("specialCalls.kt") + public void testSpecialCalls_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/specialCalls.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("specialCalls.kt") + public void testSpecialCalls_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/specialCalls.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("topLevelFromClass.kt") + public void testTopLevelFromClass_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromClass.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("topLevelFromClass.kt") + public void testTopLevelFromClass_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromClass.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("topLevelFromExtension.kt") + public void testTopLevelFromExtension_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromExtension.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("topLevelFromExtension.kt") + public void testTopLevelFromExtension_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromExtension.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("topLevelFromTopLevelStringNoArgs.kt") + public void testTopLevelFromTopLevelStringNoArgs_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelStringNoArgs.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("topLevelFromTopLevelStringNoArgs.kt") + public void testTopLevelFromTopLevelStringNoArgs_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelStringNoArgs.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("topLevelFromTopLevelStringOneStringArg.kt") + public void testTopLevelFromTopLevelStringOneStringArg_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelStringOneStringArg.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("topLevelFromTopLevelStringOneStringArg.kt") + public void testTopLevelFromTopLevelStringOneStringArg_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelStringOneStringArg.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("topLevelFromTopLevelUnitNoArgs.kt") + public void testTopLevelFromTopLevelUnitNoArgs_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelUnitNoArgs.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("topLevelFromTopLevelUnitNoArgs.kt") + public void testTopLevelFromTopLevelUnitNoArgs_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelUnitNoArgs.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("topLevelFromTopLevelUnitOneStringArg.kt") + public void testTopLevelFromTopLevelUnitOneStringArg_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelUnitOneStringArg.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("topLevelFromTopLevelUnitOneStringArg.kt") + public void testTopLevelFromTopLevelUnitOneStringArg_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelUnitOneStringArg.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("traitImplMethodWithClassReceiver.kt") + public void testTraitImplMethodWithClassReceiver_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/traitImplMethodWithClassReceiver.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("traitImplMethodWithClassReceiver.kt") + public void testTraitImplMethodWithClassReceiver_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/traitImplMethodWithClassReceiver.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("traitMember.kt") + public void testTraitMember_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/traitMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("traitMember.kt") + public void testTraitMember_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/traitMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Local extends AbstractBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInLocal() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("captureOuter.kt") + public void testCaptureOuter_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/captureOuter.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("captureOuter.kt") + public void testCaptureOuter_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/captureOuter.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("classMember.kt") + public void testClassMember_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/classMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("classMember.kt") + public void testClassMember_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/classMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("closureWithSideEffect.kt") + public void testClosureWithSideEffect_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/closureWithSideEffect.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("closureWithSideEffect.kt") + public void testClosureWithSideEffect_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/closureWithSideEffect.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("enumExtendsTrait.kt") + public void testEnumExtendsTrait_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/enumExtendsTrait.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("enumExtendsTrait.kt") + public void testEnumExtendsTrait_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/enumExtendsTrait.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("equalsHashCode.kt") + public void testEqualsHashCode_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/equalsHashCode.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("equalsHashCode.kt") + public void testEqualsHashCode_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/equalsHashCode.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("extensionToLocalClass.kt") + public void testExtensionToLocalClass_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extensionToLocalClass.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("extensionToLocalClass.kt") + public void testExtensionToLocalClass_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extensionToLocalClass.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("extensionToPrimitive.kt") + public void testExtensionToPrimitive_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extensionToPrimitive.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("extensionToPrimitive.kt") + public void testExtensionToPrimitive_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extensionToPrimitive.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("extensionWithClosure.kt") + public void testExtensionWithClosure_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extensionWithClosure.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("extensionWithClosure.kt") + public void testExtensionWithClosure_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extensionWithClosure.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("extension.kt") + public void testExtension_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extension.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("extension.kt") + public void testExtension_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extension.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("genericMember.kt") + public void testGenericMember_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/genericMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("genericMember.kt") + public void testGenericMember_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/genericMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("localClassMember.kt") + public void testLocalClassMember_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/localClassMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("localClassMember.kt") + public void testLocalClassMember_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/localClassMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("localFunctionName.kt") + public void testLocalFunctionName_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/localFunctionName.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("localFunctionName.kt") + public void testLocalFunctionName_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/localFunctionName.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("localLocal.kt") + public void testLocalLocal_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/localLocal.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("localLocal.kt") + public void testLocalLocal_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/localLocal.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("simpleClosure.kt") + public void testSimpleClosure_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/simpleClosure.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("simpleClosure.kt") + public void testSimpleClosure_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/simpleClosure.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("simpleWithArg.kt") + public void testSimpleWithArg_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/simpleWithArg.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("simpleWithArg.kt") + public void testSimpleWithArg_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/simpleWithArg.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("simple.kt") + public void testSimple_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/simple.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("simple.kt") + public void testSimple_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/simple.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("unitWithSideEffect.kt") + public void testUnitWithSideEffect_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/unitWithSideEffect.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("unitWithSideEffect.kt") + public void testUnitWithSideEffect_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/unitWithSideEffect.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + } + } + + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Serializability extends AbstractBlackBoxCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInSerializability() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("noReflect.kt") + public void testNoReflect_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability/noReflect.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("noReflect.kt") + public void testNoReflect_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability/noReflect.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("reflectedIsNotSerialized.kt") + public void testReflectedIsNotSerialized_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability/reflectedIsNotSerialized.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("reflectedIsNotSerialized.kt") + public void testReflectedIsNotSerialized_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability/reflectedIsNotSerialized.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("withReflect.kt") + public void testWithReflect_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability/withReflect.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("withReflect.kt") + public void testWithReflect_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability/withReflect.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + } + } + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 9bac11f38a0..40b719ca70d 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -6282,6 +6282,863 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlus.kt", "kotlin.coroutines"); } + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class CallableReference extends AbstractLightAnalysisModeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInCallableReference() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Bound extends AbstractLightAnalysisModeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInBound() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("companionObjectReceiver.kt") + public void testCompanionObjectReceiver_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/companionObjectReceiver.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("companionObjectReceiver.kt") + public void testCompanionObjectReceiver_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/companionObjectReceiver.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("coroutineContext.kt") + public void testCoroutineContext_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/coroutineContext.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("coroutineContext.kt") + public void testCoroutineContext_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/coroutineContext.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("emptyLHS.kt") + public void testEmptyLHS() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/emptyLHS.kt"); + } + + @TestMetadata("enumEntryMember.kt") + public void testEnumEntryMember_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/enumEntryMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("enumEntryMember.kt") + public void testEnumEntryMember_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/enumEntryMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("localUnitFunction.kt") + public void testLocalUnitFunction_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/localUnitFunction.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("localUnitFunction.kt") + public void testLocalUnitFunction_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/localUnitFunction.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("multiCase.kt") + public void testMultiCase_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/multiCase.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("multiCase.kt") + public void testMultiCase_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/multiCase.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("nullReceiver.kt") + public void testNullReceiver_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/nullReceiver.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("nullReceiver.kt") + public void testNullReceiver_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/nullReceiver.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("objectReceiver.kt") + public void testObjectReceiver_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/objectReceiver.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("objectReceiver.kt") + public void testObjectReceiver_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/objectReceiver.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("primitiveReceiver.kt") + public void testPrimitiveReceiver_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/primitiveReceiver.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("primitiveReceiver.kt") + public void testPrimitiveReceiver_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/primitiveReceiver.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("smartCastForExtensionReceiver.kt") + public void testSmartCastForExtensionReceiver_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/smartCastForExtensionReceiver.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("smartCastForExtensionReceiver.kt") + public void testSmartCastForExtensionReceiver_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/smartCastForExtensionReceiver.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/equals") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Equals extends AbstractLightAnalysisModeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInEquals() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/equals"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("nullableReceiverInEquals.kt") + public void testNullableReceiverInEquals_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/equals/nullableReceiverInEquals.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("nullableReceiverInEquals.kt") + public void testNullableReceiverInEquals_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/equals/nullableReceiverInEquals.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("receiverInEquals.kt") + public void testReceiverInEquals_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/equals/receiverInEquals.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("receiverInEquals.kt") + public void testReceiverInEquals_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/equals/receiverInEquals.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("reflectionReference.kt") + public void testReflectionReference_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/equals/reflectionReference.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("reflectionReference.kt") + public void testReflectionReference_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/equals/reflectionReference.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + } + + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/inline") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Inline extends AbstractLightAnalysisModeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInInline() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/inline"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("simpleVal.kt") + public void testSimpleVal_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/inline/simpleVal.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("simpleVal.kt") + public void testSimpleVal_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/inline/simpleVal.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("simple.kt") + public void testSimple_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/inline/simple.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("simple.kt") + public void testSimple_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/inline/simple.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + } + } + + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Function extends AbstractLightAnalysisModeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + @TestMetadata("abstractClassMember.kt") + public void testAbstractClassMember_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/abstractClassMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("abstractClassMember.kt") + public void testAbstractClassMember_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/abstractClassMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + public void testAllFilesPresentInFunction() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("classMemberFromClass.kt") + public void testClassMemberFromClass_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromClass.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("classMemberFromClass.kt") + public void testClassMemberFromClass_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromClass.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("classMemberFromExtension.kt") + public void testClassMemberFromExtension_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromExtension.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("classMemberFromExtension.kt") + public void testClassMemberFromExtension_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromExtension.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("classMemberFromTopLevelStringNoArgs.kt") + public void testClassMemberFromTopLevelStringNoArgs_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelStringNoArgs.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("classMemberFromTopLevelStringNoArgs.kt") + public void testClassMemberFromTopLevelStringNoArgs_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelStringNoArgs.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("classMemberFromTopLevelStringOneStringArg.kt") + public void testClassMemberFromTopLevelStringOneStringArg_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelStringOneStringArg.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("classMemberFromTopLevelStringOneStringArg.kt") + public void testClassMemberFromTopLevelStringOneStringArg_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelStringOneStringArg.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("classMemberFromTopLevelUnitNoArgs.kt") + public void testClassMemberFromTopLevelUnitNoArgs_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelUnitNoArgs.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("classMemberFromTopLevelUnitNoArgs.kt") + public void testClassMemberFromTopLevelUnitNoArgs_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelUnitNoArgs.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("classMemberFromTopLevelUnitOneStringArg.kt") + public void testClassMemberFromTopLevelUnitOneStringArg_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelUnitOneStringArg.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("classMemberFromTopLevelUnitOneStringArg.kt") + public void testClassMemberFromTopLevelUnitOneStringArg_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelUnitOneStringArg.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("extensionFromClass.kt") + public void testExtensionFromClass_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromClass.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("extensionFromClass.kt") + public void testExtensionFromClass_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromClass.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("extensionFromExtension.kt") + public void testExtensionFromExtension_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromExtension.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("extensionFromExtension.kt") + public void testExtensionFromExtension_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromExtension.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("extensionFromTopLevelStringNoArgs.kt") + public void testExtensionFromTopLevelStringNoArgs_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelStringNoArgs.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("extensionFromTopLevelStringNoArgs.kt") + public void testExtensionFromTopLevelStringNoArgs_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelStringNoArgs.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("extensionFromTopLevelStringOneStringArg.kt") + public void testExtensionFromTopLevelStringOneStringArg_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelStringOneStringArg.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("extensionFromTopLevelStringOneStringArg.kt") + public void testExtensionFromTopLevelStringOneStringArg_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelStringOneStringArg.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("extensionFromTopLevelUnitNoArgs.kt") + public void testExtensionFromTopLevelUnitNoArgs_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelUnitNoArgs.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("extensionFromTopLevelUnitNoArgs.kt") + public void testExtensionFromTopLevelUnitNoArgs_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelUnitNoArgs.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("extensionFromTopLevelUnitOneStringArg.kt") + public void testExtensionFromTopLevelUnitOneStringArg_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelUnitOneStringArg.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("extensionFromTopLevelUnitOneStringArg.kt") + public void testExtensionFromTopLevelUnitOneStringArg_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelUnitOneStringArg.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("genericCallableReferenceArguments.kt") + public void testGenericCallableReferenceArguments_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferenceArguments.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("genericCallableReferenceArguments.kt") + public void testGenericCallableReferenceArguments_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferenceArguments.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("genericCallableReferencesWithNullableTypes.kt") + public void testGenericCallableReferencesWithNullableTypes_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithNullableTypes.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("genericCallableReferencesWithNullableTypes.kt") + public void testGenericCallableReferencesWithNullableTypes_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithNullableTypes.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("genericCallableReferencesWithOverload.kt") + public void testGenericCallableReferencesWithOverload_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithOverload.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("genericCallableReferencesWithOverload.kt") + public void testGenericCallableReferencesWithOverload_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithOverload.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("genericMember.kt") + public void testGenericMember_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("genericMember.kt") + public void testGenericMember_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("getArityViaFunctionImpl.kt") + public void testGetArityViaFunctionImpl() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/getArityViaFunctionImpl.kt"); + } + + @TestMetadata("overloadedFunVsVal.kt") + public void testOverloadedFunVsVal_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/overloadedFunVsVal.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("overloadedFunVsVal.kt") + public void testOverloadedFunVsVal_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/overloadedFunVsVal.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("overloadedFun.kt") + public void testOverloadedFun_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/overloadedFun.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("overloadedFun.kt") + public void testOverloadedFun_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/overloadedFun.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("privateClassMember.kt") + public void testPrivateClassMember_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/privateClassMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("privateClassMember.kt") + public void testPrivateClassMember_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/privateClassMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("specialCalls.kt") + public void testSpecialCalls_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/specialCalls.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("specialCalls.kt") + public void testSpecialCalls_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/specialCalls.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("topLevelFromClass.kt") + public void testTopLevelFromClass_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromClass.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("topLevelFromClass.kt") + public void testTopLevelFromClass_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromClass.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("topLevelFromExtension.kt") + public void testTopLevelFromExtension_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromExtension.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("topLevelFromExtension.kt") + public void testTopLevelFromExtension_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromExtension.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("topLevelFromTopLevelStringNoArgs.kt") + public void testTopLevelFromTopLevelStringNoArgs_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelStringNoArgs.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("topLevelFromTopLevelStringNoArgs.kt") + public void testTopLevelFromTopLevelStringNoArgs_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelStringNoArgs.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("topLevelFromTopLevelStringOneStringArg.kt") + public void testTopLevelFromTopLevelStringOneStringArg_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelStringOneStringArg.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("topLevelFromTopLevelStringOneStringArg.kt") + public void testTopLevelFromTopLevelStringOneStringArg_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelStringOneStringArg.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("topLevelFromTopLevelUnitNoArgs.kt") + public void testTopLevelFromTopLevelUnitNoArgs_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelUnitNoArgs.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("topLevelFromTopLevelUnitNoArgs.kt") + public void testTopLevelFromTopLevelUnitNoArgs_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelUnitNoArgs.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("topLevelFromTopLevelUnitOneStringArg.kt") + public void testTopLevelFromTopLevelUnitOneStringArg_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelUnitOneStringArg.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("topLevelFromTopLevelUnitOneStringArg.kt") + public void testTopLevelFromTopLevelUnitOneStringArg_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelUnitOneStringArg.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("traitImplMethodWithClassReceiver.kt") + public void testTraitImplMethodWithClassReceiver_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/traitImplMethodWithClassReceiver.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("traitImplMethodWithClassReceiver.kt") + public void testTraitImplMethodWithClassReceiver_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/traitImplMethodWithClassReceiver.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("traitMember.kt") + public void testTraitMember_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/traitMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("traitMember.kt") + public void testTraitMember_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/traitMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Local extends AbstractLightAnalysisModeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInLocal() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("captureOuter.kt") + public void testCaptureOuter_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/captureOuter.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("captureOuter.kt") + public void testCaptureOuter_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/captureOuter.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("classMember.kt") + public void testClassMember_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/classMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("classMember.kt") + public void testClassMember_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/classMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("closureWithSideEffect.kt") + public void testClosureWithSideEffect_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/closureWithSideEffect.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("closureWithSideEffect.kt") + public void testClosureWithSideEffect_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/closureWithSideEffect.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("enumExtendsTrait.kt") + public void testEnumExtendsTrait_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/enumExtendsTrait.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("enumExtendsTrait.kt") + public void testEnumExtendsTrait_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/enumExtendsTrait.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("equalsHashCode.kt") + public void testEqualsHashCode_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/equalsHashCode.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("equalsHashCode.kt") + public void testEqualsHashCode_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/equalsHashCode.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("extensionToLocalClass.kt") + public void testExtensionToLocalClass_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extensionToLocalClass.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("extensionToLocalClass.kt") + public void testExtensionToLocalClass_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extensionToLocalClass.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("extensionToPrimitive.kt") + public void testExtensionToPrimitive_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extensionToPrimitive.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("extensionToPrimitive.kt") + public void testExtensionToPrimitive_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extensionToPrimitive.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("extensionWithClosure.kt") + public void testExtensionWithClosure_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extensionWithClosure.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("extensionWithClosure.kt") + public void testExtensionWithClosure_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extensionWithClosure.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("extension.kt") + public void testExtension_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extension.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("extension.kt") + public void testExtension_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extension.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("genericMember.kt") + public void testGenericMember_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/genericMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("genericMember.kt") + public void testGenericMember_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/genericMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("localClassMember.kt") + public void testLocalClassMember_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/localClassMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("localClassMember.kt") + public void testLocalClassMember_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/localClassMember.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("localFunctionName.kt") + public void testLocalFunctionName_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/localFunctionName.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("localFunctionName.kt") + public void testLocalFunctionName_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/localFunctionName.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("localLocal.kt") + public void testLocalLocal_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/localLocal.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("localLocal.kt") + public void testLocalLocal_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/localLocal.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("simpleClosure.kt") + public void testSimpleClosure_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/simpleClosure.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("simpleClosure.kt") + public void testSimpleClosure_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/simpleClosure.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("simpleWithArg.kt") + public void testSimpleWithArg_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/simpleWithArg.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("simpleWithArg.kt") + public void testSimpleWithArg_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/simpleWithArg.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("simple.kt") + public void testSimple_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/simple.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("simple.kt") + public void testSimple_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/simple.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("unitWithSideEffect.kt") + public void testUnitWithSideEffect_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/unitWithSideEffect.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("unitWithSideEffect.kt") + public void testUnitWithSideEffect_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/unitWithSideEffect.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + } + } + + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Serializability extends AbstractLightAnalysisModeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInSerializability() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + } + + @TestMetadata("noReflect.kt") + public void testNoReflect_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability/noReflect.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("noReflect.kt") + public void testNoReflect_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability/noReflect.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("reflectedIsNotSerialized.kt") + public void testReflectedIsNotSerialized_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability/reflectedIsNotSerialized.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("reflectedIsNotSerialized.kt") + public void testReflectedIsNotSerialized_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability/reflectedIsNotSerialized.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("withReflect.kt") + public void testWithReflect_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability/withReflect.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("withReflect.kt") + public void testWithReflect_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability/withReflect.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + } + } + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/core/descriptors.jvm/src/org/jetbrains/kotlin/platform/JavaToKotlinClassMap.kt b/core/descriptors.jvm/src/org/jetbrains/kotlin/platform/JavaToKotlinClassMap.kt index e93d89f69b1..6de26dc26a8 100644 --- a/core/descriptors.jvm/src/org/jetbrains/kotlin/platform/JavaToKotlinClassMap.kt +++ b/core/descriptors.jvm/src/org/jetbrains/kotlin/platform/JavaToKotlinClassMap.kt @@ -96,6 +96,13 @@ object JavaToKotlinClassMap : PlatformToKotlinClassMap { val kFun = kFunction.packageFqName.toString() + "." + kFunction.classNamePrefix addKotlinToJava(FqName(kFun + i), ClassId.topLevel(FqName(kFun))) } + for (i in 0 until 22) { + val kSuspendFunction = FunctionClassDescriptor.Kind.KSuspendFunction + val kFunction = FunctionClassDescriptor.Kind.KFunction + val kSuspendFun = kSuspendFunction.packageFqName.toString() + "." + kSuspendFunction.classNamePrefix + val kFun = kFunction.packageFqName.toString() + "." + kFunction.classNamePrefix + addKotlinToJava(FqName(kSuspendFun + i), ClassId.topLevel(FqName(kFun))) + } addKotlinToJava(FQ_NAMES.nothing.toSafe(), classId(Void::class.java)) } diff --git a/core/descriptors/src/org/jetbrains/kotlin/builtins/ReflectionTypes.kt b/core/descriptors/src/org/jetbrains/kotlin/builtins/ReflectionTypes.kt index 4a6f0ea5c19..b11e018a27f 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/builtins/ReflectionTypes.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/builtins/ReflectionTypes.kt @@ -30,6 +30,7 @@ import kotlin.reflect.KProperty val KOTLIN_REFLECT_FQ_NAME = FqName("kotlin.reflect") val K_FUNCTION_PREFIX = "KFunction" +val K_SUSPEND_FUNCTION_PREFIX = "KSuspendFunction" class ReflectionTypes(module: ModuleDescriptor, private val notFoundClasses: NotFoundClasses) { private val kotlinReflectScope: MemberScope by lazy(LazyThreadSafetyMode.PUBLICATION) { @@ -49,6 +50,7 @@ class ReflectionTypes(module: ModuleDescriptor, private val notFoundClasses: Not } fun getKFunction(n: Int): ClassDescriptor = find("$K_FUNCTION_PREFIX$n", n + 1) + fun getKSuspendFunction(n: Int): ClassDescriptor = find("$K_SUSPEND_FUNCTION_PREFIX$n", n + 1) val kClass: ClassDescriptor by ClassLookup(1) val kProperty0: ClassDescriptor by ClassLookup(1) @@ -74,6 +76,19 @@ class ReflectionTypes(module: ModuleDescriptor, private val notFoundClasses: Not return KotlinTypeFactory.simpleNotNullType(annotations, classDescriptor, arguments) } + fun getKSuspendFunctionType( + annotations: Annotations, + receiverType: KotlinType?, + parameterTypes: List, + parameterNames: List?, + returnType: KotlinType, + builtIns: KotlinBuiltIns + ): SimpleType { + val arguments = getFunctionTypeArgumentProjections(receiverType, parameterTypes, parameterNames, returnType, builtIns) + val classDescriptor = getKSuspendFunction(arguments.size - 1 /* return type */) + return KotlinTypeFactory.simpleNotNullType(annotations, classDescriptor, arguments) + } + fun getKPropertyType(annotations: Annotations, receiverTypes: List, returnType: KotlinType, mutable: Boolean): SimpleType { val classDescriptor = when (receiverTypes.size) { 0 -> when { @@ -102,7 +117,7 @@ class ReflectionTypes(module: ModuleDescriptor, private val notFoundClasses: Not } fun isCallableType(type: KotlinType): Boolean = - type.isFunctionTypeOrSubtype || isKCallableType(type) + type.isFunctionTypeOrSubtype || type.isSuspendFunctionType || isKCallableType(type) @JvmStatic fun isNumberedKPropertyOrKMutablePropertyType(type: KotlinType): Boolean = @@ -130,9 +145,14 @@ class ReflectionTypes(module: ModuleDescriptor, private val notFoundClasses: Not val descriptor = type.constructor.declarationDescriptor as? ClassDescriptor ?: return false val shortName = descriptor.name.asString() - return shortName.length > K_FUNCTION_PREFIX.length && - shortName.startsWith(K_FUNCTION_PREFIX) && - DescriptorUtils.getFqName(descriptor).parent().toSafe() == KOTLIN_REFLECT_FQ_NAME + return (shortName.length > K_FUNCTION_PREFIX.length && shortName.startsWith(K_FUNCTION_PREFIX) || isKSuspendFunction(type)) && + DescriptorUtils.getFqName(descriptor).parent().toSafe() == KOTLIN_REFLECT_FQ_NAME + } + + fun isKSuspendFunction(type: KotlinType): Boolean { + val descriptor = type.constructor.declarationDescriptor as? ClassDescriptor ?: return false + val shortName = descriptor.name.asString() + return shortName.length > K_SUSPEND_FUNCTION_PREFIX.length && shortName.startsWith(K_SUSPEND_FUNCTION_PREFIX) } private fun hasFqName(typeConstructor: TypeConstructor, fqName: FqNameUnsafe): Boolean { @@ -162,6 +182,7 @@ class ReflectionTypes(module: ModuleDescriptor, private val notFoundClasses: Not val packageName = fqName.parent().toSafe() if (packageName == KOTLIN_REFLECT_FQ_NAME) { return shortName.startsWith("KFunction") // KFunctionN, KFunction + || shortName.startsWith("KSuspendFunction") // KPropertyN, KProperty || shortName.startsWith("KProperty") // KPropertyN, KProperty || shortName.startsWith("KMutableProperty") // KMutablePropertyN, KMutableProperty || shortName == "KCallable" || shortName == "KAnnotatedElement" @@ -169,6 +190,7 @@ class ReflectionTypes(module: ModuleDescriptor, private val notFoundClasses: Not } if (packageName == KotlinBuiltIns.BUILT_INS_PACKAGE_FQ_NAME) { return shortName.startsWith("Function") // FunctionN, Function + || shortName.startsWith("SuspendFunction") } return false diff --git a/core/descriptors/src/org/jetbrains/kotlin/builtins/functions/BuiltInFictitiousFunctionClassFactory.kt b/core/descriptors/src/org/jetbrains/kotlin/builtins/functions/BuiltInFictitiousFunctionClassFactory.kt index e141ccff1c4..cb0dfc661d0 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/builtins/functions/BuiltInFictitiousFunctionClassFactory.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/builtins/functions/BuiltInFictitiousFunctionClassFactory.kt @@ -67,7 +67,8 @@ class BuiltInFictitiousFunctionClassFactory( override fun shouldCreateClass(packageFqName: FqName, name: Name): Boolean { val string = name.asString() - return (string.startsWith("Function") || string.startsWith("KFunction")) // an optimization + return (string.startsWith("Function") || string.startsWith("KFunction") || + string.startsWith("SuspendFunction") || string.startsWith("KSuspendFunction")) // an optimization && parseClassName(string, packageFqName) != null } @@ -80,9 +81,6 @@ class BuiltInFictitiousFunctionClassFactory( val packageFqName = classId.packageFqName val (kind, arity) = parseClassName(className, packageFqName) ?: return null - // SuspendFunction$n can't be created by classId - if (kind == Kind.SuspendFunction) return null - val containingPackageFragment = module.getPackage(packageFqName).fragments.filterIsInstance().first() return FunctionClassDescriptor(storageManager, containingPackageFragment, kind, arity) diff --git a/core/descriptors/src/org/jetbrains/kotlin/builtins/functions/FunctionClassDescriptor.kt b/core/descriptors/src/org/jetbrains/kotlin/builtins/functions/FunctionClassDescriptor.kt index 9060a9984e9..01e34e72e19 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/builtins/functions/FunctionClassDescriptor.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/builtins/functions/FunctionClassDescriptor.kt @@ -39,7 +39,8 @@ class FunctionClassDescriptor( enum class Kind(val packageFqName: FqName, val classNamePrefix: String) { Function(BUILT_INS_PACKAGE_FQ_NAME, "Function"), SuspendFunction(BUILT_INS_PACKAGE_FQ_NAME, "SuspendFunction"), - KFunction(KOTLIN_REFLECT_FQ_NAME, "KFunction"); + KFunction(KOTLIN_REFLECT_FQ_NAME, "KFunction"), + KSuspendFunction(KOTLIN_REFLECT_FQ_NAME, "KSuspendFunction"); fun numberedClassName(arity: Int) = Name.identifier("$classNamePrefix$arity") @@ -118,13 +119,13 @@ class FunctionClassDescriptor( } - if (functionKind == Kind.SuspendFunction) { - // SuspendFunction$N<...> <: Any - result.add(containingDeclaration.builtIns.anyType) - } - else { - // Add unnumbered base class, e.g. Function for Function{n}, KFunction for KFunction{n} - add(containingDeclaration, Name.identifier(functionKind.classNamePrefix)) + when (functionKind) { + Kind.SuspendFunction -> // SuspendFunction$N<...> <: Function + add(containingDeclaration, Name.identifier("Function")) + Kind.KSuspendFunction -> // KSuspendFunction$N<...> <: KFunction + add(containingDeclaration, Name.identifier("KFunction")) + else -> // Add unnumbered base class, e.g. Function for Function{n}, KFunction for KFunction{n} + add(containingDeclaration, Name.identifier(functionKind.classNamePrefix)) } // For KFunction{n}, add corresponding numbered Function{n} class, e.g. Function2 for KFunction2 @@ -133,6 +134,11 @@ class FunctionClassDescriptor( val kotlinPackageFragment = packageView.fragments.filterIsInstance().first() add(kotlinPackageFragment, Kind.Function.numberedClassName(arity)) + } else if (functionKind == Kind.KSuspendFunction) { + val packageView = containingDeclaration.containingDeclaration.getPackage(BUILT_INS_PACKAGE_FQ_NAME) + val kotlinPackageFragment = packageView.fragments.filterIsInstance().first() + + add(kotlinPackageFragment, Kind.SuspendFunction.numberedClassName(arity)) } return result.toList() diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java index 4bdbeb7b43f..b70702d4811 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java @@ -5487,6 +5487,851 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/suspendOperatorPlus.kt", "kotlin.coroutines.experimental"); } + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class CallableReference extends AbstractJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInCallableReference() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + } + + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Bound extends AbstractJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInBound() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + } + + @TestMetadata("companionObjectReceiver.kt") + public void testCompanionObjectReceiver_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/companionObjectReceiver.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("coroutineContext.kt") + public void testCoroutineContext_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/coroutineContext.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("emptyLHS.kt") + public void testEmptyLHS() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/emptyLHS.kt"); + } + + @TestMetadata("enumEntryMember.kt") + public void testEnumEntryMember_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/enumEntryMember.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("multiCase.kt") + public void testMultiCase_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/multiCase.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("nullReceiver.kt") + public void testNullReceiver_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/nullReceiver.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("objectReceiver.kt") + public void testObjectReceiver_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/objectReceiver.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("primitiveReceiver.kt") + public void testPrimitiveReceiver_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/primitiveReceiver.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("smartCastForExtensionReceiver.kt") + public void testSmartCastForExtensionReceiver_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/smartCastForExtensionReceiver.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/equals") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Equals extends AbstractJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInEquals() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/equals"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + } + + @TestMetadata("nullableReceiverInEquals.kt") + public void testNullableReceiverInEquals_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/equals/nullableReceiverInEquals.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("receiverInEquals.kt") + public void testReceiverInEquals_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/equals/receiverInEquals.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("reflectionReference.kt") + public void testReflectionReference_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/equals/reflectionReference.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + } + + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/inline") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Inline extends AbstractJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInInline() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/inline"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + } + + @TestMetadata("simpleVal.kt") + public void testSimpleVal_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/inline/simpleVal.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("simple.kt") + public void testSimple_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/inline/simple.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + } + } + + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Function extends AbstractJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + @TestMetadata("abstractClassMember.kt") + public void testAbstractClassMember_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/abstractClassMember.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + public void testAllFilesPresentInFunction() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + } + + @TestMetadata("classMemberFromClass.kt") + public void testClassMemberFromClass_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromClass.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("classMemberFromExtension.kt") + public void testClassMemberFromExtension_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromExtension.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("classMemberFromTopLevelStringNoArgs.kt") + public void testClassMemberFromTopLevelStringNoArgs_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelStringNoArgs.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("classMemberFromTopLevelStringOneStringArg.kt") + public void testClassMemberFromTopLevelStringOneStringArg_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelStringOneStringArg.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("classMemberFromTopLevelUnitNoArgs.kt") + public void testClassMemberFromTopLevelUnitNoArgs_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelUnitNoArgs.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("classMemberFromTopLevelUnitOneStringArg.kt") + public void testClassMemberFromTopLevelUnitOneStringArg_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelUnitOneStringArg.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("extensionFromClass.kt") + public void testExtensionFromClass_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromClass.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("extensionFromExtension.kt") + public void testExtensionFromExtension_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromExtension.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("extensionFromTopLevelStringNoArgs.kt") + public void testExtensionFromTopLevelStringNoArgs_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelStringNoArgs.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("extensionFromTopLevelStringOneStringArg.kt") + public void testExtensionFromTopLevelStringOneStringArg_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelStringOneStringArg.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("extensionFromTopLevelUnitNoArgs.kt") + public void testExtensionFromTopLevelUnitNoArgs_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelUnitNoArgs.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("extensionFromTopLevelUnitOneStringArg.kt") + public void testExtensionFromTopLevelUnitOneStringArg_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelUnitOneStringArg.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("genericCallableReferenceArguments.kt") + public void testGenericCallableReferenceArguments_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferenceArguments.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("genericCallableReferencesWithNullableTypes.kt") + public void testGenericCallableReferencesWithNullableTypes_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithNullableTypes.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("genericCallableReferencesWithOverload.kt") + public void testGenericCallableReferencesWithOverload_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithOverload.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("genericMember.kt") + public void testGenericMember_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericMember.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("getArityViaFunctionImpl.kt") + public void testGetArityViaFunctionImpl() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/getArityViaFunctionImpl.kt"); + } + + @TestMetadata("overloadedFunVsVal.kt") + public void testOverloadedFunVsVal_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/overloadedFunVsVal.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("overloadedFun.kt") + public void testOverloadedFun_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/overloadedFun.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("privateClassMember.kt") + public void testPrivateClassMember_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/privateClassMember.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("specialCalls.kt") + public void testSpecialCalls_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/specialCalls.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("topLevelFromClass.kt") + public void testTopLevelFromClass_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromClass.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("topLevelFromExtension.kt") + public void testTopLevelFromExtension_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromExtension.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("topLevelFromTopLevelStringNoArgs.kt") + public void testTopLevelFromTopLevelStringNoArgs_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelStringNoArgs.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("topLevelFromTopLevelStringOneStringArg.kt") + public void testTopLevelFromTopLevelStringOneStringArg_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelStringOneStringArg.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("topLevelFromTopLevelUnitNoArgs.kt") + public void testTopLevelFromTopLevelUnitNoArgs_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelUnitNoArgs.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("topLevelFromTopLevelUnitOneStringArg.kt") + public void testTopLevelFromTopLevelUnitOneStringArg_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelUnitOneStringArg.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("traitImplMethodWithClassReceiver.kt") + public void testTraitImplMethodWithClassReceiver_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/traitImplMethodWithClassReceiver.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("traitMember.kt") + public void testTraitMember_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/traitMember.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Local extends AbstractJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInLocal() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + } + + @TestMetadata("captureOuter.kt") + public void testCaptureOuter_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/captureOuter.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("classMember.kt") + public void testClassMember_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/classMember.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("closureWithSideEffect.kt") + public void testClosureWithSideEffect_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/closureWithSideEffect.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("enumExtendsTrait.kt") + public void testEnumExtendsTrait_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/enumExtendsTrait.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("equalsHashCode.kt") + public void testEqualsHashCode_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/equalsHashCode.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("extensionToLocalClass.kt") + public void testExtensionToLocalClass_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extensionToLocalClass.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("extensionToPrimitive.kt") + public void testExtensionToPrimitive_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extensionToPrimitive.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("extensionWithClosure.kt") + public void testExtensionWithClosure_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extensionWithClosure.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("extension.kt") + public void testExtension_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extension.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("genericMember.kt") + public void testGenericMember_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/genericMember.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("localClassMember.kt") + public void testLocalClassMember_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/localClassMember.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("localFunctionName.kt") + public void testLocalFunctionName_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/localFunctionName.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("localLocal.kt") + public void testLocalLocal_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/localLocal.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("simpleClosure.kt") + public void testSimpleClosure_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/simpleClosure.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("simpleWithArg.kt") + public void testSimpleWithArg_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/simpleWithArg.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("simple.kt") + public void testSimple_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/simple.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("unitWithSideEffect.kt") + public void testUnitWithSideEffect_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/unitWithSideEffect.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + } + } + + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Serializability extends AbstractJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInSerializability() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + } + + @TestMetadata("noReflect.kt") + public void testNoReflect_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability/noReflect.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("reflectedIsNotSerialized.kt") + public void testReflectedIsNotSerialized_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability/reflectedIsNotSerialized.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + + @TestMetadata("withReflect.kt") + public void testWithReflect_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability/withReflect.kt"); + try { + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + catch (Throwable ignore) { + return; + } + throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that."); + } + } + } + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class)