From eea95441c510164048c7b3fe5ef7e20754989113 Mon Sep 17 00:00:00 2001 From: Ilmir Usmanov Date: Wed, 6 Jun 2018 18:54:08 +0300 Subject: [PATCH] Add diagnostics tests. Forbid callable reference to coroutineContext #KT-16908: Fixed --- .../kotlin/codegen/ExpressionCodegen.java | 6 +- .../kotlin/codegen/FunctionCodegen.java | 6 +- .../FunctionReferenceGenerationStrategy.java | 34 +- .../binding/CodegenAnnotatingVisitor.java | 89 +- .../codegen/coroutines/CoroutineCodegen.kt | 6 +- .../coroutines/coroutineCodegenUtil.kt | 6 + .../kotlin/codegen/inline/MethodInliner.kt | 26 +- .../codegen/state/KotlinTypeMapper.java | 5 +- .../kotlin/resolve/calls/CallCompleter.kt | 9 +- .../calls/checkers/coroutineCallChecker.kt | 6 +- .../calls/tower/ResolvedAtomCompleter.kt | 3 +- .../DoubleColonExpressionResolver.kt | 41 +- .../components/CallableReferenceResolution.kt | 19 +- .../bound/companionObjectReceiver.kt | 26 - .../bound/coroutineContext.kt | 16 - .../callableReference/bound/emptyLHS.kt | 4 +- .../bound/enumEntryMember.kt | 31 - .../bound/equals/nullableReceiverInEquals.kt | 25 - .../bound/equals/receiverInEquals.kt | 29 - .../bound/equals/reflectionReference.kt | 27 - .../callableReference/bound/inline/simple.kt | 24 - .../bound/inline/simpleVal.kt | 25 - .../bound/localUnitFunction.kt | 20 - .../callableReference/bound/multiCase.kt | 66 -- .../callableReference/bound/nullReceiver.kt | 22 - .../callableReference/bound/objectReceiver.kt | 24 - .../bound/primitiveReceiver.kt | 41 - .../bound/smartCastForExtensionReceiver.kt | 30 - .../function/abstractClassMember.kt | 26 - .../function/classMemberFromClass.kt | 25 - .../function/classMemberFromExtension.kt | 26 - .../classMemberFromTopLevelStringNoArgs.kt | 25 - ...assMemberFromTopLevelStringOneStringArg.kt | 25 - .../classMemberFromTopLevelUnitNoArgs.kt | 27 - ...classMemberFromTopLevelUnitOneStringArg.kt | 27 - .../function/extensionFromClass.kt | 24 - .../function/extensionFromExtension.kt | 26 - .../extensionFromTopLevelStringNoArgs.kt | 23 - ...extensionFromTopLevelStringOneStringArg.kt | 23 - .../extensionFromTopLevelUnitNoArgs.kt | 27 - .../extensionFromTopLevelUnitOneStringArg.kt | 27 - .../genericCallableReferenceArguments.kt | 6 +- ...ericCallableReferencesWithNullableTypes.kt | 4 +- .../genericCallableReferencesWithOverload.kt | 33 - .../function/genericMember.kt | 24 - .../function/local/captureOuter.kt | 27 - .../function/local/classMember.kt | 23 - .../function/local/closureWithSideEffect.kt | 22 - .../function/local/enumExtendsTrait.kt | 26 - .../function/local/extension.kt | 21 - .../function/local/extensionToLocalClass.kt | 20 - .../function/local/extensionToPrimitive.kt | 19 - .../function/local/extensionWithClosure.kt | 24 - .../function/local/genericMember.kt | 23 - .../function/local/localClassMember.kt | 26 - .../function/local/localFunctionName.kt | 9 - .../function/local/localLocal.kt | 25 - .../function/local/simple.kt | 21 - .../function/local/simpleClosure.kt | 25 - .../function/local/simpleWithArg.kt | 19 - .../function/local/unitWithSideEffect.kt | 30 - .../function/overloadedFun.kt | 42 - .../function/overloadedFunVsVal.kt | 34 - .../function/privateClassMember.kt | 26 - .../function/specialCalls.kt | 44 - .../function/topLevelFromClass.kt | 25 - .../function/topLevelFromExtension.kt | 25 - .../topLevelFromTopLevelStringNoArgs.kt | 21 - .../topLevelFromTopLevelStringOneStringArg.kt | 21 - .../topLevelFromTopLevelUnitNoArgs.kt | 24 - .../topLevelFromTopLevelUnitOneStringArg.kt | 24 - .../traitImplMethodWithClassReceiver.kt | 30 - .../callableReference/function/traitMember.kt | 28 - .../callableReference/longArgs.kt | 25 + .../serializability/noReflect.kt | 26 - .../reflectedIsNotSerialized.kt | 27 - .../serializability/withReflect.kt | 27 - .../callableReference/ordinaryParameter.kt | 39 + .../suspend/callableReference/simple.kt | 37 + .../callableReference/suspendOfOrdinary.kt | 37 + .../callableReference/invokeOutideSuspend.kt | 8 + .../callableReference/outsideSuspend.kt | 6 + .../coroutines/callableReference/property.kt | 14 + .../coroutines/callableReferences.kt | 20 +- .../modifierApplicability.kt | 2 +- .../modifierApplicability.txt | 2 +- .../suspendFunctionType/suspendFunctionN.kt | 4 + .../suspendFunctionType/suspendFunctionN.txt | 5 + .../suspendFunctionNIsUnresolved.kt | 4 - .../suspendFunctionNIsUnresolved.txt | 5 - .../ir/IrBlackBoxCodegenTestGenerated.java | 790 +----------------- .../IrBlackBoxInlineCodegenTestGenerated.java | 35 + ...otlinAgainstInlineKotlinTestGenerated.java | 35 + .../checkers/DiagnosticsTestGenerated.java | 36 + .../DiagnosticsTestWithStdLibGenerated.java | 31 +- ...ticsTestWithStdLibUsingJavacGenerated.java | 31 +- .../DiagnosticsUsingJavacTestGenerated.java | 36 + .../codegen/BlackBoxCodegenTestGenerated.java | 774 +---------------- .../BlackBoxInlineCodegenTestGenerated.java | 35 + ...otlinAgainstInlineKotlinTestGenerated.java | 35 + .../LightAnalysisModeTestGenerated.java | 774 +---------------- .../kotlin/platform/JavaToKotlinClassMap.kt | 22 +- .../kotlin/builtins/ReflectionTypes.kt | 48 +- .../kotlin/builtins/functionTypes.kt | 21 +- .../functions/FunctionClassDescriptor.kt | 21 +- .../IrJsCodegenBoxTestGenerated.java | 93 +++ .../semantics/JsCodegenBoxTestGenerated.java | 756 +---------------- 107 files changed, 780 insertions(+), 4849 deletions(-) delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/companionObjectReceiver.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/coroutineContext.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/enumEntryMember.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/equals/nullableReceiverInEquals.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/equals/receiverInEquals.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/equals/reflectionReference.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/inline/simple.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/inline/simpleVal.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/localUnitFunction.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/multiCase.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/nullReceiver.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/objectReceiver.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/primitiveReceiver.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/smartCastForExtensionReceiver.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/abstractClassMember.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromClass.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromExtension.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelStringNoArgs.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelStringOneStringArg.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelUnitNoArgs.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelUnitOneStringArg.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromClass.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromExtension.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelStringNoArgs.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelStringOneStringArg.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelUnitNoArgs.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelUnitOneStringArg.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithOverload.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericMember.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/captureOuter.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/classMember.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/closureWithSideEffect.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/enumExtendsTrait.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extension.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extensionToLocalClass.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extensionToPrimitive.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extensionWithClosure.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/genericMember.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/localClassMember.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/localFunctionName.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/localLocal.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/simple.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/simpleClosure.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/simpleWithArg.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/unitWithSideEffect.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/overloadedFun.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/overloadedFunVsVal.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/privateClassMember.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/specialCalls.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromClass.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromExtension.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelStringNoArgs.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelStringOneStringArg.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelUnitNoArgs.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelUnitOneStringArg.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/traitImplMethodWithClassReceiver.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/traitMember.kt create mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/longArgs.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability/noReflect.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability/reflectedIsNotSerialized.kt delete mode 100644 compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability/withReflect.kt create mode 100644 compiler/testData/codegen/boxInline/suspend/callableReference/ordinaryParameter.kt create mode 100644 compiler/testData/codegen/boxInline/suspend/callableReference/simple.kt create mode 100644 compiler/testData/codegen/boxInline/suspend/callableReference/suspendOfOrdinary.kt create mode 100644 compiler/testData/diagnostics/tests/coroutines/callableReference/invokeOutideSuspend.kt create mode 100644 compiler/testData/diagnostics/tests/coroutines/callableReference/outsideSuspend.kt create mode 100644 compiler/testData/diagnostics/testsWithStdLib/coroutines/callableReference/property.kt create mode 100644 compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctionType/suspendFunctionN.kt create mode 100644 compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctionType/suspendFunctionN.txt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctionType/suspendFunctionNIsUnresolved.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctionType/suspendFunctionNIsUnresolved.txt diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java index 259c9150d16..c66636ec448 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java @@ -982,11 +982,7 @@ 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() - ), + CoroutineCodegenUtilKt.getOrCreateJvmSuspendFunctionView(descriptor, state), descriptor, this, state.getTypeMapper() ) : this.context.intoClosure(descriptor, this, typeMapper); ClosureCodegen closureCodegen = coroutineCodegen != null ? coroutineCodegen : new ClosureCodegen( diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/FunctionCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/FunctionCodegen.java index 57db28dd992..5fe7c2de27b 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/FunctionCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/FunctionCodegen.java @@ -178,8 +178,7 @@ public class FunctionCodegen { @NotNull FunctionGenerationStrategy strategy ) { if (CoroutineCodegenUtilKt.isSuspendFunctionNotSuspensionView(descriptor)) { - generateMethod(origin, CoroutineCodegenUtilKt.getOrCreateJvmSuspendFunctionView(descriptor, state.getLanguageVersionSettings() - .supportsFeature(LanguageFeature.ReleaseCoroutines), bindingContext), strategy); + generateMethod(origin, CoroutineCodegenUtilKt.getOrCreateJvmSuspendFunctionView(descriptor, state), strategy); return; } @@ -675,8 +674,7 @@ public class FunctionCodegen { if (functionDescriptor instanceof AnonymousFunctionDescriptor && functionDescriptor.isSuspend()) { functionDescriptor = CoroutineCodegenUtilKt.getOrCreateJvmSuspendFunctionView( functionDescriptor, - parentCodegen.state.getLanguageVersionSettings().supportsFeature(LanguageFeature.ReleaseCoroutines), - typeMapper.getBindingContext() + parentCodegen.state ); } diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/FunctionReferenceGenerationStrategy.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/FunctionReferenceGenerationStrategy.java index fa2d1a69b4c..8bf41be50e3 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/FunctionReferenceGenerationStrategy.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/FunctionReferenceGenerationStrategy.java @@ -1,17 +1,6 @@ /* - * Copyright 2010-2015 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. */ package org.jetbrains.kotlin.codegen; @@ -42,6 +31,8 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import static org.jetbrains.kotlin.codegen.inline.InlineCodegenUtilsKt.addFakeContinuationMarker; + /* * Notice the difference between two function descriptors in this class. * - [referencedFunction] is the function declaration which is referenced by the "::" expression. This is a real function present in code. @@ -78,19 +69,14 @@ public class FunctionReferenceGenerationStrategy extends FunctionGenerationStrat ) { super(state); this.resolvedCall = resolvedCall; - 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()); + CallableDescriptor resultingDescriptor = resolvedCall.getResultingDescriptor(); + if (resultingDescriptor instanceof FunctionDescriptor && ((FunctionDescriptor) resultingDescriptor).isSuspend()) { + this.referencedFunction = + CoroutineCodegenUtilKt.getOrCreateJvmSuspendFunctionView((FunctionDescriptor) resultingDescriptor, state); + this.functionDescriptor = CoroutineCodegenUtilKt.getOrCreateJvmSuspendFunctionView(functionDescriptor, state); } else { - this.referencedFunction = (FunctionDescriptor) resolvedCall.getResultingDescriptor(); + this.referencedFunction = (FunctionDescriptor) resultingDescriptor; this.functionDescriptor = functionDescriptor; } this.receiverType = receiverType; 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 2def85cb29e..0e4e6e72b02 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/binding/CodegenAnnotatingVisitor.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/binding/CodegenAnnotatingVisitor.java @@ -407,20 +407,7 @@ class CodegenAnnotatingVisitor extends KtVisitorVoid { 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); + createAndRecordSuspendFunctionView(closure, functionDescriptor, /* isSuspendLambda */ false, /* isDropSuspend */ false); } } @@ -431,6 +418,33 @@ class CodegenAnnotatingVisitor extends KtVisitorVoid { super.visitCallableReferenceExpression(expression); } + private SimpleFunctionDescriptor createAndRecordSuspendFunctionView( + MutableClosure closure, + SimpleFunctionDescriptor functionDescriptor, + boolean isSuspendLambda, + boolean isDropSuspend + ) { + SimpleFunctionDescriptor jvmSuspendFunctionView = + CoroutineCodegenUtilKt.getOrCreateJvmSuspendFunctionView( + functionDescriptor, + languageVersionSettings.supportsFeature(LanguageFeature.ReleaseCoroutines), + this.bindingContext, + isDropSuspend + ); + + bindingTrace.record( + CodegenBinding.SUSPEND_FUNCTION_TO_JVM_VIEW, + functionDescriptor, + jvmSuspendFunctionView + ); + + closure.setSuspend(true); + if (isSuspendLambda) { + closure.setSuspendLambda(); + } + return jvmSuspendFunctionView; + } + @NotNull private MutableClosure recordClosure(@NotNull ClassDescriptor classDescriptor, @NotNull String name) { return CodegenBinding.recordClosure(bindingTrace, classDescriptor, getProperEnclosingClass(), Type.getObjectType(name)); @@ -557,11 +571,18 @@ class CodegenAnnotatingVisitor extends KtVisitorVoid { if (functionDescriptor instanceof SimpleFunctionDescriptor && functionDescriptor.isSuspend() && !functionDescriptor.getVisibility().equals(Visibilities.LOCAL)) { + + if (nameForClassOrPackageMember != null) { + nameStack.push(nameForClassOrPackageMember); + } + + String name = inventAnonymousClassName(); + ClassDescriptor classDescriptor = recordClassForFunction(function, functionDescriptor, name, functionDescriptor); + MutableClosure closure = recordClosure(classDescriptor, name); + SimpleFunctionDescriptor jvmSuspendFunctionView = - CoroutineCodegenUtilKt.getOrCreateJvmSuspendFunctionView( - (SimpleFunctionDescriptor) functionDescriptor, - languageVersionSettings.supportsFeature(LanguageFeature.ReleaseCoroutines) - ); + createAndRecordSuspendFunctionView(closure, (SimpleFunctionDescriptor) functionDescriptor, + /* isSuspendLambda*/ false, /* isDropSuspend */ false); // This is a very subtle place (hack). // When generating bytecode of some suspend function, we replace the original descriptor @@ -577,21 +598,6 @@ class CodegenAnnotatingVisitor extends KtVisitorVoid { ); } - bindingTrace.record( - CodegenBinding.SUSPEND_FUNCTION_TO_JVM_VIEW, - functionDescriptor, - jvmSuspendFunctionView - ); - - if (nameForClassOrPackageMember != null) { - nameStack.push(nameForClassOrPackageMember); - } - - String name = inventAnonymousClassName(); - ClassDescriptor classDescriptor = - recordClassForFunction(function, functionDescriptor, name, functionDescriptor); - MutableClosure closure = recordClosure(classDescriptor, name); - closure.setSuspend(true); functionsStack.push(functionDescriptor); super.visitNamedFunction(function); @@ -620,21 +626,8 @@ class CodegenAnnotatingVisitor extends KtVisitorVoid { nameStack.push(name); if (functionDescriptor instanceof SimpleFunctionDescriptor && functionDescriptor.isSuspend()) { - SimpleFunctionDescriptor jvmSuspendFunctionView = - CoroutineCodegenUtilKt.getOrCreateJvmSuspendFunctionView( - (SimpleFunctionDescriptor) functionDescriptor, - languageVersionSettings.supportsFeature(LanguageFeature.ReleaseCoroutines), - /*bindingContext*/ null, - /*dropSuspend*/ true - ); - - bindingTrace.record( - CodegenBinding.SUSPEND_FUNCTION_TO_JVM_VIEW, - functionDescriptor, - jvmSuspendFunctionView - ); - closure.setSuspend(true); - closure.setSuspendLambda(); + createAndRecordSuspendFunctionView(closure, (SimpleFunctionDescriptor) functionDescriptor, + /* isSuspendLambda */ true, /* isDropSuspend */ true); } functionsStack.push(functionDescriptor); 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 bfcc1727508..f8bcb4a20df 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/coroutines/CoroutineCodegen.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/coroutines/CoroutineCodegen.kt @@ -338,11 +338,7 @@ class CoroutineCodegenForLambda private constructor( expressionCodegen, declaration, expressionCodegen.context.intoCoroutineClosure( - getOrCreateJvmSuspendFunctionView( - originalSuspendLambdaDescriptor, - expressionCodegen.state.languageVersionSettings.supportsFeature(LanguageFeature.ReleaseCoroutines), - expressionCodegen.state.bindingContext - ), + getOrCreateJvmSuspendFunctionView(originalSuspendLambdaDescriptor, expressionCodegen.state), originalSuspendLambdaDescriptor, expressionCodegen, expressionCodegen.state.typeMapper ), classBuilder, diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/coroutines/coroutineCodegenUtil.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/coroutines/coroutineCodegenUtil.kt index 9debd265add..a352b55e625 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/coroutines/coroutineCodegenUtil.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/coroutines/coroutineCodegenUtil.kt @@ -201,6 +201,12 @@ fun CallableDescriptor.isSuspendFunctionNotSuspensionView(): Boolean { return this.isSuspend && this.getUserData(INITIAL_DESCRIPTOR_FOR_SUSPEND_FUNCTION) == null } +fun getOrCreateJvmSuspendFunctionView(function: D, state: GenerationState): D = getOrCreateJvmSuspendFunctionView( + function, + state.languageVersionSettings.supportsFeature(LanguageFeature.ReleaseCoroutines), + state.bindingContext +) + // Suspend functions have irregular signatures on JVM, containing an additional last parameter with type `Continuation`, // and return type Any? // This function returns a function descriptor reflecting how the suspend function looks from point of view of JVM diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/MethodInliner.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/MethodInliner.kt index bad3e882f8d..b9baa18db49 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/MethodInliner.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/MethodInliner.kt @@ -10,6 +10,7 @@ import org.jetbrains.kotlin.codegen.AsmUtil import org.jetbrains.kotlin.codegen.ClosureCodegen import org.jetbrains.kotlin.codegen.StackValue import org.jetbrains.kotlin.codegen.coroutines.continuationAsmType +import org.jetbrains.kotlin.codegen.coroutines.getOrCreateJvmSuspendFunctionView import org.jetbrains.kotlin.codegen.inline.FieldRemapper.Companion.foldName import org.jetbrains.kotlin.codegen.intrinsics.IntrinsicMethods import org.jetbrains.kotlin.codegen.optimization.ApiVersionCallsPreprocessingMethodTransformer @@ -21,6 +22,7 @@ import org.jetbrains.kotlin.codegen.optimization.fixStack.peek import org.jetbrains.kotlin.codegen.optimization.fixStack.top import org.jetbrains.kotlin.descriptors.ParameterDescriptor import org.jetbrains.kotlin.resolve.isInlineClassType +import org.jetbrains.kotlin.resolve.jvm.AsmTypes import org.jetbrains.kotlin.resolve.jvm.AsmTypes.OBJECT_TYPE import org.jetbrains.kotlin.utils.SmartList import org.jetbrains.kotlin.utils.SmartSet @@ -214,12 +216,34 @@ class MethodInliner( return } + // in case of inlining suspend lambda reference as ordinary parameter of inline function: + // suspend fun foo (...) ... + // inline fun inlineMe(c: (...) -> ...) ... + // builder { + // inlineMe(::foo) + // } + // we should create additional parameter for continuation. + var coroutineDesc = desc + if (info.invokeMethodDescriptor.isSuspend) { + val coroutineInvokeMethodDescriptor = getOrCreateJvmSuspendFunctionView( + info.invokeMethodDescriptor, + inliningContext.state + ) + val coroutineInvokeDesc = typeMapper.mapAsmMethod(coroutineInvokeMethodDescriptor).descriptor + // And here we expect invoke(...Ljava/lang/Object;) be replaced with invoke(...Lkotlin/coroutines/Continuation;) + // if this does not happen, insert fake continuation, since we could not have one yet. + val argumentTypes = Type.getArgumentTypes(desc) + if (Type.getArgumentTypes(coroutineInvokeDesc).size != argumentTypes.size) { + addFakeContinuationMarker(this) + coroutineDesc = Type.getMethodDescriptor(Type.getReturnType(desc), *argumentTypes, AsmTypes.OBJECT_TYPE) + } + } val valueParameters = listOfNotNull(info.invokeMethodDescriptor.extensionReceiverParameter) + info.invokeMethodDescriptor.valueParameters val valueParamShift = Math.max(nextLocalIndex, markerShift)//NB: don't inline cause it changes putStackValuesIntoLocalsForLambdaOnInvoke( - listOf(*info.invokeMethod.argumentTypes), valueParameters, valueParamShift, this, desc + listOf(*info.invokeMethod.argumentTypes), valueParameters, valueParamShift, this, coroutineDesc ) if (invokeCall.lambdaInfo.invokeMethodDescriptor.valueParameters.isEmpty()) { 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 e21ae7ce574..646a4e23163 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/state/KotlinTypeMapper.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/state/KotlinTypeMapper.java @@ -26,6 +26,7 @@ import org.jetbrains.kotlin.codegen.signature.JvmSignatureWriter; import org.jetbrains.kotlin.descriptors.*; import org.jetbrains.kotlin.descriptors.impl.LocalVariableAccessorDescriptor; import org.jetbrains.kotlin.descriptors.impl.LocalVariableDescriptor; +import org.jetbrains.kotlin.descriptors.impl.SimpleFunctionDescriptorImpl; import org.jetbrains.kotlin.descriptors.impl.TypeAliasConstructorDescriptor; import org.jetbrains.kotlin.fileClasses.JvmFileClassInfo; import org.jetbrains.kotlin.fileClasses.JvmFileClassUtil; @@ -1024,8 +1025,8 @@ public class KotlinTypeMapper { } private static boolean isSuspendFunctionReference(FunctionDescriptor descriptor) { - return descriptor.getSource() instanceof KotlinSourceElement && - ((KotlinSourceElement) descriptor.getSource()).getPsi() instanceof KtCallableReferenceExpression && + return descriptor instanceof SimpleFunctionDescriptor && + descriptor.getName().isSpecial() && CoroutineCodegenUtilKt.unwrapInitialDescriptorForSuspendFunction(descriptor) != null && CoroutineCodegenUtilKt.unwrapInitialDescriptorForSuspendFunction(descriptor).isSuspend(); } 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 dae04ef66da..c325dbd30ef 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/CallCompleter.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/CallCompleter.kt @@ -16,10 +16,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.builtins.* import org.jetbrains.kotlin.contracts.EffectSystem import org.jetbrains.kotlin.descriptors.CallableDescriptor import org.jetbrains.kotlin.descriptors.ModuleDescriptor @@ -161,7 +158,7 @@ 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.isSuspendFunctionType)) + if (!TypeUtils.noExpectedType(expectedType) && expectedType.isFunctionOrSuspendFunctionType) expectedType.getReturnTypeFromFunctionType() else TypeUtils.NO_EXPECTED_TYPE } else expectedType @@ -213,7 +210,7 @@ class CallCompleter( } } - if (call.isCallableReference() && !TypeUtils.noExpectedType(expectedType) && (expectedType.isFunctionType || expectedType.isSuspendFunctionType)) { + if (call.isCallableReference() && !TypeUtils.noExpectedType(expectedType) && expectedType.isFunctionOrSuspendFunctionType) { 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 b4be6aeb46d..0cc968904c4 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,11 +15,11 @@ 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 import org.jetbrains.kotlin.resolve.DescriptorUtils +import org.jetbrains.kotlin.resolve.calls.callUtil.isCallableReference import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameSafe import org.jetbrains.kotlin.resolve.inline.InlineUtil @@ -60,8 +60,6 @@ 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 @@ -80,7 +78,7 @@ object CoroutineSuspendCallChecker : CallChecker { checkRestrictsSuspension(enclosingSuspendFunction, resolvedCall, reportOn, context) } - isCallableReference -> { + resolvedCall.call.isCallableReference() -> { // do nothing: we can get callable reference to suspend function outside suspend context } else -> { diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/ResolvedAtomCompleter.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/ResolvedAtomCompleter.kt index 6a0752bbee4..bb30debdd5d 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/ResolvedAtomCompleter.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/ResolvedAtomCompleter.kt @@ -228,7 +228,8 @@ class ResolvedAtomCompleter( is FunctionDescriptor -> doubleColonExpressionResolver.bindFunctionReference( callableReferenceExpression, resultType, - topLevelCallContext + topLevelCallContext, + callableCandidate.candidate as FunctionDescriptor ) is PropertyDescriptor -> doubleColonExpressionResolver.bindPropertyReference( callableReferenceExpression, 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 01880b77b2f..f10ff713f14 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/DoubleColonExpressionResolver.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/DoubleColonExpressionResolver.kt @@ -1,24 +1,12 @@ /* - * Copyright 2010-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. */ 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.* @@ -37,6 +25,7 @@ import org.jetbrains.kotlin.resolve.calls.CallResolver import org.jetbrains.kotlin.resolve.calls.callResolverUtil.ResolveArgumentsMode import org.jetbrains.kotlin.resolve.calls.callUtil.getCalleeExpressionIfAny import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCall +import org.jetbrains.kotlin.resolve.calls.checkers.isBuiltInCoroutineContext import org.jetbrains.kotlin.resolve.calls.context.* import org.jetbrains.kotlin.resolve.calls.results.OverloadResolutionResults import org.jetbrains.kotlin.resolve.calls.results.OverloadResolutionResultsUtil @@ -46,7 +35,6 @@ 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 @@ -544,7 +532,7 @@ class DoubleColonExpressionResolver( val type = createKCallableTypeForReference(descriptor, lhs, reflectionTypes, context.scope.ownerDescriptor) ?: return null when (descriptor) { - is FunctionDescriptor -> bindFunctionReference(expression, type, context) + is FunctionDescriptor -> bindFunctionReference(expression, type, context, descriptor) is PropertyDescriptor -> bindPropertyReference(expression, type, context) } @@ -581,13 +569,18 @@ class DoubleColonExpressionResolver( return original.extensionReceiverParameter != null && original.dispatchReceiverParameter != null } - internal fun bindFunctionReference(expression: KtCallableReferenceExpression, type: KotlinType, context: ResolutionContext<*>) { + internal fun bindFunctionReference( + expression: KtCallableReferenceExpression, + type: KotlinType, + context: ResolutionContext<*>, + referencedFunction: FunctionDescriptor + ) { val functionDescriptor = AnonymousFunctionDescriptor( context.scope.ownerDescriptor, Annotations.EMPTY, CallableMemberDescriptor.Kind.DECLARATION, expression.toSourceElement(), - /* isCoroutine = */ ReflectionTypes.isKSuspendFunction(type) + /* isCoroutine = */ ReflectionTypes.isNumberedKSuspendFunction(type) || referencedFunction.isSuspend ) functionDescriptor.initialize( @@ -637,8 +630,8 @@ class DoubleColonExpressionResolver( resolutionResults: OverloadResolutionResults? ) { val descriptor = - if (resolutionResults?.isSingleResult == true) resolutionResults.resultingDescriptor as? FunctionDescriptor else null - if (descriptor?.isSuspend == true && descriptor is PropertyDescriptor) { + if (resolutionResults?.isSingleResult == true) resolutionResults.resultingDescriptor else null + if (descriptor is PropertyDescriptor && descriptor.isBuiltInCoroutineContext(languageVersionSettings)) { context.trace.report(UNSUPPORTED.on(expression.callableReference, "Callable references to suspend property")) } @@ -785,13 +778,9 @@ class DoubleColonExpressionResolver( val returnType = descriptor.returnType ?: return null val parametersTypes = descriptor.valueParameters.map { it.type } val parametersNames = descriptor.valueParameters.map { it.name } - return if (descriptor.isSuspend) reflectionTypes.getKSuspendFunctionType( + return reflectionTypes.getKFunctionType( Annotations.EMPTY, receiverType, - parametersTypes, parametersNames, returnType, descriptor.builtIns - ) - else reflectionTypes.getKFunctionType( - Annotations.EMPTY, receiverType, - parametersTypes, parametersNames, returnType, descriptor.builtIns + parametersTypes, parametersNames, returnType, descriptor.builtIns, descriptor.isSuspend ) } is PropertyDescriptor -> { diff --git a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/CallableReferenceResolution.kt b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/CallableReferenceResolution.kt index c4319713864..cd3c737edd4 100644 --- a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/CallableReferenceResolution.kt +++ b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/CallableReferenceResolution.kt @@ -1,17 +1,6 @@ /* - * Copyright 2010-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. */ package org.jetbrains.kotlin.resolve.calls.components @@ -327,7 +316,7 @@ class CallableReferencesCandidateFactory( return callComponents.reflectionTypes.getKFunctionType( Annotations.EMPTY, null, argumentsAndReceivers, null, - returnType, descriptor.builtIns + returnType, descriptor.builtIns, isSuspend = false ) to defaults } else -> error("Unsupported descriptor type: $descriptor") @@ -358,7 +347,7 @@ fun getFunctionTypeFromCallableReferenceExpectedType(expectedType: UnwrappedType return if (expectedType.isFunctionType) { expectedType - } else if (ReflectionTypes.isNumberedKFunction(expectedType)) { + } else if (ReflectionTypes.isNumberedKFunctionOrKSuspendFunction(expectedType)) { expectedType.immediateSupertypes().first { it.isFunctionType }.unwrap() } else { null diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/companionObjectReceiver.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/companionObjectReceiver.kt deleted file mode 100644 index 7094511e59a..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/companionObjectReceiver.kt +++ /dev/null @@ -1,26 +0,0 @@ -// 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 deleted file mode 100644 index 5506fb5614f..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/coroutineContext.kt +++ /dev/null @@ -1,16 +0,0 @@ -// 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 index 9ae9ffa7c25..6902f3894cd 100644 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/emptyLHS.kt +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/emptyLHS.kt @@ -1,11 +1,11 @@ // IGNORE_BACKEND: JS -// LANGUAGE_VERSION: 1.2 +// COMMON_COROUTINES_TEST // WITH_RUNTIME // WITH_COROUTINES import helpers.* -import kotlin.coroutines.experimental.* +import COROUTINES_PACKAGE.* var result = "" diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/enumEntryMember.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/enumEntryMember.kt deleted file mode 100644 index 6b9e11acded..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/enumEntryMember.kt +++ /dev/null @@ -1,31 +0,0 @@ -// 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 deleted file mode 100644 index bd097bc3d6d..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/equals/nullableReceiverInEquals.kt +++ /dev/null @@ -1,25 +0,0 @@ -// 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 deleted file mode 100644 index 7b78d1423df..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/equals/receiverInEquals.kt +++ /dev/null @@ -1,29 +0,0 @@ -// 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 deleted file mode 100644 index a371c4859f9..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/equals/reflectionReference.kt +++ /dev/null @@ -1,27 +0,0 @@ -// 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 deleted file mode 100644 index 16b3d080139..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/inline/simple.kt +++ /dev/null @@ -1,24 +0,0 @@ -// 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 deleted file mode 100644 index c380732bbcc..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/inline/simpleVal.kt +++ /dev/null @@ -1,25 +0,0 @@ -// 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 deleted file mode 100644 index 78024435ef7..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/localUnitFunction.kt +++ /dev/null @@ -1,20 +0,0 @@ -// 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 deleted file mode 100644 index 4e20ca3ab36..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/multiCase.kt +++ /dev/null @@ -1,66 +0,0 @@ -// 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 deleted file mode 100644 index 881cbba7ad9..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/nullReceiver.kt +++ /dev/null @@ -1,22 +0,0 @@ -// 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 deleted file mode 100644 index ceccf069d28..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/objectReceiver.kt +++ /dev/null @@ -1,24 +0,0 @@ -// 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 deleted file mode 100644 index b19ece92c76..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/primitiveReceiver.kt +++ /dev/null @@ -1,41 +0,0 @@ -// 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 deleted file mode 100644 index 55de1de40df..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/smartCastForExtensionReceiver.kt +++ /dev/null @@ -1,30 +0,0 @@ -// 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 deleted file mode 100644 index ff7559e4269..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/abstractClassMember.kt +++ /dev/null @@ -1,26 +0,0 @@ -// 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 deleted file mode 100644 index eea86bd5afe..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromClass.kt +++ /dev/null @@ -1,25 +0,0 @@ -// 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 deleted file mode 100644 index 7af039afe30..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromExtension.kt +++ /dev/null @@ -1,26 +0,0 @@ -// 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 deleted file mode 100644 index 6cf4c977462..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelStringNoArgs.kt +++ /dev/null @@ -1,25 +0,0 @@ -// 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 deleted file mode 100644 index 10896f81f08..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelStringOneStringArg.kt +++ /dev/null @@ -1,25 +0,0 @@ -// 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 deleted file mode 100644 index e10cd78589b..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelUnitNoArgs.kt +++ /dev/null @@ -1,27 +0,0 @@ -// 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 deleted file mode 100644 index 439434e730c..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/classMemberFromTopLevelUnitOneStringArg.kt +++ /dev/null @@ -1,27 +0,0 @@ -// 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 deleted file mode 100644 index 2c5886389f4..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromClass.kt +++ /dev/null @@ -1,24 +0,0 @@ -// 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 deleted file mode 100644 index 5de79973a91..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromExtension.kt +++ /dev/null @@ -1,26 +0,0 @@ -// 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 deleted file mode 100644 index faf47bb13dc..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelStringNoArgs.kt +++ /dev/null @@ -1,23 +0,0 @@ -// 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 deleted file mode 100644 index 32e17e323ef..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelStringOneStringArg.kt +++ /dev/null @@ -1,23 +0,0 @@ -// 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 deleted file mode 100644 index 1afae874ef6..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelUnitNoArgs.kt +++ /dev/null @@ -1,27 +0,0 @@ -// 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 deleted file mode 100644 index 02fb30d1e60..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/extensionFromTopLevelUnitOneStringArg.kt +++ /dev/null @@ -1,27 +0,0 @@ -// 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 index e328e02b466..49da78b8008 100644 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferenceArguments.kt +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferenceArguments.kt @@ -15,7 +15,7 @@ fun builder(c: suspend () -> Unit) { } suspend fun foo(x: T): R = TODO() -suspend fun fooReturnInt(x: T): Int = 1 +suspend fun fooReturnLong(x: T): Long = 1L suspend fun Int.suspendToString(): String = toString() suspend inline fun check(x: T, y: R, f: suspend (T) -> R, tType: String, rType: String) { @@ -31,8 +31,8 @@ suspend inline fun check(f: suspend (T) -> R, g: suspend fun box(): String { builder { check("", 1, ::foo, "String", "Int") - check("", 1, ::fooReturnInt, "String", "Int") - check("", "", ::fooReturnInt, "String", "Any") + check("", 1L, ::fooReturnLong, "String", "Long") + check("", "", ::fooReturnLong, "String", "Any") check(Int::suspendToString, ::foo, "Int", "String") } diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithNullableTypes.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithNullableTypes.kt index cfe1081b1b5..da7a77ec033 100644 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithNullableTypes.kt +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithNullableTypes.kt @@ -28,8 +28,8 @@ 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 s1: Pair = bar(1L, "", ::foo, "Long", "String") + val (a: Long, b: String?) = bar(1L, "", ::foo, "Long", "String") val ns: String? = null bar(ns, ns, ::foo, "String", "String") diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithOverload.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithOverload.kt deleted file mode 100644 index ecff003e56d..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithOverload.kt +++ /dev/null @@ -1,33 +0,0 @@ -// 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 deleted file mode 100644 index abdda2e0b72..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericMember.kt +++ /dev/null @@ -1,24 +0,0 @@ -// 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/local/captureOuter.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/captureOuter.kt deleted file mode 100644 index 0f4c4b08bcf..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/captureOuter.kt +++ /dev/null @@ -1,27 +0,0 @@ -// 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 deleted file mode 100644 index 2790ef815ec..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/classMember.kt +++ /dev/null @@ -1,23 +0,0 @@ -// 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 deleted file mode 100644 index eda7fff2919..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/closureWithSideEffect.kt +++ /dev/null @@ -1,22 +0,0 @@ -// 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 deleted file mode 100644 index 7cf5fc29a9c..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/enumExtendsTrait.kt +++ /dev/null @@ -1,26 +0,0 @@ -// 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/extension.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extension.kt deleted file mode 100644 index a47ba5847aa..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extension.kt +++ /dev/null @@ -1,21 +0,0 @@ -// 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 deleted file mode 100644 index a337d2b6fab..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extensionToLocalClass.kt +++ /dev/null @@ -1,20 +0,0 @@ -// 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 deleted file mode 100644 index 210ec94aafc..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extensionToPrimitive.kt +++ /dev/null @@ -1,19 +0,0 @@ -// 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 deleted file mode 100644 index 22f585c88a9..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/extensionWithClosure.kt +++ /dev/null @@ -1,24 +0,0 @@ -// 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 deleted file mode 100644 index fab0d883de5..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/genericMember.kt +++ /dev/null @@ -1,23 +0,0 @@ -// 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 deleted file mode 100644 index 7fcfb9dc63f..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/localClassMember.kt +++ /dev/null @@ -1,26 +0,0 @@ -// 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 deleted file mode 100644 index 87ba6845a9f..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/localFunctionName.kt +++ /dev/null @@ -1,9 +0,0 @@ -// 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 deleted file mode 100644 index f6ea549dbd8..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/localLocal.kt +++ /dev/null @@ -1,25 +0,0 @@ -// 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 deleted file mode 100644 index 92c45cdf24b..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/simple.kt +++ /dev/null @@ -1,21 +0,0 @@ -// 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 deleted file mode 100644 index 2224577cc7f..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/simpleClosure.kt +++ /dev/null @@ -1,25 +0,0 @@ -// 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 deleted file mode 100644 index 3c2401ea9c5..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/simpleWithArg.kt +++ /dev/null @@ -1,19 +0,0 @@ -// 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 deleted file mode 100644 index 40d27a33a92..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/unitWithSideEffect.kt +++ /dev/null @@ -1,30 +0,0 @@ -// 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 deleted file mode 100644 index a5ffc85e7b1..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/overloadedFun.kt +++ /dev/null @@ -1,42 +0,0 @@ -// 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 deleted file mode 100644 index 92bf7af7aae..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/overloadedFunVsVal.kt +++ /dev/null @@ -1,34 +0,0 @@ -// 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 deleted file mode 100644 index c8cafe3ce69..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/privateClassMember.kt +++ /dev/null @@ -1,26 +0,0 @@ -// 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 deleted file mode 100644 index e6ddbc6a0cb..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/specialCalls.kt +++ /dev/null @@ -1,44 +0,0 @@ -// 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 deleted file mode 100644 index 9e6a04d57ec..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromClass.kt +++ /dev/null @@ -1,25 +0,0 @@ -// 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 deleted file mode 100644 index 929e5767b79..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromExtension.kt +++ /dev/null @@ -1,25 +0,0 @@ -// 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 deleted file mode 100644 index ef1b371acbc..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelStringNoArgs.kt +++ /dev/null @@ -1,21 +0,0 @@ -// 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 deleted file mode 100644 index 5e8d1e5e601..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelStringOneStringArg.kt +++ /dev/null @@ -1,21 +0,0 @@ -// 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 deleted file mode 100644 index 5f2a37bad10..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelUnitNoArgs.kt +++ /dev/null @@ -1,24 +0,0 @@ -// 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 deleted file mode 100644 index f6ec044ccd6..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/topLevelFromTopLevelUnitOneStringArg.kt +++ /dev/null @@ -1,24 +0,0 @@ -// 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 deleted file mode 100644 index 59cf82d8bdf..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/traitImplMethodWithClassReceiver.kt +++ /dev/null @@ -1,30 +0,0 @@ -// 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 deleted file mode 100644 index 809dc3efd59..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/traitMember.kt +++ /dev/null @@ -1,28 +0,0 @@ -// 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/longArgs.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/longArgs.kt new file mode 100644 index 00000000000..d7d89cd225f --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/longArgs.kt @@ -0,0 +1,25 @@ +// IGNORE_BACKEND: JS, JS_IR +// COMMON_COROUTINES_TEST +// WITH_COROUTINES + +import helpers.* +import COROUTINES_PACKAGE.* +import COROUTINES_PACKAGE.intrinsics.* + +suspend inline fun Long.longArgs(a: Long, b: Long, c: Long) = suspendCoroutineOrReturn { + it.resume(this + a + b + c) + COROUTINE_SUSPENDED +} + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +fun box(): String { + var res = 0L + val ref = 1L::longArgs + builder { + res = ref(1L, 1L, 1L) + } + return if (res == 4L) "OK" else "FAIL $res" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability/noReflect.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability/noReflect.kt deleted file mode 100644 index 6b17d975baa..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability/noReflect.kt +++ /dev/null @@ -1,26 +0,0 @@ -// 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 deleted file mode 100644 index 3ee30ee04eb..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability/reflectedIsNotSerialized.kt +++ /dev/null @@ -1,27 +0,0 @@ -// 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 deleted file mode 100644 index 859aacfd9d7..00000000000 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/serializability/withReflect.kt +++ /dev/null @@ -1,27 +0,0 @@ -// 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/testData/codegen/boxInline/suspend/callableReference/ordinaryParameter.kt b/compiler/testData/codegen/boxInline/suspend/callableReference/ordinaryParameter.kt new file mode 100644 index 00000000000..47e44231e6e --- /dev/null +++ b/compiler/testData/codegen/boxInline/suspend/callableReference/ordinaryParameter.kt @@ -0,0 +1,39 @@ +// !LANGUAGE: +NewInference +// IGNORE_BACKEND: JS, JS_IR +// NO_CHECK_LAMBDA_INLINING +// FILE: test.kt +// We cannot use COMMON_COROUTINES_TEST here due to !LANGUAGE directive +// TODO: Fix this + +inline fun go(f: () -> String) = f() + +// FILE: box.kt +// WITH_RUNTIME + +import kotlin.coroutines.experimental.* +import kotlin.coroutines.experimental.intrinsics.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(object: Continuation { + override val context: CoroutineContext + get() = EmptyCoroutineContext + + override fun resume(value: Unit) { + } + + override fun resumeWithException(exception: Throwable) { + throw exception + } + }) +} + +suspend fun String.id(): String = this + +fun box(): String { + val x = "OK" + var res = "FAIL" + builder { + res = go(x::id) + } + return res +} diff --git a/compiler/testData/codegen/boxInline/suspend/callableReference/simple.kt b/compiler/testData/codegen/boxInline/suspend/callableReference/simple.kt new file mode 100644 index 00000000000..6f5b510d4e1 --- /dev/null +++ b/compiler/testData/codegen/boxInline/suspend/callableReference/simple.kt @@ -0,0 +1,37 @@ +// IGNORE_BACKEND: JS, JS_IR +// NO_CHECK_LAMBDA_INLINING +// FILE: test.kt +// COMMON_COROUTINES_TEST + +inline suspend fun foo(x: suspend () -> String) = x() + +// FILE: box.kt +// WITH_RUNTIME +// COMMON_COROUTINES_TEST + +import COROUTINES_PACKAGE.* +import COROUTINES_PACKAGE.intrinsics.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(object: Continuation { + override val context: CoroutineContext + get() = EmptyCoroutineContext + + override fun resume(value: Unit) { + } + + override fun resumeWithException(exception: Throwable) { + throw exception + } + }) +} + +suspend fun String.id() = this + +fun box(): String { + var res = "" + builder { + res = foo("OK"::id) + } + return res +} diff --git a/compiler/testData/codegen/boxInline/suspend/callableReference/suspendOfOrdinary.kt b/compiler/testData/codegen/boxInline/suspend/callableReference/suspendOfOrdinary.kt new file mode 100644 index 00000000000..279f009128a --- /dev/null +++ b/compiler/testData/codegen/boxInline/suspend/callableReference/suspendOfOrdinary.kt @@ -0,0 +1,37 @@ +// !LANGUAGE: +NewInference +// IGNORE_BACKEND: JS, JS_IR +// NO_CHECK_LAMBDA_INLINING +// FILE: test.kt + +inline suspend fun go(f: () -> String) = f() + +// FILE: box.kt +// WITH_RUNTIME + +import kotlin.coroutines.experimental.* +import kotlin.coroutines.experimental.intrinsics.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(object: Continuation { + override val context: CoroutineContext + get() = EmptyCoroutineContext + + override fun resume(value: Unit) { + } + + override fun resumeWithException(exception: Throwable) { + throw exception + } + }) +} + +suspend fun String.id(): String = this + +fun box(): String { + val x = "OK" + var res = "FAIL" + builder { + res = go(x::id) + } + return res +} diff --git a/compiler/testData/diagnostics/tests/coroutines/callableReference/invokeOutideSuspend.kt b/compiler/testData/diagnostics/tests/coroutines/callableReference/invokeOutideSuspend.kt new file mode 100644 index 00000000000..bd8052c0c50 --- /dev/null +++ b/compiler/testData/diagnostics/tests/coroutines/callableReference/invokeOutideSuspend.kt @@ -0,0 +1,8 @@ +// !LANGUAGE: +Coroutines +// SKIP_TXT + +import kotlin.reflect.KSuspendFunction0 + +fun test(c: KSuspendFunction0) { + c() +} diff --git a/compiler/testData/diagnostics/tests/coroutines/callableReference/outsideSuspend.kt b/compiler/testData/diagnostics/tests/coroutines/callableReference/outsideSuspend.kt new file mode 100644 index 00000000000..7b2dd8959d0 --- /dev/null +++ b/compiler/testData/diagnostics/tests/coroutines/callableReference/outsideSuspend.kt @@ -0,0 +1,6 @@ +// !LANGUAGE: +Coroutines +// SKIP_TXT + +suspend fun foo() {} + +val ref = ::foo diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/callableReference/property.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/callableReference/property.kt new file mode 100644 index 00000000000..37fb60da24e --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/callableReference/property.kt @@ -0,0 +1,14 @@ +// SKIP_TXT +// COMMON_COROUTINES_TEST + +import COROUTINES_PACKAGE.coroutineContext + +val c = ::coroutineContext + +fun test() { + c() +} + +suspend fun test2() { + c() +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/callableReferences.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/callableReferences.kt index a41cee7d563..244f1ad7d2c 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/callableReferences.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/callableReferences.kt @@ -8,21 +8,21 @@ class A { suspend fun A.ext() {} fun test1(a: A) { - val x = ::foo + val x = ::foo - val y1 = a::member - val y2 = A::member + val y1 = a::member + val y2 = A::member - val z1 = a::ext - val z2 = A::ext + val z1 = a::ext + val z2 = A::ext } suspend fun test2(a: A) { - val x = ::foo + val x = ::foo - val y1 = a::member - val y2 = A::member + val y1 = a::member + val y2 = A::member - val z1 = a::ext - val z2 = A::ext + val z1 = a::ext + val z2 = A::ext } diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctionType/modifierApplicability.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctionType/modifierApplicability.kt index 4950fc67372..0b7ac11bfc1 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctionType/modifierApplicability.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctionType/modifierApplicability.kt @@ -11,7 +11,7 @@ typealias Test4 = suspend Action typealias Test5 = List Unit> typealias Test6 = suspend List<() -> Unit> typealias Test7 = suspend SAM -typealias Test8 = suspend SuspendFunction0 +typealias Test8 = suspend SuspendFunction0 typealias Test9 = suspend (() -> Unit) -> Unit typealias Test10 = suspend (suspend () -> Unit) -> Unit typealias Test11 = suspend () -> (suspend () -> Unit) diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctionType/modifierApplicability.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctionType/modifierApplicability.txt index 46de2e09be4..123eb6b1c72 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctionType/modifierApplicability.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctionType/modifierApplicability.txt @@ -50,5 +50,5 @@ public typealias Test4 = Action public typealias Test5 = kotlin.collections.List kotlin.Unit> public typealias Test6 = kotlin.collections.List<() -> kotlin.Unit> public typealias Test7 = SAM -public typealias Test8 = [ERROR : SuspendFunction0] +public typealias Test8 = suspend () -> kotlin.Unit public typealias Test9 = suspend (() -> kotlin.Unit) -> kotlin.Unit diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctionType/suspendFunctionN.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctionType/suspendFunctionN.kt new file mode 100644 index 00000000000..a9904c79178 --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctionType/suspendFunctionN.kt @@ -0,0 +1,4 @@ +// JAVAC_SKIP +typealias Test1 = SuspendFunction0 +typealias Test2 = kotlin.SuspendFunction0 +typealias Test3 = kotlin.coroutines.SuspendFunction0 \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctionType/suspendFunctionN.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctionType/suspendFunctionN.txt new file mode 100644 index 00000000000..75632423c62 --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctionType/suspendFunctionN.txt @@ -0,0 +1,5 @@ +package + +public typealias Test1 = suspend () -> kotlin.Unit +public typealias Test2 = suspend () -> kotlin.Unit +public typealias Test3 = [ERROR : kotlin.coroutines.SuspendFunction0] diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctionType/suspendFunctionNIsUnresolved.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctionType/suspendFunctionNIsUnresolved.kt deleted file mode 100644 index fdae0c893a7..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctionType/suspendFunctionNIsUnresolved.kt +++ /dev/null @@ -1,4 +0,0 @@ -// JAVAC_SKIP -typealias Test1 = SuspendFunction0 -typealias Test2 = kotlin.SuspendFunction0 -typealias Test3 = kotlin.coroutines.SuspendFunction0 \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctionType/suspendFunctionNIsUnresolved.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctionType/suspendFunctionNIsUnresolved.txt deleted file mode 100644 index 422c45085c1..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctionType/suspendFunctionNIsUnresolved.txt +++ /dev/null @@ -1,5 +0,0 @@ -package - -public typealias Test1 = [ERROR : SuspendFunction0] -public typealias Test2 = [ERROR : kotlin.SuspendFunction0] -public typealias Test3 = [ERROR : kotlin.coroutines.SuspendFunction0] 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 560f24a7a07..01a48023d66 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 @@ -6287,11 +6287,23 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes @RunWith(JUnit3RunnerWithInners.class) public static class CallableReference extends AbstractIrBlackBoxCodegenTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, 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); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); + } + + @TestMetadata("longArgs.kt") + public void testLongArgs_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/longArgs.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("longArgs.kt") + public void testLongArgs_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/longArgs.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); } @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound") @@ -6299,211 +6311,24 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes @RunWith(JUnit3RunnerWithInners.class) public static class Bound extends AbstractIrBlackBoxCodegenTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, 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"); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); } @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"); + public void testEmptyLHS_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/emptyLHS.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"); + @TestMetadata("emptyLHS.kt") + public void testEmptyLHS_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/emptyLHS.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") @@ -6511,167 +6336,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes @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"); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } 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"); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); } @TestMetadata("genericCallableReferenceArguments.kt") @@ -6698,237 +6367,21 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes 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); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, 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"); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); } @TestMetadata("equalsHashCode.kt") @@ -6942,199 +6395,6 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes 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"); } } } diff --git a/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java b/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java index 8dc610cf771..662fac29950 100644 --- a/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java @@ -3359,6 +3359,41 @@ public class IrBlackBoxInlineCodegenTestGenerated extends AbstractIrBlackBoxInli runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/tryCatchStackTransform.kt", "kotlin.coroutines"); } + @TestMetadata("compiler/testData/codegen/boxInline/suspend/callableReference") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class CallableReference extends AbstractIrBlackBoxInlineCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInCallableReference() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend/callableReference"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); + } + + @TestMetadata("ordinaryParameter.kt") + public void testOrdinaryParameter() throws Exception { + runTest("compiler/testData/codegen/boxInline/suspend/callableReference/ordinaryParameter.kt"); + } + + @TestMetadata("simple.kt") + public void testSimple_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/callableReference/simple.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("simple.kt") + public void testSimple_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/callableReference/simple.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("suspendOfOrdinary.kt") + public void testSuspendOfOrdinary() throws Exception { + runTest("compiler/testData/codegen/boxInline/suspend/callableReference/suspendOfOrdinary.kt"); + } + } + @TestMetadata("compiler/testData/codegen/boxInline/suspend/defaultParameter") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstInlineKotlinTestGenerated.java index de0245fd41f..b76acfb3aaa 100644 --- a/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstInlineKotlinTestGenerated.java @@ -3359,6 +3359,41 @@ public class IrCompileKotlinAgainstInlineKotlinTestGenerated extends AbstractIrC runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/tryCatchStackTransform.kt", "kotlin.coroutines"); } + @TestMetadata("compiler/testData/codegen/boxInline/suspend/callableReference") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class CallableReference extends AbstractIrCompileKotlinAgainstInlineKotlinTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInCallableReference() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend/callableReference"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); + } + + @TestMetadata("ordinaryParameter.kt") + public void testOrdinaryParameter() throws Exception { + runTest("compiler/testData/codegen/boxInline/suspend/callableReference/ordinaryParameter.kt"); + } + + @TestMetadata("simple.kt") + public void testSimple_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/callableReference/simple.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("simple.kt") + public void testSimple_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/callableReference/simple.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("suspendOfOrdinary.kt") + public void testSuspendOfOrdinary() throws Exception { + runTest("compiler/testData/codegen/boxInline/suspend/callableReference/suspendOfOrdinary.kt"); + } + } + @TestMetadata("compiler/testData/codegen/boxInline/suspend/defaultParameter") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java index 6866a741c19..753746243a4 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java @@ -4166,6 +4166,42 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest { } } + @TestMetadata("compiler/testData/diagnostics/tests/coroutines") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Coroutines extends AbstractDiagnosticsTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); + } + + public void testAllFilesPresentInCoroutines() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/tests/coroutines"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } + + @TestMetadata("compiler/testData/diagnostics/tests/coroutines/callableReference") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class CallableReference extends AbstractDiagnosticsTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); + } + + public void testAllFilesPresentInCallableReference() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/tests/coroutines/callableReference"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } + + @TestMetadata("invokeOutideSuspend.kt") + public void testInvokeOutideSuspend() throws Exception { + runTest("compiler/testData/diagnostics/tests/coroutines/callableReference/invokeOutideSuspend.kt"); + } + + @TestMetadata("outsideSuspend.kt") + public void testOutsideSuspend() throws Exception { + runTest("compiler/testData/diagnostics/tests/coroutines/callableReference/outsideSuspend.kt"); + } + } + } + @TestMetadata("compiler/testData/diagnostics/tests/cyclicHierarchy") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestWithStdLibGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestWithStdLibGenerated.java index 2d610243717..9c534b173ac 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestWithStdLibGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestWithStdLibGenerated.java @@ -1578,6 +1578,31 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/unsupported.kt"); } + @TestMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/callableReference") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class CallableReference extends AbstractDiagnosticsTestWithStdLib { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); + } + + public void testAllFilesPresentInCallableReference() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/coroutines/callableReference"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } + + @TestMetadata("property.kt") + public void testProperty_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/callableReference/property.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("property.kt") + public void testProperty_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/callableReference/property.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + } + @TestMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inference") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) @@ -1987,9 +2012,9 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctionType/nullableSuspendFunction.kt"); } - @TestMetadata("suspendFunctionNIsUnresolved.kt") - public void testSuspendFunctionNIsUnresolved() throws Exception { - runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctionType/suspendFunctionNIsUnresolved.kt"); + @TestMetadata("suspendFunctionN.kt") + public void testSuspendFunctionN() throws Exception { + runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctionType/suspendFunctionN.kt"); } } diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsTestWithStdLibUsingJavacGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsTestWithStdLibUsingJavacGenerated.java index d4704c46487..f482b8f5472 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsTestWithStdLibUsingJavacGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsTestWithStdLibUsingJavacGenerated.java @@ -1578,6 +1578,31 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/unsupported.kt"); } + @TestMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/callableReference") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class CallableReference extends AbstractDiagnosticsTestWithStdLibUsingJavac { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); + } + + public void testAllFilesPresentInCallableReference() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/coroutines/callableReference"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } + + @TestMetadata("property.kt") + public void testProperty_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/callableReference/property.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("property.kt") + public void testProperty_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/callableReference/property.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + } + @TestMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inference") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) @@ -1987,9 +2012,9 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctionType/nullableSuspendFunction.kt"); } - @TestMetadata("suspendFunctionNIsUnresolved.kt") - public void testSuspendFunctionNIsUnresolved() throws Exception { - runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctionType/suspendFunctionNIsUnresolved.kt"); + @TestMetadata("suspendFunctionN.kt") + public void testSuspendFunctionN() throws Exception { + runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctionType/suspendFunctionN.kt"); } } diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java index 2b4ade1eb6b..cee02ebcb7a 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java @@ -4166,6 +4166,42 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing } } + @TestMetadata("compiler/testData/diagnostics/tests/coroutines") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Coroutines extends AbstractDiagnosticsUsingJavacTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); + } + + public void testAllFilesPresentInCoroutines() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/tests/coroutines"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } + + @TestMetadata("compiler/testData/diagnostics/tests/coroutines/callableReference") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class CallableReference extends AbstractDiagnosticsUsingJavacTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); + } + + public void testAllFilesPresentInCallableReference() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/tests/coroutines/callableReference"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } + + @TestMetadata("invokeOutideSuspend.kt") + public void testInvokeOutideSuspend() throws Exception { + runTest("compiler/testData/diagnostics/tests/coroutines/callableReference/invokeOutideSuspend.kt"); + } + + @TestMetadata("outsideSuspend.kt") + public void testOutsideSuspend() throws Exception { + runTest("compiler/testData/diagnostics/tests/coroutines/callableReference/outsideSuspend.kt"); + } + } + } + @TestMetadata("compiler/testData/diagnostics/tests/cyclicHierarchy") @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 94a340dcb74..bfa83d4cc77 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java @@ -6294,6 +6294,18 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } + @TestMetadata("longArgs.kt") + public void testLongArgs_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/longArgs.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("longArgs.kt") + public void testLongArgs_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/longArgs.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) @@ -6306,204 +6318,17 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { 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"); + @TestMetadata("emptyLHS.kt") + public void testEmptyLHS_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/emptyLHS.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"); + public void testEmptyLHS_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/emptyLHS.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") @@ -6514,166 +6339,10 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { 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"); @@ -6698,179 +6367,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { 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) @@ -6883,54 +6384,6 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { 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"); @@ -6942,199 +6395,6 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { 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"); } } } diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java index 0b921eceef5..36129e06a60 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java @@ -3359,6 +3359,41 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/tryCatchStackTransform.kt", "kotlin.coroutines"); } + @TestMetadata("compiler/testData/codegen/boxInline/suspend/callableReference") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class CallableReference extends AbstractBlackBoxInlineCodegenTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); + } + + public void testAllFilesPresentInCallableReference() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend/callableReference"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } + + @TestMetadata("ordinaryParameter.kt") + public void testOrdinaryParameter() throws Exception { + runTest("compiler/testData/codegen/boxInline/suspend/callableReference/ordinaryParameter.kt"); + } + + @TestMetadata("simple.kt") + public void testSimple_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/callableReference/simple.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("simple.kt") + public void testSimple_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/callableReference/simple.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("suspendOfOrdinary.kt") + public void testSuspendOfOrdinary() throws Exception { + runTest("compiler/testData/codegen/boxInline/suspend/callableReference/suspendOfOrdinary.kt"); + } + } + @TestMetadata("compiler/testData/codegen/boxInline/suspend/defaultParameter") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java index 0258a8b441c..e68f4eb7c9e 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java @@ -3359,6 +3359,41 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/tryCatchStackTransform.kt", "kotlin.coroutines"); } + @TestMetadata("compiler/testData/codegen/boxInline/suspend/callableReference") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class CallableReference extends AbstractCompileKotlinAgainstInlineKotlinTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); + } + + public void testAllFilesPresentInCallableReference() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend/callableReference"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } + + @TestMetadata("ordinaryParameter.kt") + public void testOrdinaryParameter() throws Exception { + runTest("compiler/testData/codegen/boxInline/suspend/callableReference/ordinaryParameter.kt"); + } + + @TestMetadata("simple.kt") + public void testSimple_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/callableReference/simple.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("simple.kt") + public void testSimple_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/suspend/callableReference/simple.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + + @TestMetadata("suspendOfOrdinary.kt") + public void testSuspendOfOrdinary() throws Exception { + runTest("compiler/testData/codegen/boxInline/suspend/callableReference/suspendOfOrdinary.kt"); + } + } + @TestMetadata("compiler/testData/codegen/boxInline/suspend/defaultParameter") @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 40b719ca70d..23d26c8fd5d 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -6294,6 +6294,18 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } + @TestMetadata("longArgs.kt") + public void testLongArgs_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/longArgs.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + + @TestMetadata("longArgs.kt") + public void testLongArgs_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/longArgs.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines"); + } + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) @@ -6306,204 +6318,17 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes 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"); + @TestMetadata("emptyLHS.kt") + public void testEmptyLHS_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/emptyLHS.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"); + public void testEmptyLHS_1_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/emptyLHS.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") @@ -6514,166 +6339,10 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes 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"); @@ -6698,179 +6367,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes 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) @@ -6883,54 +6384,6 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes 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"); @@ -6942,199 +6395,6 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes 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"); } } } 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 6de26dc26a8..98c1ac0d188 100644 --- a/core/descriptors.jvm/src/org/jetbrains/kotlin/platform/JavaToKotlinClassMap.kt +++ b/core/descriptors.jvm/src/org/jetbrains/kotlin/platform/JavaToKotlinClassMap.kt @@ -1,17 +1,6 @@ /* - * Copyright 2010-2015 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. */ package org.jetbrains.kotlin.platform @@ -89,18 +78,15 @@ object JavaToKotlinClassMap : PlatformToKotlinClassMap { } // TODO: support also functions with >= 23 parameters + val kFunction = FunctionClassDescriptor.Kind.KFunction + val kFun = kFunction.packageFqName.toString() + "." + kFunction.classNamePrefix for (i in 0..22) { add(ClassId.topLevel(FqName("kotlin.jvm.functions.Function" + i)), KotlinBuiltIns.getFunctionClassId(i)) - - val kFunction = FunctionClassDescriptor.Kind.KFunction - 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))) } diff --git a/core/descriptors/src/org/jetbrains/kotlin/builtins/ReflectionTypes.kt b/core/descriptors/src/org/jetbrains/kotlin/builtins/ReflectionTypes.kt index b11e018a27f..368a0e5a6b2 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/builtins/ReflectionTypes.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/builtins/ReflectionTypes.kt @@ -1,17 +1,6 @@ /* - * Copyright 2010-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. */ package org.jetbrains.kotlin.builtins @@ -64,28 +53,17 @@ class ReflectionTypes(module: ModuleDescriptor, private val notFoundClasses: Not KotlinTypeFactory.simpleNotNullType(annotations, kClass, listOf(TypeProjectionImpl(variance, type))) fun getKFunctionType( - annotations: Annotations, - receiverType: KotlinType?, - parameterTypes: List, - parameterNames: List?, - returnType: KotlinType, - builtIns: KotlinBuiltIns - ): SimpleType { - val arguments = getFunctionTypeArgumentProjections(receiverType, parameterTypes, parameterNames, returnType, builtIns) - val classDescriptor = getKFunction(arguments.size - 1 /* return type */) - return KotlinTypeFactory.simpleNotNullType(annotations, classDescriptor, arguments) - } - - fun getKSuspendFunctionType( annotations: Annotations, receiverType: KotlinType?, parameterTypes: List, parameterNames: List?, returnType: KotlinType, - builtIns: KotlinBuiltIns + builtIns: KotlinBuiltIns, + isSuspend: Boolean ): SimpleType { val arguments = getFunctionTypeArgumentProjections(receiverType, parameterTypes, parameterNames, returnType, builtIns) - val classDescriptor = getKSuspendFunction(arguments.size - 1 /* return type */) + val classDescriptor = + if (isSuspend) getKSuspendFunction(arguments.size - 1 /* return type */) else getKFunction(arguments.size - 1 /* return type */) return KotlinTypeFactory.simpleNotNullType(annotations, classDescriptor, arguments) } @@ -117,7 +95,7 @@ class ReflectionTypes(module: ModuleDescriptor, private val notFoundClasses: Not } fun isCallableType(type: KotlinType): Boolean = - type.isFunctionTypeOrSubtype || type.isSuspendFunctionType || isKCallableType(type) + type.isFunctionTypeOrSubtype || type.isSuspendFunctionTypeOrSubtype || isKCallableType(type) @JvmStatic fun isNumberedKPropertyOrKMutablePropertyType(type: KotlinType): Boolean = @@ -141,18 +119,20 @@ class ReflectionTypes(module: ModuleDescriptor, private val notFoundClasses: Not hasFqName(descriptor, KotlinBuiltIns.FQ_NAMES.kProperty2) } - fun isNumberedKFunction(type: KotlinType): Boolean { + fun isNumberedKFunctionOrKSuspendFunction(type: KotlinType): Boolean { 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) || isKSuspendFunction(type)) && + return (shortName.length > K_FUNCTION_PREFIX.length && shortName.startsWith(K_FUNCTION_PREFIX) || + isNumberedKSuspendFunction(type)) && DescriptorUtils.getFqName(descriptor).parent().toSafe() == KOTLIN_REFLECT_FQ_NAME } - fun isKSuspendFunction(type: KotlinType): Boolean { + fun isNumberedKSuspendFunction(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) + return shortName.length > K_SUSPEND_FUNCTION_PREFIX.length && shortName.startsWith(K_SUSPEND_FUNCTION_PREFIX) && + DescriptorUtils.getFqName(descriptor).parent().toSafe() == KOTLIN_REFLECT_FQ_NAME } private fun hasFqName(typeConstructor: TypeConstructor, fqName: FqNameUnsafe): Boolean { @@ -182,7 +162,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("KSuspendFunction") // KSuspendFunctionN || shortName.startsWith("KProperty") // KPropertyN, KProperty || shortName.startsWith("KMutableProperty") // KMutablePropertyN, KMutableProperty || shortName == "KCallable" || shortName == "KAnnotatedElement" diff --git a/core/descriptors/src/org/jetbrains/kotlin/builtins/functionTypes.kt b/core/descriptors/src/org/jetbrains/kotlin/builtins/functionTypes.kt index 7d4b08e5b84..4c0a53075fa 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/builtins/functionTypes.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/builtins/functionTypes.kt @@ -1,17 +1,6 @@ /* - * Copyright 2010-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. */ package org.jetbrains.kotlin.builtins @@ -58,6 +47,9 @@ private fun KotlinType.isTypeOrSubtypeOf(predicate: (KotlinType) -> Boolean): Bo val KotlinType.isFunctionTypeOrSubtype: Boolean get() = isTypeOrSubtypeOf { it.isFunctionType } +val KotlinType.isSuspendFunctionTypeOrSubtype: Boolean + get() = isTypeOrSubtypeOf { it.isSuspendFunctionType } + val KotlinType.isBuiltinFunctionalTypeOrSubtype: Boolean get() = isTypeOrSubtypeOf { it.isBuiltinFunctionalType } @@ -67,6 +59,9 @@ val KotlinType.isFunctionType: Boolean val KotlinType.isSuspendFunctionType: Boolean get() = constructor.declarationDescriptor?.getFunctionalClassKind() == FunctionClassDescriptor.Kind.SuspendFunction +val KotlinType.isFunctionOrSuspendFunctionType: Boolean + get() = isFunctionType || isSuspendFunctionType + val KotlinType.isBuiltinFunctionalType: Boolean get() { val kind = constructor.declarationDescriptor?.getFunctionalClassKind() 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 01e34e72e19..0477522f549 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/builtins/functions/FunctionClassDescriptor.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/builtins/functions/FunctionClassDescriptor.kt @@ -1,5 +1,5 @@ /* - * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license * that can be found in the license/LICENSE.txt file. */ @@ -118,7 +118,6 @@ class FunctionClassDescriptor( result.add(KotlinTypeFactory.simpleNotNullType(Annotations.EMPTY, descriptor, arguments)) } - when (functionKind) { Kind.SuspendFunction -> // SuspendFunction$N<...> <: Function add(containingDeclaration, Name.identifier("Function")) @@ -128,17 +127,19 @@ class FunctionClassDescriptor( add(containingDeclaration, Name.identifier(functionKind.classNamePrefix)) } - // For KFunction{n}, add corresponding numbered Function{n} class, e.g. Function2 for KFunction2 - if (functionKind == Kind.KFunction) { + val numberedSupertypeKind = when (functionKind) { + Kind.KFunction -> Kind.Function + Kind.KSuspendFunction -> Kind.SuspendFunction + else -> null + } + + + // For K{Suspend}Function{n}, add corresponding numbered {Suspend}Function{n} class, e.g. {Suspend}Function2 for {Suspend}KFunction2 + if (numberedSupertypeKind != null) { val packageView = containingDeclaration.containingDeclaration.getPackage(BUILT_INS_PACKAGE_FQ_NAME) 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)) + add(kotlinPackageFragment, numberedSupertypeKind.numberedClassName(arity)) } return result.toList() diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrJsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrJsCodegenBoxTestGenerated.java index df8882d1128..ea0711e272e 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrJsCodegenBoxTestGenerated.java @@ -5487,6 +5487,99 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { 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 AbstractIrJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); + } + + public void testAllFilesPresentInCallableReference() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); + } + + @TestMetadata("longArgs.kt") + public void testLongArgs_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/longArgs.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") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Bound extends AbstractIrJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, 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_IR, true); + } + + @TestMetadata("emptyLHS.kt") + public void testEmptyLHS_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/emptyLHS.kt"); + doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); + } + } + + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Function extends AbstractIrJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); + } + + public void testAllFilesPresentInFunction() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); + } + + @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("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("getArityViaFunctionImpl.kt") + public void testGetArityViaFunctionImpl() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/getArityViaFunctionImpl.kt"); + } + + @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Local extends AbstractIrJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, 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_IR, true); + } + + @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("compiler/testData/codegen/box/coroutines/featureIntersection/tailrec") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) 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 b70702d4811..575c82e8270 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 @@ -5499,6 +5499,18 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); } + @TestMetadata("longArgs.kt") + public void testLongArgs_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/longArgs.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") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) @@ -5511,38 +5523,9 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { 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"); + public void testEmptyLHS_1_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/emptyLHS.kt"); try { doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental"); } @@ -5551,152 +5534,6 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { } 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") @@ -5707,166 +5544,10 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { 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"); @@ -5891,179 +5572,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { 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) @@ -6076,54 +5589,6 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { 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"); @@ -6135,199 +5600,6 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { } 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."); } } }