diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java index 79935482382..3e67158f21b 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java @@ -4085,9 +4085,9 @@ public class ExpressionCodegen extends KtVisitor impleme StackValue metadataValue = getVariableMetadataValue(variableDescriptor); initializePropertyMetadata((KtProperty) variableDeclaration, variableDescriptor, metadataValue); - ResolvedCall toDelegateForResolvedCall = bindingContext.get(TO_DELEGATE_FOR_RESOLVED_CALL, variableDescriptor); - if (toDelegateForResolvedCall != null) { - resultType = generateToDelegateForCallForLocalVariable(initializer, metadataValue, toDelegateForResolvedCall); + ResolvedCall provideDelegateResolvedCall = bindingContext.get(PROVIDE_DELEGATE_RESOLVED_CALL, variableDescriptor); + if (provideDelegateResolvedCall != null) { + resultType = generateProvideDelegateCallForLocalVariable(initializer, metadataValue, provideDelegateResolvedCall); } } @@ -4096,17 +4096,17 @@ public class ExpressionCodegen extends KtVisitor impleme } @NotNull - private Type generateToDelegateForCallForLocalVariable( + private Type generateProvideDelegateCallForLocalVariable( @NotNull StackValue initializer, final StackValue metadataValue, - ResolvedCall toDelegateForResolvedCall + ResolvedCall provideDelegateResolvedCall ) { - StackValue toDelegateForReceiver = StackValue.onStack(initializer.type); + StackValue provideDelegateReceiver = StackValue.onStack(initializer.type); - List arguments = toDelegateForResolvedCall.getCall().getValueArguments(); + List arguments = provideDelegateResolvedCall.getCall().getValueArguments(); assert arguments.size() == 2 : "Resolved call for '" + - OperatorNameConventions.TO_DELEGATE_FOR.asString() + + OperatorNameConventions.PROVIDE_DELEGATE.asString() + "' should have exactly 2 value parameters"; tempVariables.put(arguments.get(0).asElement(), StackValue.constant(null, AsmTypes.OBJECT_TYPE)); @@ -4120,7 +4120,7 @@ public class ExpressionCodegen extends KtVisitor impleme } ); - StackValue result = invokeFunction(toDelegateForResolvedCall, toDelegateForReceiver); + StackValue result = invokeFunction(provideDelegateResolvedCall, provideDelegateReceiver); result.put(result.type, v); tempVariables.remove(arguments.get(0).asElement()); tempVariables.remove(arguments.get(1).asElement()); diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/MemberCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/MemberCodegen.java index 3ee9c9f229e..7d0d7c3db5f 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/MemberCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/MemberCodegen.java @@ -67,7 +67,7 @@ import java.util.*; import static org.jetbrains.kotlin.codegen.AsmUtil.*; import static org.jetbrains.kotlin.descriptors.CallableMemberDescriptor.Kind.SYNTHESIZED; -import static org.jetbrains.kotlin.resolve.BindingContext.TO_DELEGATE_FOR_RESOLVED_CALL; +import static org.jetbrains.kotlin.resolve.BindingContext.PROVIDE_DELEGATE_RESOLVED_CALL; import static org.jetbrains.kotlin.resolve.BindingContext.TYPE_ALIAS; import static org.jetbrains.kotlin.resolve.BindingContext.VARIABLE; import static org.jetbrains.kotlin.resolve.DescriptorUtils.*; @@ -467,23 +467,23 @@ public abstract class MemberCodegen toDelegateForResolvedCall = bindingContext.get(TO_DELEGATE_FOR_RESOLVED_CALL, propertyDescriptor); - if (toDelegateForResolvedCall == null) { + ResolvedCall provideDelegateResolvedCall = bindingContext.get(PROVIDE_DELEGATE_RESOLVED_CALL, propertyDescriptor); + if (provideDelegateResolvedCall == null) { propValue.store(codegen.gen(initializer), codegen.v); return; } - StackValue toDelegateForReceiver = codegen.gen(initializer); + StackValue provideDelegateReceiver = codegen.gen(initializer); int indexOfDelegatedProperty = PropertyCodegen.indexOfDelegatedProperty(property); - List arguments = toDelegateForResolvedCall.getCall().getValueArguments(); + List arguments = provideDelegateResolvedCall.getCall().getValueArguments(); assert arguments.size() == 2 : - "Resolved call for '" + OperatorNameConventions.TO_DELEGATE_FOR.asString() + "' should have exactly 2 value parameters"; + "Resolved call for '" + OperatorNameConventions.PROVIDE_DELEGATE.asString() + "' should have exactly 2 value parameters"; codegen.tempVariables.put(arguments.get(0).asElement(), StackValue.LOCAL_0); StackValue delegateValue = PropertyCodegen.invokeDelegatedPropertyConventionMethodWithReceiver( - codegen, typeMapper, toDelegateForResolvedCall, indexOfDelegatedProperty, 1, toDelegateForReceiver); + codegen, typeMapper, provideDelegateResolvedCall, indexOfDelegatedProperty, 1, provideDelegateReceiver); propValue.store(delegateValue, codegen.v); diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/PropertyCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/PropertyCodegen.java index 50d01b6a6d0..7a4a458b3ac 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/PropertyCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/PropertyCodegen.java @@ -375,12 +375,12 @@ public class PropertyCodegen { private KotlinType getDelegateTypeForProperty(@NotNull KtProperty p, @NotNull PropertyDescriptor propertyDescriptor) { KotlinType delegateType = null; - ResolvedCall toDelegateForResolvedCall = - bindingContext.get(BindingContext.TO_DELEGATE_FOR_RESOLVED_CALL, propertyDescriptor); + ResolvedCall provideDelegateResolvedCall = + bindingContext.get(BindingContext.PROVIDE_DELEGATE_RESOLVED_CALL, propertyDescriptor); KtExpression delegateExpression = p.getDelegateExpression(); - if (toDelegateForResolvedCall != null) { - delegateType = toDelegateForResolvedCall.getResultingDescriptor().getReturnType(); + if (provideDelegateResolvedCall != null) { + delegateType = provideDelegateResolvedCall.getResultingDescriptor().getReturnType(); } else if (delegateExpression != null) { delegateType = bindingContext.getType(delegateExpression); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/checkers/DebugInfoUtil.java b/compiler/frontend/src/org/jetbrains/kotlin/checkers/DebugInfoUtil.java index 33b40720fed..c5f5c57c337 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/checkers/DebugInfoUtil.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/checkers/DebugInfoUtil.java @@ -118,7 +118,7 @@ public class DebugInfoUtil { VariableDescriptor descriptor = bindingContext.get(VARIABLE, property); if (descriptor instanceof PropertyDescriptor && property.getDelegate() != null) { PropertyDescriptor propertyDescriptor = (PropertyDescriptor) descriptor; - reportIfDynamicCall(property.getDelegate(), propertyDescriptor, TO_DELEGATE_FOR_RESOLVED_CALL); + reportIfDynamicCall(property.getDelegate(), propertyDescriptor, PROVIDE_DELEGATE_RESOLVED_CALL); reportIfDynamicCall(property.getDelegate(), propertyDescriptor.getGetter(), DELEGATED_PROPERTY_RESOLVED_CALL); reportIfDynamicCall(property.getDelegate(), propertyDescriptor.getSetter(), DELEGATED_PROPERTY_RESOLVED_CALL); } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/BindingContext.java b/compiler/frontend/src/org/jetbrains/kotlin/resolve/BindingContext.java index 5d186cc9cda..1194316899d 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/BindingContext.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/BindingContext.java @@ -141,8 +141,8 @@ public interface BindingContext { WritableSlice> DELEGATED_PROPERTY_RESOLVED_CALL = Slices.createSimpleSlice(); WritableSlice DELEGATED_PROPERTY_CALL = Slices.createSimpleSlice(); - WritableSlice> TO_DELEGATE_FOR_RESOLVED_CALL = Slices.createSimpleSlice(); - WritableSlice TO_DELEGATE_FOR_CALL = Slices.createSimpleSlice(); + WritableSlice> PROVIDE_DELEGATE_RESOLVED_CALL = Slices.createSimpleSlice(); + WritableSlice PROVIDE_DELEGATE_CALL = Slices.createSimpleSlice(); WritableSlice> COMPONENT_RESOLVED_CALL = Slices.createSimpleSlice(); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/DelegatedPropertyResolver.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/DelegatedPropertyResolver.kt index 5cd2167a9b3..28dc8965c70 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/DelegatedPropertyResolver.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/DelegatedPropertyResolver.kt @@ -79,7 +79,7 @@ class DelegatedPropertyResolver( val byExpressionType = resolveDelegateExpression(delegateExpression, property, variableDescriptor, initializerScope, trace, outerDataFlowInfo) - resolveToDelegateForMethod(variableDescriptor, delegateExpression, byExpressionType, trace, initializerScope, outerDataFlowInfo) + resolveProvideDelegateMethod(variableDescriptor, delegateExpression, byExpressionType, trace, initializerScope, outerDataFlowInfo) val delegateType = getResolvedDelegateType(variableDescriptor, delegateExpression, byExpressionType, trace) resolveGetValueMethod(variableDescriptor, delegateExpression, delegateType, trace, initializerScope, outerDataFlowInfo) @@ -94,10 +94,10 @@ class DelegatedPropertyResolver( byExpressionType: KotlinType, trace: BindingTrace ): KotlinType { - val createDelegateResolvedCall = trace.bindingContext.get(TO_DELEGATE_FOR_RESOLVED_CALL, variableDescriptor) - if (createDelegateResolvedCall != null) { - return createDelegateResolvedCall.resultingDescriptor.returnType - ?: throw AssertionError("No return type fore 'toDelegateFor' of ${delegateExpression.text}") + val provideDelegateResolvedCall = trace.bindingContext.get(PROVIDE_DELEGATE_RESOLVED_CALL, variableDescriptor) + if (provideDelegateResolvedCall != null) { + return provideDelegateResolvedCall.resultingDescriptor.returnType + ?: throw AssertionError("No return type fore 'provideDelegate' of ${delegateExpression.text}") } return byExpressionType } @@ -110,7 +110,7 @@ class DelegatedPropertyResolver( initializerScope: LexicalScope, dataFlowInfo: DataFlowInfo ): KotlinType? { - resolveToDelegateForMethod(variableDescriptor, delegateExpression, byExpressionType, trace, initializerScope, dataFlowInfo) + resolveProvideDelegateMethod(variableDescriptor, delegateExpression, byExpressionType, trace, initializerScope, dataFlowInfo) val delegateType = getResolvedDelegateType(variableDescriptor, delegateExpression, byExpressionType, trace) resolveGetSetValueMethod(variableDescriptor, delegateExpression, delegateType, trace, initializerScope, dataFlowInfo, true) @@ -118,8 +118,8 @@ class DelegatedPropertyResolver( return if (resolvedCall != null) resolvedCall.resultingDescriptor.returnType else null } - private val isOperatorToDelegateForSupported: Boolean - get() = languageVersionSettings.supportsFeature(LanguageFeature.OperatorToDelegateFor) + private val isOperatorProvideDelegateSupported: Boolean + get() = languageVersionSettings.supportsFeature(LanguageFeature.OperatorProvideDelegate) private fun resolveGetValueMethod( variableDescriptor: VariableDescriptorWithAccessors, @@ -223,7 +223,7 @@ class DelegatedPropertyResolver( } } - private fun resolveToDelegateForMethod( + private fun resolveProvideDelegateMethod( propertyDescriptor: VariableDescriptorWithAccessors, byExpression: KtExpression, byExpressionType: KotlinType, @@ -231,27 +231,27 @@ class DelegatedPropertyResolver( initializerScope: LexicalScope, dataFlowInfo: DataFlowInfo ) { - if (!isOperatorToDelegateForSupported) return - if (trace.bindingContext.get(BindingContext.TO_DELEGATE_FOR_CALL, propertyDescriptor) != null) return + if (!isOperatorProvideDelegateSupported) return + if (trace.bindingContext.get(BindingContext.PROVIDE_DELEGATE_CALL, propertyDescriptor) != null) return - val toDelegateForResults = getToDelegateForMethod(propertyDescriptor, byExpression, byExpressionType, - trace, initializerScope, dataFlowInfo) - if (!toDelegateForResults.isSuccess) { - val call = trace.bindingContext.get(BindingContext.TO_DELEGATE_FOR_CALL, propertyDescriptor) + val provideDelegateResults = getProvideDelegateMethod(propertyDescriptor, byExpression, byExpressionType, + trace, initializerScope, dataFlowInfo) + if (!provideDelegateResults.isSuccess) { + val call = trace.bindingContext.get(BindingContext.PROVIDE_DELEGATE_CALL, propertyDescriptor) ?: throw AssertionError("'getDelegatedPropertyConventionMethod' didn't record a call") - reportDelegateOperatorResolutionError(trace, call, toDelegateForResults, byExpression, byExpressionType, + reportDelegateOperatorResolutionError(trace, call, provideDelegateResults, byExpression, byExpressionType, operatorRequired = false) return } - val resultingDescriptor = toDelegateForResults.resultingDescriptor + val resultingDescriptor = provideDelegateResults.resultingDescriptor if (!resultingDescriptor.isOperator) { - // TODO resolved 'createDelegate' function, which is not an operator - warning? + // TODO resolved 'provideDelegate' function, which is not an operator - warning? return } - val resultingCall = toDelegateForResults.resultingCall - trace.record(TO_DELEGATE_FOR_RESOLVED_CALL, propertyDescriptor, resultingCall) + val resultingCall = provideDelegateResults.resultingCall + trace.record(PROVIDE_DELEGATE_RESOLVED_CALL, propertyDescriptor, resultingCall) } /* Resolve getValue() or setValue() methods from delegate */ @@ -302,7 +302,7 @@ class DelegatedPropertyResolver( return resolutionResult.second } - private fun getToDelegateForMethod( + private fun getProvideDelegateMethod( propertyDescriptor: VariableDescriptorWithAccessors, delegateExpression: KtExpression, delegateExpressionType: KotlinType, @@ -319,14 +319,14 @@ class DelegatedPropertyResolver( createExpressionForProperty() ) } - val functionName = OperatorNameConventions.TO_DELEGATE_FOR + val functionName = OperatorNameConventions.PROVIDE_DELEGATE val receiver = ExpressionReceiver.create(delegateExpression, delegateExpressionType, trace.bindingContext) - val (toDelegateForCall, toDelegateForResults) = + val (provideDelegateCall, provideDelegateResults) = fakeCallResolver.makeAndResolveFakeCallInContext(receiver, context, arguments, functionName, delegateExpression) - trace.record(BindingContext.TO_DELEGATE_FOR_CALL, propertyDescriptor, toDelegateForCall) + trace.record(BindingContext.PROVIDE_DELEGATE_CALL, propertyDescriptor, provideDelegateCall) - return toDelegateForResults + return provideDelegateResults } //TODO: diagnostics rendering does not belong here @@ -435,19 +435,19 @@ class DelegatedPropertyResolver( typeVariableSubstitutor: TypeSubstitutor, traceToResolveConventionMethods: TemporaryBindingTrace ): KotlinType { - if (isOperatorToDelegateForSupported) { - val toDelegateForResults = getToDelegateForMethod( + if (isOperatorProvideDelegateSupported) { + val provideDelegateResults = getProvideDelegateMethod( variableDescriptor, delegateExpression, byExpressionType, traceToResolveConventionMethods, scopeForDelegate, dataFlowInfo ) - if (conventionMethodFound(toDelegateForResults)) { - val toDelegateForDescriptor = toDelegateForResults.resultingDescriptor - val toDelegateForReturnType = toDelegateForDescriptor.returnType - if (toDelegateForDescriptor.isOperator) { - addConstraintForThisValue(constraintSystem, typeVariableSubstitutor, toDelegateForDescriptor, + if (conventionMethodFound(provideDelegateResults)) { + val provideDelegateDescriptor = provideDelegateResults.resultingDescriptor + val provideDelegateReturnType = provideDelegateDescriptor.returnType + if (provideDelegateDescriptor.isOperator) { + addConstraintForThisValue(constraintSystem, typeVariableSubstitutor, provideDelegateDescriptor, dispatchReceiverOnly = true) - return toDelegateForReturnType - ?: throw AssertionError("No return type fore 'createDelegate' of ${delegateExpression.text}") + return provideDelegateReturnType + ?: throw AssertionError("No return type fore 'provideDelegate' of ${delegateExpression.text}") } } } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/OperatorModifierChecker.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/OperatorModifierChecker.kt index e17ace107e5..c9eadc3bd45 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/OperatorModifierChecker.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/OperatorModifierChecker.kt @@ -48,8 +48,8 @@ object OperatorModifierChecker { checkSupportsFeature(LanguageFeature.Coroutines, languageVersionSettings, diagnosticHolder, modifier) in REM_TO_MOD_OPERATION_NAMES.keys -> checkSupportsFeature(LanguageFeature.OperatorRem, languageVersionSettings, diagnosticHolder, modifier) - OperatorNameConventions.TO_DELEGATE_FOR -> - checkSupportsFeature(LanguageFeature.OperatorToDelegateFor, languageVersionSettings, diagnosticHolder, modifier) + OperatorNameConventions.PROVIDE_DELEGATE -> + checkSupportsFeature(LanguageFeature.OperatorProvideDelegate, languageVersionSettings, diagnosticHolder, modifier) } if (functionDescriptor.name in REM_TO_MOD_OPERATION_NAMES.values diff --git a/compiler/testData/codegen/box/delegatedProperty/toDelegateFor/differentReceivers.kt b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/differentReceivers.kt similarity index 89% rename from compiler/testData/codegen/box/delegatedProperty/toDelegateFor/differentReceivers.kt rename to compiler/testData/codegen/box/delegatedProperty/provideDelegate/differentReceivers.kt index 216fc60d3c3..990b7d63455 100644 --- a/compiler/testData/codegen/box/delegatedProperty/toDelegateFor/differentReceivers.kt +++ b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/differentReceivers.kt @@ -11,7 +11,7 @@ inline fun runLogged(entry: String, action: () -> T): T { return action() } -operator fun MyClass.toDelegateFor(host: Any?, p: Any): String = +operator fun MyClass.provideDelegate(host: Any?, p: Any): String = runLogged("tdf(${this.value});") { this.value } operator fun String.getValue(receiver: Any?, p: Any): String = diff --git a/compiler/testData/codegen/box/delegatedProperty/toDelegateFor/evaluationOrder.kt b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/evaluationOrder.kt similarity index 89% rename from compiler/testData/codegen/box/delegatedProperty/toDelegateFor/evaluationOrder.kt rename to compiler/testData/codegen/box/delegatedProperty/provideDelegate/evaluationOrder.kt index 3567f86c4b9..c837b248604 100644 --- a/compiler/testData/codegen/box/delegatedProperty/toDelegateFor/evaluationOrder.kt +++ b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/evaluationOrder.kt @@ -9,7 +9,7 @@ inline fun runLogged(entry: String, action: () -> T): T { return action() } -operator fun String.toDelegateFor(host: Any?, p: Any): String = +operator fun String.provideDelegate(host: Any?, p: Any): String = runLogged("tdf($this);") { this } operator fun String.getValue(receiver: Any?, p: Any): String = diff --git a/compiler/testData/codegen/box/delegatedProperty/toDelegateFor/evaluationOrderVar.kt b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/evaluationOrderVar.kt similarity index 92% rename from compiler/testData/codegen/box/delegatedProperty/toDelegateFor/evaluationOrderVar.kt rename to compiler/testData/codegen/box/delegatedProperty/provideDelegate/evaluationOrderVar.kt index 9d39cec1b73..e31915c332d 100644 --- a/compiler/testData/codegen/box/delegatedProperty/toDelegateFor/evaluationOrderVar.kt +++ b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/evaluationOrderVar.kt @@ -11,7 +11,7 @@ inline fun runLogged(entry: String, action: () -> T): T { return action() } -operator fun String.toDelegateFor(host: Any?, p: Any): String { +operator fun String.provideDelegate(host: Any?, p: Any): String { dispatcher[this] = this return runLogged("tdf($this);") { this } } diff --git a/compiler/testData/codegen/box/delegatedProperty/toDelegateFor/extensionDelegated.kt b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/extensionDelegated.kt similarity index 100% rename from compiler/testData/codegen/box/delegatedProperty/toDelegateFor/extensionDelegated.kt rename to compiler/testData/codegen/box/delegatedProperty/provideDelegate/extensionDelegated.kt diff --git a/compiler/testData/codegen/box/delegatedProperty/toDelegateFor/generic.kt b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/generic.kt similarity index 90% rename from compiler/testData/codegen/box/delegatedProperty/toDelegateFor/generic.kt rename to compiler/testData/codegen/box/delegatedProperty/provideDelegate/generic.kt index 0f55d3b2ccc..8e6af346f90 100644 --- a/compiler/testData/codegen/box/delegatedProperty/toDelegateFor/generic.kt +++ b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/generic.kt @@ -15,7 +15,7 @@ inline fun runLogged(entry: String, action: () -> T): T { return action() } -operator fun T.toDelegateFor(host: Any?, p: Any): T = +operator fun T.provideDelegate(host: Any?, p: Any): T = runLogged("tdf(${this.value});") { this } operator fun T.getValue(receiver: Any?, p: Any): T = diff --git a/compiler/testData/codegen/box/delegatedProperty/toDelegateFor/inClass.kt b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/inClass.kt similarity index 90% rename from compiler/testData/codegen/box/delegatedProperty/toDelegateFor/inClass.kt rename to compiler/testData/codegen/box/delegatedProperty/provideDelegate/inClass.kt index 4062ffa59b9..e1456a8bd0f 100644 --- a/compiler/testData/codegen/box/delegatedProperty/toDelegateFor/inClass.kt +++ b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/inClass.kt @@ -9,7 +9,7 @@ inline fun runLogged(entry: String, action: () -> T): T { return action() } -operator fun String.toDelegateFor(host: Any?, p: Any): String = +operator fun String.provideDelegate(host: Any?, p: Any): String = runLogged("tdf($this);") { this } operator fun String.getValue(receiver: Any?, p: Any): String = diff --git a/compiler/testData/codegen/box/delegatedProperty/toDelegateFor/inlineToDelegateFor.kt b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/inlineProvideDelegate.kt similarity index 88% rename from compiler/testData/codegen/box/delegatedProperty/toDelegateFor/inlineToDelegateFor.kt rename to compiler/testData/codegen/box/delegatedProperty/provideDelegate/inlineProvideDelegate.kt index dea16973d8d..3ce685006b0 100644 --- a/compiler/testData/codegen/box/delegatedProperty/toDelegateFor/inlineToDelegateFor.kt +++ b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/inlineProvideDelegate.kt @@ -9,7 +9,7 @@ inline fun runLogged(entry: String, action: () -> T): T { return action() } -inline operator fun String.toDelegateFor(host: Any?, p: Any): String = +inline operator fun String.provideDelegate(host: Any?, p: Any): String = runLogged("tdf($this);") { this } operator fun String.getValue(receiver: Any?, p: Any): String = diff --git a/compiler/testData/codegen/box/delegatedProperty/toDelegateFor/jvmStaticInObject.kt b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/jvmStaticInObject.kt similarity index 91% rename from compiler/testData/codegen/box/delegatedProperty/toDelegateFor/jvmStaticInObject.kt rename to compiler/testData/codegen/box/delegatedProperty/provideDelegate/jvmStaticInObject.kt index 09b252f78a7..c16dcdc2615 100644 --- a/compiler/testData/codegen/box/delegatedProperty/toDelegateFor/jvmStaticInObject.kt +++ b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/jvmStaticInObject.kt @@ -10,7 +10,7 @@ inline fun runLogged(entry: String, action: () -> T): T { return action() } -operator fun String.toDelegateFor(host: Any?, p: Any): String = +operator fun String.provideDelegate(host: Any?, p: Any): String = runLogged("tdf($this);") { this } operator fun String.getValue(receiver: Any?, p: Any): String = diff --git a/compiler/testData/codegen/box/delegatedProperty/toDelegateFor/local.kt b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/local.kt similarity index 89% rename from compiler/testData/codegen/box/delegatedProperty/toDelegateFor/local.kt rename to compiler/testData/codegen/box/delegatedProperty/provideDelegate/local.kt index b38e1b03887..e010f9f1242 100644 --- a/compiler/testData/codegen/box/delegatedProperty/toDelegateFor/local.kt +++ b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/local.kt @@ -9,7 +9,7 @@ inline fun runLogged(entry: String, action: () -> T): T { return action() } -operator fun String.toDelegateFor(host: Any?, p: Any): String = +operator fun String.provideDelegate(host: Any?, p: Any): String = runLogged("tdf($this);") { this } operator fun String.getValue(receiver: Any?, p: Any): String = diff --git a/compiler/testData/codegen/box/delegatedProperty/toDelegateFor/localCaptured.kt b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/localCaptured.kt similarity index 89% rename from compiler/testData/codegen/box/delegatedProperty/toDelegateFor/localCaptured.kt rename to compiler/testData/codegen/box/delegatedProperty/provideDelegate/localCaptured.kt index 7694be44b0c..1018b841950 100644 --- a/compiler/testData/codegen/box/delegatedProperty/toDelegateFor/localCaptured.kt +++ b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/localCaptured.kt @@ -9,7 +9,7 @@ fun runLogged(entry: String, action: () -> T): T { return action() } -operator fun String.toDelegateFor(host: Any?, p: Any): String = +operator fun String.provideDelegate(host: Any?, p: Any): String = runLogged("tdf($this);") { this } operator fun String.getValue(receiver: Any?, p: Any): String = diff --git a/compiler/testData/codegen/box/delegatedProperty/toDelegateFor/localDifferentReceivers.kt b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/localDifferentReceivers.kt similarity index 91% rename from compiler/testData/codegen/box/delegatedProperty/toDelegateFor/localDifferentReceivers.kt rename to compiler/testData/codegen/box/delegatedProperty/provideDelegate/localDifferentReceivers.kt index 60f4ae79446..387236a5640 100644 --- a/compiler/testData/codegen/box/delegatedProperty/toDelegateFor/localDifferentReceivers.kt +++ b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/localDifferentReceivers.kt @@ -16,7 +16,7 @@ fun runLogged2(entry: String, action: () -> MyClass): MyClass { return action() } -operator fun MyClass.toDelegateFor(host: Any?, p: Any): String = +operator fun MyClass.provideDelegate(host: Any?, p: Any): String = runLogged("tdf(${this.value});") { this.value } operator fun String.getValue(receiver: Any?, p: Any): String = diff --git a/compiler/testData/codegen/box/delegatedProperty/toDelegateFor/memberExtension.kt b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/memberExtension.kt similarity index 73% rename from compiler/testData/codegen/box/delegatedProperty/toDelegateFor/memberExtension.kt rename to compiler/testData/codegen/box/delegatedProperty/provideDelegate/memberExtension.kt index 4ccceac299b..7cfa5f86b0c 100644 --- a/compiler/testData/codegen/box/delegatedProperty/toDelegateFor/memberExtension.kt +++ b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/memberExtension.kt @@ -5,7 +5,7 @@ object Host { operator fun getValue(receiver: String, p: Any) = receiver + s } - operator fun String.toDelegateFor(host: Any?, p: Any) = StringDelegate(this) + operator fun String.provideDelegate(host: Any?, p: Any) = StringDelegate(this) val String.plusK by "K" diff --git a/compiler/testData/codegen/box/delegatedProperty/toDelegateFor/propertyMetadata.kt b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/propertyMetadata.kt similarity index 89% rename from compiler/testData/codegen/box/delegatedProperty/toDelegateFor/propertyMetadata.kt rename to compiler/testData/codegen/box/delegatedProperty/provideDelegate/propertyMetadata.kt index 934ac8cfd3f..549b1b249e4 100644 --- a/compiler/testData/codegen/box/delegatedProperty/toDelegateFor/propertyMetadata.kt +++ b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/propertyMetadata.kt @@ -10,7 +10,7 @@ inline fun runLogged(entry: String, action: () -> T): T { return action() } -operator fun String.toDelegateFor(host: Any?, p: KProperty<*>): String = +operator fun String.provideDelegate(host: Any?, p: KProperty<*>): String = if (p.name == this) runLogged("tdf($this);") { this } else "fail 1" operator fun String.getValue(receiver: Any?, p: KProperty<*>): String = diff --git a/compiler/testData/codegen/light-analysis/delegatedProperty/toDelegateFor/differentReceivers.txt b/compiler/testData/codegen/light-analysis/delegatedProperty/provideDelegate/differentReceivers.txt similarity index 90% rename from compiler/testData/codegen/light-analysis/delegatedProperty/toDelegateFor/differentReceivers.txt rename to compiler/testData/codegen/light-analysis/delegatedProperty/provideDelegate/differentReceivers.txt index f11995206b3..de8eca093bd 100644 --- a/compiler/testData/codegen/light-analysis/delegatedProperty/toDelegateFor/differentReceivers.txt +++ b/compiler/testData/codegen/light-analysis/delegatedProperty/provideDelegate/differentReceivers.txt @@ -10,9 +10,9 @@ public final class DifferentReceiversKt { public final static @org.jetbrains.annotations.NotNull method getTestO(): java.lang.String public final static @org.jetbrains.annotations.NotNull method getTestOK(): java.lang.String public final static @org.jetbrains.annotations.NotNull method getValue(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.Nullable p1: java.lang.Object, @org.jetbrains.annotations.NotNull p2: java.lang.Object): java.lang.String + public final static @org.jetbrains.annotations.NotNull method provideDelegate(@org.jetbrains.annotations.NotNull p0: MyClass, @org.jetbrains.annotations.Nullable p1: java.lang.Object, @org.jetbrains.annotations.NotNull p2: java.lang.Object): java.lang.String public final static method runLogged(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.NotNull p1: kotlin.jvm.functions.Function0): java.lang.Object public final static method setLog(@org.jetbrains.annotations.NotNull p0: java.lang.String): void - public final static @org.jetbrains.annotations.NotNull method toDelegateFor(@org.jetbrains.annotations.NotNull p0: MyClass, @org.jetbrains.annotations.Nullable p1: java.lang.Object, @org.jetbrains.annotations.NotNull p2: java.lang.Object): java.lang.String } diff --git a/compiler/testData/codegen/light-analysis/delegatedProperty/toDelegateFor/evaluationOrder.txt b/compiler/testData/codegen/light-analysis/delegatedProperty/provideDelegate/evaluationOrder.txt similarity index 88% rename from compiler/testData/codegen/light-analysis/delegatedProperty/toDelegateFor/evaluationOrder.txt rename to compiler/testData/codegen/light-analysis/delegatedProperty/provideDelegate/evaluationOrder.txt index 979c15e8c82..d0decbd6b6c 100644 --- a/compiler/testData/codegen/light-analysis/delegatedProperty/toDelegateFor/evaluationOrder.txt +++ b/compiler/testData/codegen/light-analysis/delegatedProperty/provideDelegate/evaluationOrder.txt @@ -10,7 +10,7 @@ public final class EvaluationOrderKt { public final static @org.jetbrains.annotations.NotNull method getTestO(): java.lang.String public final static @org.jetbrains.annotations.NotNull method getTestOK(): java.lang.String public final static @org.jetbrains.annotations.NotNull method getValue(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.Nullable p1: java.lang.Object, @org.jetbrains.annotations.NotNull p2: java.lang.Object): java.lang.String + public final static @org.jetbrains.annotations.NotNull method provideDelegate(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.Nullable p1: java.lang.Object, @org.jetbrains.annotations.NotNull p2: java.lang.Object): java.lang.String public final static method runLogged(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.NotNull p1: kotlin.jvm.functions.Function0): java.lang.Object public final static method setLog(@org.jetbrains.annotations.NotNull p0: java.lang.String): void - public final static @org.jetbrains.annotations.NotNull method toDelegateFor(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.Nullable p1: java.lang.Object, @org.jetbrains.annotations.NotNull p2: java.lang.Object): java.lang.String } diff --git a/compiler/testData/codegen/light-analysis/delegatedProperty/toDelegateFor/evaluationOrderVar.txt b/compiler/testData/codegen/light-analysis/delegatedProperty/provideDelegate/evaluationOrderVar.txt similarity index 91% rename from compiler/testData/codegen/light-analysis/delegatedProperty/toDelegateFor/evaluationOrderVar.txt rename to compiler/testData/codegen/light-analysis/delegatedProperty/provideDelegate/evaluationOrderVar.txt index b5686e84340..7179b406db5 100644 --- a/compiler/testData/codegen/light-analysis/delegatedProperty/toDelegateFor/evaluationOrderVar.txt +++ b/compiler/testData/codegen/light-analysis/delegatedProperty/provideDelegate/evaluationOrderVar.txt @@ -12,10 +12,10 @@ public final class EvaluationOrderVarKt { public final static @org.jetbrains.annotations.NotNull method getTestO(): java.lang.String public final static @org.jetbrains.annotations.NotNull method getTestOK(): java.lang.String public final static @org.jetbrains.annotations.NotNull method getValue(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.Nullable p1: java.lang.Object, @org.jetbrains.annotations.NotNull p2: java.lang.Object): java.lang.String + public final static @org.jetbrains.annotations.NotNull method provideDelegate(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.Nullable p1: java.lang.Object, @org.jetbrains.annotations.NotNull p2: java.lang.Object): java.lang.String public final static method runLogged(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.NotNull p1: kotlin.jvm.functions.Function0): java.lang.Object public final static method setLog(@org.jetbrains.annotations.NotNull p0: java.lang.String): void public final static method setTestK(@org.jetbrains.annotations.NotNull p0: java.lang.String): void public final static method setTestO(@org.jetbrains.annotations.NotNull p0: java.lang.String): void public final static method setValue(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.Nullable p1: java.lang.Object, @org.jetbrains.annotations.NotNull p2: java.lang.Object, @org.jetbrains.annotations.NotNull p3: java.lang.String): void - public final static @org.jetbrains.annotations.NotNull method toDelegateFor(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.Nullable p1: java.lang.Object, @org.jetbrains.annotations.NotNull p2: java.lang.Object): java.lang.String -} +} \ No newline at end of file diff --git a/compiler/testData/codegen/light-analysis/delegatedProperty/toDelegateFor/extensionDelegated.txt b/compiler/testData/codegen/light-analysis/delegatedProperty/provideDelegate/extensionDelegated.txt similarity index 100% rename from compiler/testData/codegen/light-analysis/delegatedProperty/toDelegateFor/extensionDelegated.txt rename to compiler/testData/codegen/light-analysis/delegatedProperty/provideDelegate/extensionDelegated.txt diff --git a/compiler/testData/codegen/light-analysis/delegatedProperty/toDelegateFor/generic.txt b/compiler/testData/codegen/light-analysis/delegatedProperty/provideDelegate/generic.txt similarity index 90% rename from compiler/testData/codegen/light-analysis/delegatedProperty/toDelegateFor/generic.txt rename to compiler/testData/codegen/light-analysis/delegatedProperty/provideDelegate/generic.txt index 04696cfffd0..1885637a6fa 100644 --- a/compiler/testData/codegen/light-analysis/delegatedProperty/toDelegateFor/generic.txt +++ b/compiler/testData/codegen/light-analysis/delegatedProperty/provideDelegate/generic.txt @@ -10,9 +10,9 @@ public final class GenericKt { public final static @org.jetbrains.annotations.NotNull method getTestO(): MyClass public final static @org.jetbrains.annotations.NotNull method getTestOK(): java.lang.String public final static method getValue(p0: java.lang.Object, @org.jetbrains.annotations.Nullable p1: java.lang.Object, @org.jetbrains.annotations.NotNull p2: java.lang.Object): java.lang.Object + public final static @org.jetbrains.annotations.NotNull method provideDelegate(@org.jetbrains.annotations.NotNull p0: MyClass, @org.jetbrains.annotations.Nullable p1: java.lang.Object, @org.jetbrains.annotations.NotNull p2: java.lang.Object): MyClass public final static method runLogged(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.NotNull p1: kotlin.jvm.functions.Function0): java.lang.Object public final static method setLog(@org.jetbrains.annotations.NotNull p0: java.lang.String): void - public final static @org.jetbrains.annotations.NotNull method toDelegateFor(@org.jetbrains.annotations.NotNull p0: MyClass, @org.jetbrains.annotations.Nullable p1: java.lang.Object, @org.jetbrains.annotations.NotNull p2: java.lang.Object): MyClass } diff --git a/compiler/testData/codegen/light-analysis/delegatedProperty/toDelegateFor/inClass.txt b/compiler/testData/codegen/light-analysis/delegatedProperty/provideDelegate/inClass.txt similarity index 88% rename from compiler/testData/codegen/light-analysis/delegatedProperty/toDelegateFor/inClass.txt rename to compiler/testData/codegen/light-analysis/delegatedProperty/provideDelegate/inClass.txt index 59fc529fb06..e6628f0e7b9 100644 --- a/compiler/testData/codegen/light-analysis/delegatedProperty/toDelegateFor/inClass.txt +++ b/compiler/testData/codegen/light-analysis/delegatedProperty/provideDelegate/inClass.txt @@ -3,9 +3,9 @@ public final class InClassKt { public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String public final static @org.jetbrains.annotations.NotNull method getLog(): java.lang.String public final static @org.jetbrains.annotations.NotNull method getValue(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.Nullable p1: java.lang.Object, @org.jetbrains.annotations.NotNull p2: java.lang.Object): java.lang.String + public final static @org.jetbrains.annotations.NotNull method provideDelegate(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.Nullable p1: java.lang.Object, @org.jetbrains.annotations.NotNull p2: java.lang.Object): java.lang.String public final static method runLogged(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.NotNull p1: kotlin.jvm.functions.Function0): java.lang.Object public final static method setLog(@org.jetbrains.annotations.NotNull p0: java.lang.String): void - public final static @org.jetbrains.annotations.NotNull method toDelegateFor(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.Nullable p1: java.lang.Object, @org.jetbrains.annotations.NotNull p2: java.lang.Object): java.lang.String } diff --git a/compiler/testData/codegen/light-analysis/delegatedProperty/toDelegateFor/inlineToDelegateFor.txt b/compiler/testData/codegen/light-analysis/delegatedProperty/provideDelegate/inlineProvideDelegate.txt similarity index 85% rename from compiler/testData/codegen/light-analysis/delegatedProperty/toDelegateFor/inlineToDelegateFor.txt rename to compiler/testData/codegen/light-analysis/delegatedProperty/provideDelegate/inlineProvideDelegate.txt index ae1ddb13606..56abef78195 100644 --- a/compiler/testData/codegen/light-analysis/delegatedProperty/toDelegateFor/inlineToDelegateFor.txt +++ b/compiler/testData/codegen/light-analysis/delegatedProperty/provideDelegate/inlineProvideDelegate.txt @@ -1,4 +1,5 @@ -public final class InlineToDelegateForKt { + +public final class InlineProvideDelegateKt { private synthetic final static field $$delegatedProperties: kotlin.reflect.KProperty[] private static @org.jetbrains.annotations.NotNull field log: java.lang.String private final static @org.jetbrains.annotations.NotNull field testK$delegate: java.lang.String @@ -10,7 +11,7 @@ public final class InlineToDelegateForKt { public final static @org.jetbrains.annotations.NotNull method getTestO(): java.lang.String public final static @org.jetbrains.annotations.NotNull method getTestOK(): java.lang.String public final static @org.jetbrains.annotations.NotNull method getValue(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.Nullable p1: java.lang.Object, @org.jetbrains.annotations.NotNull p2: java.lang.Object): java.lang.String + public final static @org.jetbrains.annotations.NotNull method provideDelegate(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.Nullable p1: java.lang.Object, @org.jetbrains.annotations.NotNull p2: java.lang.Object): java.lang.String public final static method runLogged(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.NotNull p1: kotlin.jvm.functions.Function0): java.lang.Object public final static method setLog(@org.jetbrains.annotations.NotNull p0: java.lang.String): void - public final static @org.jetbrains.annotations.NotNull method toDelegateFor(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.Nullable p1: java.lang.Object, @org.jetbrains.annotations.NotNull p2: java.lang.Object): java.lang.String -} +} \ No newline at end of file diff --git a/compiler/testData/codegen/light-analysis/delegatedProperty/toDelegateFor/jvmStaticInObject.txt b/compiler/testData/codegen/light-analysis/delegatedProperty/provideDelegate/jvmStaticInObject.txt similarity index 90% rename from compiler/testData/codegen/light-analysis/delegatedProperty/toDelegateFor/jvmStaticInObject.txt rename to compiler/testData/codegen/light-analysis/delegatedProperty/provideDelegate/jvmStaticInObject.txt index e2d4e7af8a0..b2d28dce3ae 100644 --- a/compiler/testData/codegen/light-analysis/delegatedProperty/toDelegateFor/jvmStaticInObject.txt +++ b/compiler/testData/codegen/light-analysis/delegatedProperty/provideDelegate/jvmStaticInObject.txt @@ -3,9 +3,9 @@ public final class JvmStaticInObjectKt { public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String public final static @org.jetbrains.annotations.NotNull method getLog(): java.lang.String public final static @org.jetbrains.annotations.NotNull method getValue(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.Nullable p1: java.lang.Object, @org.jetbrains.annotations.NotNull p2: java.lang.Object): java.lang.String + public final static @org.jetbrains.annotations.NotNull method provideDelegate(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.Nullable p1: java.lang.Object, @org.jetbrains.annotations.NotNull p2: java.lang.Object): java.lang.String public final static method runLogged(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.NotNull p1: kotlin.jvm.functions.Function0): java.lang.Object public final static method setLog(@org.jetbrains.annotations.NotNull p0: java.lang.String): void - public final static @org.jetbrains.annotations.NotNull method toDelegateFor(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.Nullable p1: java.lang.Object, @org.jetbrains.annotations.NotNull p2: java.lang.Object): java.lang.String } diff --git a/compiler/testData/codegen/light-analysis/delegatedProperty/toDelegateFor/local.txt b/compiler/testData/codegen/light-analysis/delegatedProperty/provideDelegate/local.txt similarity index 81% rename from compiler/testData/codegen/light-analysis/delegatedProperty/toDelegateFor/local.txt rename to compiler/testData/codegen/light-analysis/delegatedProperty/provideDelegate/local.txt index 4839e649c23..445be14e911 100644 --- a/compiler/testData/codegen/light-analysis/delegatedProperty/toDelegateFor/local.txt +++ b/compiler/testData/codegen/light-analysis/delegatedProperty/provideDelegate/local.txt @@ -3,7 +3,7 @@ public final class LocalKt { public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String public final static @org.jetbrains.annotations.NotNull method getLog(): java.lang.String public final static @org.jetbrains.annotations.NotNull method getValue(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.Nullable p1: java.lang.Object, @org.jetbrains.annotations.NotNull p2: java.lang.Object): java.lang.String + public final static @org.jetbrains.annotations.NotNull method provideDelegate(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.Nullable p1: java.lang.Object, @org.jetbrains.annotations.NotNull p2: java.lang.Object): java.lang.String public final static method runLogged(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.NotNull p1: kotlin.jvm.functions.Function0): java.lang.Object public final static method setLog(@org.jetbrains.annotations.NotNull p0: java.lang.String): void - public final static @org.jetbrains.annotations.NotNull method toDelegateFor(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.Nullable p1: java.lang.Object, @org.jetbrains.annotations.NotNull p2: java.lang.Object): java.lang.String -} +} \ No newline at end of file diff --git a/compiler/testData/codegen/light-analysis/delegatedProperty/toDelegateFor/localCaptured.txt b/compiler/testData/codegen/light-analysis/delegatedProperty/provideDelegate/localCaptured.txt similarity index 81% rename from compiler/testData/codegen/light-analysis/delegatedProperty/toDelegateFor/localCaptured.txt rename to compiler/testData/codegen/light-analysis/delegatedProperty/provideDelegate/localCaptured.txt index ab84e37098c..3cd0e21321f 100644 --- a/compiler/testData/codegen/light-analysis/delegatedProperty/toDelegateFor/localCaptured.txt +++ b/compiler/testData/codegen/light-analysis/delegatedProperty/provideDelegate/localCaptured.txt @@ -3,7 +3,7 @@ public final class LocalCapturedKt { public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String public final static @org.jetbrains.annotations.NotNull method getLog(): java.lang.String public final static @org.jetbrains.annotations.NotNull method getValue(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.Nullable p1: java.lang.Object, @org.jetbrains.annotations.NotNull p2: java.lang.Object): java.lang.String + public final static @org.jetbrains.annotations.NotNull method provideDelegate(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.Nullable p1: java.lang.Object, @org.jetbrains.annotations.NotNull p2: java.lang.Object): java.lang.String public final static method runLogged(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.NotNull p1: kotlin.jvm.functions.Function0): java.lang.Object public final static method setLog(@org.jetbrains.annotations.NotNull p0: java.lang.String): void - public final static @org.jetbrains.annotations.NotNull method toDelegateFor(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.Nullable p1: java.lang.Object, @org.jetbrains.annotations.NotNull p2: java.lang.Object): java.lang.String } diff --git a/compiler/testData/codegen/light-analysis/delegatedProperty/toDelegateFor/localDifferentReceivers.txt b/compiler/testData/codegen/light-analysis/delegatedProperty/provideDelegate/localDifferentReceivers.txt similarity index 87% rename from compiler/testData/codegen/light-analysis/delegatedProperty/toDelegateFor/localDifferentReceivers.txt rename to compiler/testData/codegen/light-analysis/delegatedProperty/provideDelegate/localDifferentReceivers.txt index 0e31867f388..3bc4de36192 100644 --- a/compiler/testData/codegen/light-analysis/delegatedProperty/toDelegateFor/localDifferentReceivers.txt +++ b/compiler/testData/codegen/light-analysis/delegatedProperty/provideDelegate/localDifferentReceivers.txt @@ -1,12 +1,13 @@ + public final class LocalDifferentReceiversKt { private static @org.jetbrains.annotations.NotNull field log: java.lang.String public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String public final static @org.jetbrains.annotations.NotNull method getLog(): java.lang.String public final static @org.jetbrains.annotations.NotNull method getValue(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.Nullable p1: java.lang.Object, @org.jetbrains.annotations.NotNull p2: java.lang.Object): java.lang.String + public final static @org.jetbrains.annotations.NotNull method provideDelegate(@org.jetbrains.annotations.NotNull p0: MyClass, @org.jetbrains.annotations.Nullable p1: java.lang.Object, @org.jetbrains.annotations.NotNull p2: java.lang.Object): java.lang.String public final static @org.jetbrains.annotations.NotNull method runLogged(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.NotNull p1: kotlin.jvm.functions.Function0): java.lang.String public final static @org.jetbrains.annotations.NotNull method runLogged2(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.NotNull p1: kotlin.jvm.functions.Function0): MyClass public final static method setLog(@org.jetbrains.annotations.NotNull p0: java.lang.String): void - public final static @org.jetbrains.annotations.NotNull method toDelegateFor(@org.jetbrains.annotations.NotNull p0: MyClass, @org.jetbrains.annotations.Nullable p1: java.lang.Object, @org.jetbrains.annotations.NotNull p2: java.lang.Object): java.lang.String } @@ -14,4 +15,4 @@ public final class MyClass { private final @org.jetbrains.annotations.NotNull field value: java.lang.String public method (@org.jetbrains.annotations.NotNull p0: java.lang.String): void public final @org.jetbrains.annotations.NotNull method getValue(): java.lang.String -} +} \ No newline at end of file diff --git a/compiler/testData/codegen/light-analysis/delegatedProperty/toDelegateFor/memberExtension.txt b/compiler/testData/codegen/light-analysis/delegatedProperty/provideDelegate/memberExtension.txt similarity index 83% rename from compiler/testData/codegen/light-analysis/delegatedProperty/toDelegateFor/memberExtension.txt rename to compiler/testData/codegen/light-analysis/delegatedProperty/provideDelegate/memberExtension.txt index aef3631fc8d..649f3922371 100644 --- a/compiler/testData/codegen/light-analysis/delegatedProperty/toDelegateFor/memberExtension.txt +++ b/compiler/testData/codegen/light-analysis/delegatedProperty/provideDelegate/memberExtension.txt @@ -7,7 +7,7 @@ public final class Host { private method (): void public final @org.jetbrains.annotations.NotNull method getOk(): java.lang.String public final @org.jetbrains.annotations.NotNull method getPlusK(@org.jetbrains.annotations.NotNull p0: java.lang.String): java.lang.String - public final @org.jetbrains.annotations.NotNull method toDelegateFor(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.Nullable p1: java.lang.Object, @org.jetbrains.annotations.NotNull p2: java.lang.Object): Host.StringDelegate + public final @org.jetbrains.annotations.NotNull method provideDelegate(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.Nullable p1: java.lang.Object, @org.jetbrains.annotations.NotNull p2: java.lang.Object): Host.StringDelegate } diff --git a/compiler/testData/codegen/light-analysis/delegatedProperty/toDelegateFor/propertyMetadata.txt b/compiler/testData/codegen/light-analysis/delegatedProperty/provideDelegate/propertyMetadata.txt similarity index 87% rename from compiler/testData/codegen/light-analysis/delegatedProperty/toDelegateFor/propertyMetadata.txt rename to compiler/testData/codegen/light-analysis/delegatedProperty/provideDelegate/propertyMetadata.txt index ad49179ad3c..341a4d79d2a 100644 --- a/compiler/testData/codegen/light-analysis/delegatedProperty/toDelegateFor/propertyMetadata.txt +++ b/compiler/testData/codegen/light-analysis/delegatedProperty/provideDelegate/propertyMetadata.txt @@ -10,7 +10,7 @@ public final class PropertyMetadataKt { public final static @org.jetbrains.annotations.NotNull method getO(): java.lang.String public final static @org.jetbrains.annotations.NotNull method getOK(): java.lang.String public final static @org.jetbrains.annotations.NotNull method getValue(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.Nullable p1: java.lang.Object, @org.jetbrains.annotations.NotNull p2: kotlin.reflect.KProperty): java.lang.String + public final static @org.jetbrains.annotations.NotNull method provideDelegate(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.Nullable p1: java.lang.Object, @org.jetbrains.annotations.NotNull p2: kotlin.reflect.KProperty): java.lang.String public final static method runLogged(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.NotNull p1: kotlin.jvm.functions.Function0): java.lang.Object public final static method setLog(@org.jetbrains.annotations.NotNull p0: java.lang.String): void - public final static @org.jetbrains.annotations.NotNull method toDelegateFor(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.Nullable p1: java.lang.Object, @org.jetbrains.annotations.NotNull p2: kotlin.reflect.KProperty): java.lang.String -} +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/commonCaseForInference.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/commonCaseForInference.kt similarity index 82% rename from compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/commonCaseForInference.kt rename to compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/commonCaseForInference.kt index 8bd333de979..6e8c8b35ee4 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/commonCaseForInference.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/commonCaseForInference.kt @@ -5,7 +5,7 @@ object CommonCase { fun delegate() : Fas = TODO() - operator fun Fas.toDelegateFor(host: D, p: Any?): Fas = TODO() + operator fun Fas.provideDelegate(host: D, p: Any?): Fas = TODO() operator fun Fas.getValue(receiver: E, p: Any?): R = TODO() val Long.test1: String by delegate() // common test, not working because of Inference1 diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/commonCaseForInference.txt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/commonCaseForInference.txt similarity index 91% rename from compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/commonCaseForInference.txt rename to compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/commonCaseForInference.txt index 33752f70eb9..fa8475d1e30 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/commonCaseForInference.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/commonCaseForInference.txt @@ -9,7 +9,7 @@ public object CommonCase { public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String public final operator fun CommonCase.Fas.getValue(/*0*/ receiver: E, /*1*/ p: kotlin.Any?): R - public final operator fun CommonCase.Fas.toDelegateFor(/*0*/ host: D, /*1*/ p: kotlin.Any?): CommonCase.Fas + public final operator fun CommonCase.Fas.provideDelegate(/*0*/ host: D, /*1*/ p: kotlin.Any?): CommonCase.Fas public interface Fas { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/genericToDelegateFor.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/genericProvideDelegate.kt similarity index 77% rename from compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/genericToDelegateFor.kt rename to compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/genericProvideDelegate.kt index fa6f288130a..5ccafeeeac3 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/genericToDelegateFor.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/genericProvideDelegate.kt @@ -4,7 +4,7 @@ class Cell(val value: V) class GenericDelegate(val value: V) -operator fun T.toDelegateFor(a: Any?, p: Any?) = GenericDelegate(this) +operator fun T.provideDelegate(a: Any?, p: Any?) = GenericDelegate(this) operator fun GenericDelegate.getValue(a: Any?, p: Any?) = Cell(value) diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/genericToDelegateFor.txt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/genericProvideDelegate.txt similarity index 90% rename from compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/genericToDelegateFor.txt rename to compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/genericProvideDelegate.txt index 091a4c816e7..3b7ffb36d02 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/genericToDelegateFor.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/genericProvideDelegate.txt @@ -4,7 +4,7 @@ public val test1: Cell public val test2: Cell public val test3: Cell public operator fun GenericDelegate.getValue(/*0*/ a: kotlin.Any?, /*1*/ p: kotlin.Any?): Cell -public operator fun T.toDelegateFor(/*0*/ a: kotlin.Any?, /*1*/ p: kotlin.Any?): GenericDelegate +public operator fun T.provideDelegate(/*0*/ a: kotlin.Any?, /*1*/ p: kotlin.Any?): GenericDelegate public final class Cell { public constructor Cell(/*0*/ value: V) diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/hostAndReceiver1.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver1.kt similarity index 76% rename from compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/hostAndReceiver1.kt rename to compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver1.kt index e6948ab1028..ceb77156dbc 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/hostAndReceiver1.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver1.kt @@ -1,7 +1,7 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER object T1 { - operator fun Int.toDelegateFor(host: T1, p: Any): Long = 2 + operator fun Int.provideDelegate(host: T1, p: Any): Long = 2 operator fun Long.getValue(receiver: String, p: Any): Double = 1.0 val String.test1 by 1 diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/hostAndReceiver1.txt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver1.txt similarity index 83% rename from compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/hostAndReceiver1.txt rename to compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver1.txt index 3d691cecb47..2530898e6b0 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/hostAndReceiver1.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver1.txt @@ -8,5 +8,5 @@ public object T1 { public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String public final operator fun kotlin.Long.getValue(/*0*/ receiver: kotlin.String, /*1*/ p: kotlin.Any): kotlin.Double - public final operator fun kotlin.Int.toDelegateFor(/*0*/ host: T1, /*1*/ p: kotlin.Any): kotlin.Long + public final operator fun kotlin.Int.provideDelegate(/*0*/ host: T1, /*1*/ p: kotlin.Any): kotlin.Long } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/hostAndReceiver2.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver2.kt similarity index 79% rename from compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/hostAndReceiver2.kt rename to compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver2.kt index 695c9bc5436..4431d542f5a 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/hostAndReceiver2.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver2.kt @@ -5,7 +5,7 @@ object T2 { fun delegate(): Foo = TODO() - operator fun Foo.toDelegateFor(host: T2, p: Any?): Foo = TODO() + operator fun Foo.provideDelegate(host: T2, p: Any?): Foo = TODO() operator fun Foo.getValue(receiver: String, p: Any?): T = TODO() val String.test1: String by delegate() diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/hostAndReceiver2.txt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver2.txt similarity index 88% rename from compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/hostAndReceiver2.txt rename to compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver2.txt index c0458a3ec02..c4ace134c71 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/hostAndReceiver2.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver2.txt @@ -9,7 +9,7 @@ public object T2 { public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String public final operator fun T2.Foo.getValue(/*0*/ receiver: kotlin.String, /*1*/ p: kotlin.Any?): T - public final operator fun T2.Foo.toDelegateFor(/*0*/ host: T2, /*1*/ p: kotlin.Any?): T2.Foo + public final operator fun T2.Foo.provideDelegate(/*0*/ host: T2, /*1*/ p: kotlin.Any?): T2.Foo public interface Foo { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/hostAndReceiver3.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver3.kt similarity index 73% rename from compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/hostAndReceiver3.kt rename to compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver3.kt index f408772b82a..724f8ffddad 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/hostAndReceiver3.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver3.kt @@ -5,7 +5,7 @@ object T3 { fun delegate(): Foo = TODO() - operator fun Foo.toDelegateFor(host: T3, p: Any?): Foo = TODO() + operator fun Foo.provideDelegate(host: T3, p: Any?): Foo = TODO() operator fun Foo.getValue(receiver: T3, p: Any?): T = TODO() val test1: String by delegate() diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/hostAndReceiver3.txt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver3.txt similarity index 87% rename from compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/hostAndReceiver3.txt rename to compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver3.txt index 8c2839bdd3b..fb9ae66e2fb 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/hostAndReceiver3.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver3.txt @@ -8,7 +8,7 @@ public object T3 { public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String public final operator fun T3.Foo.getValue(/*0*/ receiver: T3, /*1*/ p: kotlin.Any?): T - public final operator fun T3.Foo.toDelegateFor(/*0*/ host: T3, /*1*/ p: kotlin.Any?): T3.Foo + public final operator fun T3.Foo.provideDelegate(/*0*/ host: T3, /*1*/ p: kotlin.Any?): T3.Foo public interface Foo { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/inferenceFromReceiver1.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/inferenceFromReceiver1.kt similarity index 100% rename from compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/inferenceFromReceiver1.kt rename to compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/inferenceFromReceiver1.kt diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/inferenceFromReceiver1.txt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/inferenceFromReceiver1.txt similarity index 100% rename from compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/inferenceFromReceiver1.txt rename to compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/inferenceFromReceiver1.txt diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/inferenceFromReceiver2.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/inferenceFromReceiver2.kt similarity index 82% rename from compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/inferenceFromReceiver2.kt rename to compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/inferenceFromReceiver2.kt index 21ec10f39c3..251791843fa 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/inferenceFromReceiver2.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/inferenceFromReceiver2.kt @@ -5,7 +5,7 @@ object Inference2 { fun delegate(): Foo = TODO() - operator fun Foo.toDelegateFor(host: T, p: Any?): Foo = TODO() + operator fun Foo.provideDelegate(host: T, p: Any?): Foo = TODO() operator fun Foo.getValue(receiver: Inference2, p: Any?): String = TODO() val test1: String by delegate() // same story like in Inference1 diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/inferenceFromReceiver2.txt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/inferenceFromReceiver2.txt similarity index 87% rename from compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/inferenceFromReceiver2.txt rename to compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/inferenceFromReceiver2.txt index fbdd2001b3c..8a5b3fdde07 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/inferenceFromReceiver2.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/inferenceFromReceiver2.txt @@ -9,7 +9,7 @@ public object Inference2 { public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String public final operator fun Inference2.Foo.getValue(/*0*/ receiver: Inference2, /*1*/ p: kotlin.Any?): kotlin.String - public final operator fun Inference2.Foo.toDelegateFor(/*0*/ host: T, /*1*/ p: kotlin.Any?): Inference2.Foo + public final operator fun Inference2.Foo.provideDelegate(/*0*/ host: T, /*1*/ p: kotlin.Any?): Inference2.Foo public interface Foo { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/localDelegatedProperty.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/localDelegatedProperty.kt similarity index 73% rename from compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/localDelegatedProperty.kt rename to compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/localDelegatedProperty.kt index ebb66fab0a5..59e33c206a2 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/localDelegatedProperty.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/localDelegatedProperty.kt @@ -2,7 +2,7 @@ import kotlin.reflect.KProperty -operator fun String.toDelegateFor(a: Any?, p: KProperty<*>) = this +operator fun String.provideDelegate(a: Any?, p: KProperty<*>) = this operator fun String.getValue(a: Any?, p: KProperty<*>) = this fun test(): String { diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/localDelegatedProperty.txt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/localDelegatedProperty.txt similarity index 56% rename from compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/localDelegatedProperty.txt rename to compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/localDelegatedProperty.txt index e5068008aff..960f7b1dd5a 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/localDelegatedProperty.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/localDelegatedProperty.txt @@ -2,4 +2,4 @@ package public fun test(): kotlin.String public operator fun kotlin.String.getValue(/*0*/ a: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>): kotlin.String -public operator fun kotlin.String.toDelegateFor(/*0*/ a: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>): kotlin.String +public operator fun kotlin.String.provideDelegate(/*0*/ a: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>): kotlin.String diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/noOperatorModifierOnToDelegateFor.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/noOperatorModifierOnProvideDelegate.kt similarity index 83% rename from compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/noOperatorModifierOnToDelegateFor.kt rename to compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/noOperatorModifierOnProvideDelegate.kt index 937d02a803c..f7f7426ec7a 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/noOperatorModifierOnToDelegateFor.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/noOperatorModifierOnProvideDelegate.kt @@ -7,7 +7,7 @@ class StringDelegate(val s: String) { } // NB no operator -fun String.toDelegateFor(a: Any?, p: KProperty<*>) = StringDelegate(this) +fun String.provideDelegate(a: Any?, p: KProperty<*>) = StringDelegate(this) operator fun String.getValue(a: Any?, p: KProperty<*>) = this diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/noOperatorModifierOnToDelegateFor.txt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/noOperatorModifierOnProvideDelegate.txt similarity index 86% rename from compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/noOperatorModifierOnToDelegateFor.txt rename to compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/noOperatorModifierOnProvideDelegate.txt index acad04ada03..e98b81e48f3 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/noOperatorModifierOnToDelegateFor.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/noOperatorModifierOnProvideDelegate.txt @@ -4,7 +4,7 @@ public val test1: kotlin.String public val test2: kotlin.Int public val test3: kotlin.String public operator fun kotlin.String.getValue(/*0*/ a: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>): kotlin.String -public fun kotlin.String.toDelegateFor(/*0*/ a: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>): StringDelegate +public fun kotlin.String.provideDelegate(/*0*/ a: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>): StringDelegate public final class StringDelegate { public constructor StringDelegate(/*0*/ s: kotlin.String) diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/provideDelegateOperatorDeclaration.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/provideDelegateOperatorDeclaration.kt new file mode 100644 index 00000000000..e620326a94b --- /dev/null +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/provideDelegateOperatorDeclaration.kt @@ -0,0 +1,32 @@ +// !DIAGNOSTICS: -UNUSED_PARAMETER + +import kotlin.reflect.KProperty + +operator fun provideDelegate(x: Any?, p: KProperty<*>) {} + +operator fun Any.provideDelegate(x: Any?, p: KProperty<*>) {} + +operator fun Any.provideDelegate(x: Any?, p: Any) {} + +operator fun Any.provideDelegate(x: Any?, p: Int) {} + +class Host1 { + operator fun provideDelegate(x: Any?, p: KProperty<*>) {} +} + +class Host2 { + operator fun Any.provideDelegate(x: Any?, p: KProperty<*>) {} +} + +class Host3 { + operator fun provideDelegate(x: Any?, p: KProperty<*>, foo: Int) {} +} + +class Host4 { + operator fun provideDelegate(x: Any?, p: KProperty<*>, foo: Int = 0) {} +} + +class Host5 { + operator fun provideDelegate(x: Any?, p: KProperty<*>, vararg foo: Int) {} +} + diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/toDelegateForOperatorDeclaration.txt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/provideDelegateOperatorDeclaration.txt similarity index 58% rename from compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/toDelegateForOperatorDeclaration.txt rename to compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/provideDelegateOperatorDeclaration.txt index 07e3e13399d..4b4e68284b0 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/toDelegateForOperatorDeclaration.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/provideDelegateOperatorDeclaration.txt @@ -1,15 +1,15 @@ package -public operator fun toDelegateFor(/*0*/ x: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>): kotlin.Unit -public operator fun kotlin.Any.toDelegateFor(/*0*/ x: kotlin.Any?, /*1*/ p: kotlin.Any): kotlin.Unit -public operator fun kotlin.Any.toDelegateFor(/*0*/ x: kotlin.Any?, /*1*/ p: kotlin.Int): kotlin.Unit -public operator fun kotlin.Any.toDelegateFor(/*0*/ x: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>): kotlin.Unit +public operator fun provideDelegate(/*0*/ x: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>): kotlin.Unit +public operator fun kotlin.Any.provideDelegate(/*0*/ x: kotlin.Any?, /*1*/ p: kotlin.Any): kotlin.Unit +public operator fun kotlin.Any.provideDelegate(/*0*/ x: kotlin.Any?, /*1*/ p: kotlin.Int): kotlin.Unit +public operator fun kotlin.Any.provideDelegate(/*0*/ x: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>): kotlin.Unit public final class Host1 { public constructor Host1() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final operator fun toDelegateFor(/*0*/ x: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>): kotlin.Unit + public final operator fun provideDelegate(/*0*/ x: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } @@ -18,14 +18,14 @@ public final class Host2 { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - public final operator fun kotlin.Any.toDelegateFor(/*0*/ x: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>): kotlin.Unit + public final operator fun kotlin.Any.provideDelegate(/*0*/ x: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>): kotlin.Unit } public final class Host3 { public constructor Host3() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final operator fun toDelegateFor(/*0*/ x: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>, /*2*/ foo: kotlin.Int): kotlin.Unit + public final operator fun provideDelegate(/*0*/ x: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>, /*2*/ foo: kotlin.Int): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } @@ -33,7 +33,7 @@ public final class Host4 { public constructor Host4() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final operator fun toDelegateFor(/*0*/ x: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>, /*2*/ foo: kotlin.Int = ...): kotlin.Unit + public final operator fun provideDelegate(/*0*/ x: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>, /*2*/ foo: kotlin.Int = ...): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } @@ -41,6 +41,6 @@ public final class Host5 { public constructor Host5() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final operator fun toDelegateFor(/*0*/ x: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>, /*2*/ vararg foo: kotlin.Int /*kotlin.IntArray*/): kotlin.Unit + public final operator fun provideDelegate(/*0*/ x: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>, /*2*/ vararg foo: kotlin.Int /*kotlin.IntArray*/): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/setValue.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/setValue.kt similarity index 75% rename from compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/setValue.kt rename to compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/setValue.kt index fcfca632533..c2029228de9 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/setValue.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/setValue.kt @@ -5,12 +5,12 @@ class Delegate operator fun Delegate<*>.getValue(receiver: Any?, p: Any): String = "" operator fun Delegate.setValue(receiver: Any?, p: Any, value: T) {} -operator fun String.toDelegateFor(receiver: Any?, p: Any) = Delegate() +operator fun String.provideDelegate(receiver: Any?, p: Any) = Delegate() var test1: String by Delegate() var test2: String by Delegate() var test3: String by "OK" -var test4: String by "OK".toDelegateFor(null, "") -var test5: String by "OK".toDelegateFor(null, "") \ No newline at end of file +var test4: String by "OK".provideDelegate(null, "") +var test5: String by "OK".provideDelegate(null, "") \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/setValue.txt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/setValue.txt similarity index 85% rename from compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/setValue.txt rename to compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/setValue.txt index 197f0da8529..d61ae7afa10 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/setValue.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/setValue.txt @@ -6,8 +6,8 @@ public var test3: kotlin.String public var test4: kotlin.String public var test5: kotlin.String public operator fun Delegate<*>.getValue(/*0*/ receiver: kotlin.Any?, /*1*/ p: kotlin.Any): kotlin.String +public operator fun kotlin.String.provideDelegate(/*0*/ receiver: kotlin.Any?, /*1*/ p: kotlin.Any): Delegate public operator fun Delegate.setValue(/*0*/ receiver: kotlin.Any?, /*1*/ p: kotlin.Any, /*2*/ value: T): kotlin.Unit -public operator fun kotlin.String.toDelegateFor(/*0*/ receiver: kotlin.Any?, /*1*/ p: kotlin.Any): Delegate public final class Delegate { public constructor Delegate() diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/simpleToDelegateFor.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/simpleProvideDelegate.kt similarity index 71% rename from compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/simpleToDelegateFor.kt rename to compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/simpleProvideDelegate.kt index 1bbf430a2a2..313f52e12ab 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/simpleToDelegateFor.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/simpleProvideDelegate.kt @@ -2,7 +2,7 @@ import kotlin.reflect.KProperty -operator fun String.toDelegateFor(a: Any?, p: KProperty<*>) = this +operator fun String.provideDelegate(a: Any?, p: KProperty<*>) = this operator fun String.getValue(a: Any?, p: KProperty<*>) = this val test1: String by "OK" diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/simpleToDelegateFor.txt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/simpleProvideDelegate.txt similarity index 60% rename from compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/simpleToDelegateFor.txt rename to compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/simpleProvideDelegate.txt index ff40f0214b6..ddba9c1017f 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/simpleToDelegateFor.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/simpleProvideDelegate.txt @@ -3,4 +3,4 @@ package public val test1: kotlin.String public val test2: kotlin.String public operator fun kotlin.String.getValue(/*0*/ a: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>): kotlin.String -public operator fun kotlin.String.toDelegateFor(/*0*/ a: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>): kotlin.String +public operator fun kotlin.String.provideDelegate(/*0*/ a: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>): kotlin.String diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/unsupportedOperatorToDelegateFor.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/unsupportedOperatorProvideDelegate.kt similarity index 67% rename from compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/unsupportedOperatorToDelegateFor.kt rename to compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/unsupportedOperatorProvideDelegate.kt index 6aae15583a0..037c7b6ff2f 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/unsupportedOperatorToDelegateFor.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/unsupportedOperatorProvideDelegate.kt @@ -1,11 +1,11 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -// !LANGUAGE: -OperatorToDelegateFor +// !LANGUAGE: -OperatorProvideDelegate class WrongDelegate(val x: Int) { operator fun getValue(thisRef: Any?, prop: Any): Int = x } -operator fun String.toDelegateFor(thisRef: Any?, prop: Any) = WrongDelegate(this.length) +operator fun String.provideDelegate(thisRef: Any?, prop: Any) = WrongDelegate(this.length) operator fun String.getValue(thisRef: Any?, prop: Any) = this diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/unsupportedOperatorToDelegateFor.txt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/unsupportedOperatorProvideDelegate.txt similarity index 85% rename from compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/unsupportedOperatorToDelegateFor.txt rename to compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/unsupportedOperatorProvideDelegate.txt index 5b6e627f07b..1cf4515b120 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/unsupportedOperatorToDelegateFor.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/unsupportedOperatorProvideDelegate.txt @@ -4,7 +4,7 @@ public val test1: kotlin.String public val test2: kotlin.Int public val test3: kotlin.String public operator fun kotlin.String.getValue(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.Any): kotlin.String -public operator fun kotlin.String.toDelegateFor(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.Any): WrongDelegate +public operator fun kotlin.String.provideDelegate(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.Any): WrongDelegate public final class WrongDelegate { public constructor WrongDelegate(/*0*/ x: kotlin.Int) diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/toDelegateForOperatorDeclaration.kt b/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/toDelegateForOperatorDeclaration.kt deleted file mode 100644 index dac09f1b84c..00000000000 --- a/compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/toDelegateForOperatorDeclaration.kt +++ /dev/null @@ -1,32 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -import kotlin.reflect.KProperty - -operator fun toDelegateFor(x: Any?, p: KProperty<*>) {} - -operator fun Any.toDelegateFor(x: Any?, p: KProperty<*>) {} - -operator fun Any.toDelegateFor(x: Any?, p: Any) {} - -operator fun Any.toDelegateFor(x: Any?, p: Int) {} - -class Host1 { - operator fun toDelegateFor(x: Any?, p: KProperty<*>) {} -} - -class Host2 { - operator fun Any.toDelegateFor(x: Any?, p: KProperty<*>) {} -} - -class Host3 { - operator fun toDelegateFor(x: Any?, p: KProperty<*>, foo: Int) {} -} - -class Host4 { - operator fun toDelegateFor(x: Any?, p: KProperty<*>, foo: Int = 0) {} -} - -class Host5 { - operator fun toDelegateFor(x: Any?, p: KProperty<*>, vararg foo: Int) {} -} - 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 ae2d1ce3a5f..69198ee0a0f 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 @@ -5993,89 +5993,89 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes } } - @TestMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor") + @TestMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class ToDelegateFor extends AbstractIrBlackBoxCodegenTest { - public void testAllFilesPresentInToDelegateFor() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/delegatedProperty/toDelegateFor"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + public static class ProvideDelegate extends AbstractIrBlackBoxCodegenTest { + public void testAllFilesPresentInProvideDelegate() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/delegatedProperty/provideDelegate"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } @TestMetadata("differentReceivers.kt") public void testDifferentReceivers() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/differentReceivers.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/differentReceivers.kt"); doTest(fileName); } @TestMetadata("evaluationOrder.kt") public void testEvaluationOrder() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/evaluationOrder.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/evaluationOrder.kt"); doTest(fileName); } @TestMetadata("evaluationOrderVar.kt") public void testEvaluationOrderVar() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/evaluationOrderVar.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/evaluationOrderVar.kt"); doTest(fileName); } @TestMetadata("extensionDelegated.kt") public void testExtensionDelegated() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/extensionDelegated.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/extensionDelegated.kt"); doTest(fileName); } @TestMetadata("generic.kt") public void testGeneric() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/generic.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/generic.kt"); doTest(fileName); } @TestMetadata("inClass.kt") public void testInClass() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/inClass.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inClass.kt"); doTest(fileName); } - @TestMetadata("inlineToDelegateFor.kt") - public void testInlineToDelegateFor() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/inlineToDelegateFor.kt"); + @TestMetadata("inlineProvideDelegate.kt") + public void testInlineProvideDelegate() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inlineProvideDelegate.kt"); doTest(fileName); } @TestMetadata("jvmStaticInObject.kt") public void testJvmStaticInObject() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/jvmStaticInObject.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/jvmStaticInObject.kt"); doTest(fileName); } @TestMetadata("local.kt") public void testLocal() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/local.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/local.kt"); doTest(fileName); } @TestMetadata("localCaptured.kt") public void testLocalCaptured() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/localCaptured.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/localCaptured.kt"); doTest(fileName); } @TestMetadata("localDifferentReceivers.kt") public void testLocalDifferentReceivers() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/localDifferentReceivers.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/localDifferentReceivers.kt"); doTest(fileName); } @TestMetadata("memberExtension.kt") public void testMemberExtension() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/memberExtension.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/memberExtension.kt"); doTest(fileName); } @TestMetadata("propertyMetadata.kt") public void testPropertyMetadata() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/propertyMetadata.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/propertyMetadata.kt"); doTest(fileName); } } diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java index a5f8ca64adb..b669c07ee85 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java @@ -5809,89 +5809,89 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest { } } - @TestMetadata("compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor") + @TestMetadata("compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class ToDelegateFor extends AbstractDiagnosticsTest { - public void testAllFilesPresentInToDelegateFor() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + public static class ProvideDelegate extends AbstractDiagnosticsTest { + public void testAllFilesPresentInProvideDelegate() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("commonCaseForInference.kt") public void testCommonCaseForInference() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/commonCaseForInference.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/commonCaseForInference.kt"); doTest(fileName); } - @TestMetadata("genericToDelegateFor.kt") - public void testGenericToDelegateFor() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/genericToDelegateFor.kt"); + @TestMetadata("genericProvideDelegate.kt") + public void testGenericProvideDelegate() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/genericProvideDelegate.kt"); doTest(fileName); } @TestMetadata("hostAndReceiver1.kt") public void testHostAndReceiver1() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/hostAndReceiver1.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver1.kt"); doTest(fileName); } @TestMetadata("hostAndReceiver2.kt") public void testHostAndReceiver2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/hostAndReceiver2.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver2.kt"); doTest(fileName); } @TestMetadata("hostAndReceiver3.kt") public void testHostAndReceiver3() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/hostAndReceiver3.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver3.kt"); doTest(fileName); } @TestMetadata("inferenceFromReceiver1.kt") public void testInferenceFromReceiver1() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/inferenceFromReceiver1.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/inferenceFromReceiver1.kt"); doTest(fileName); } @TestMetadata("inferenceFromReceiver2.kt") public void testInferenceFromReceiver2() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/inferenceFromReceiver2.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/inferenceFromReceiver2.kt"); doTest(fileName); } @TestMetadata("localDelegatedProperty.kt") public void testLocalDelegatedProperty() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/localDelegatedProperty.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/localDelegatedProperty.kt"); doTest(fileName); } - @TestMetadata("noOperatorModifierOnToDelegateFor.kt") - public void testNoOperatorModifierOnToDelegateFor() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/noOperatorModifierOnToDelegateFor.kt"); + @TestMetadata("noOperatorModifierOnProvideDelegate.kt") + public void testNoOperatorModifierOnProvideDelegate() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/noOperatorModifierOnProvideDelegate.kt"); + doTest(fileName); + } + + @TestMetadata("provideDelegateOperatorDeclaration.kt") + public void testProvideDelegateOperatorDeclaration() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/provideDelegateOperatorDeclaration.kt"); doTest(fileName); } @TestMetadata("setValue.kt") public void testSetValue() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/setValue.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/setValue.kt"); doTest(fileName); } - @TestMetadata("simpleToDelegateFor.kt") - public void testSimpleToDelegateFor() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/simpleToDelegateFor.kt"); + @TestMetadata("simpleProvideDelegate.kt") + public void testSimpleProvideDelegate() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/simpleProvideDelegate.kt"); doTest(fileName); } - @TestMetadata("toDelegateForOperatorDeclaration.kt") - public void testToDelegateForOperatorDeclaration() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/toDelegateForOperatorDeclaration.kt"); - doTest(fileName); - } - - @TestMetadata("unsupportedOperatorToDelegateFor.kt") - public void testUnsupportedOperatorToDelegateFor() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/delegatedProperty/toDelegateFor/unsupportedOperatorToDelegateFor.kt"); + @TestMetadata("unsupportedOperatorProvideDelegate.kt") + public void testUnsupportedOperatorProvideDelegate() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/unsupportedOperatorProvideDelegate.kt"); doTest(fileName); } } diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java index 7ec93d12adb..a42b08a101e 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java @@ -5993,89 +5993,89 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { } } - @TestMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor") + @TestMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class ToDelegateFor extends AbstractBlackBoxCodegenTest { - public void testAllFilesPresentInToDelegateFor() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/delegatedProperty/toDelegateFor"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + public static class ProvideDelegate extends AbstractBlackBoxCodegenTest { + public void testAllFilesPresentInProvideDelegate() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/delegatedProperty/provideDelegate"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } @TestMetadata("differentReceivers.kt") public void testDifferentReceivers() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/differentReceivers.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/differentReceivers.kt"); doTest(fileName); } @TestMetadata("evaluationOrder.kt") public void testEvaluationOrder() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/evaluationOrder.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/evaluationOrder.kt"); doTest(fileName); } @TestMetadata("evaluationOrderVar.kt") public void testEvaluationOrderVar() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/evaluationOrderVar.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/evaluationOrderVar.kt"); doTest(fileName); } @TestMetadata("extensionDelegated.kt") public void testExtensionDelegated() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/extensionDelegated.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/extensionDelegated.kt"); doTest(fileName); } @TestMetadata("generic.kt") public void testGeneric() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/generic.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/generic.kt"); doTest(fileName); } @TestMetadata("inClass.kt") public void testInClass() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/inClass.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inClass.kt"); doTest(fileName); } - @TestMetadata("inlineToDelegateFor.kt") - public void testInlineToDelegateFor() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/inlineToDelegateFor.kt"); + @TestMetadata("inlineProvideDelegate.kt") + public void testInlineProvideDelegate() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inlineProvideDelegate.kt"); doTest(fileName); } @TestMetadata("jvmStaticInObject.kt") public void testJvmStaticInObject() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/jvmStaticInObject.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/jvmStaticInObject.kt"); doTest(fileName); } @TestMetadata("local.kt") public void testLocal() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/local.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/local.kt"); doTest(fileName); } @TestMetadata("localCaptured.kt") public void testLocalCaptured() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/localCaptured.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/localCaptured.kt"); doTest(fileName); } @TestMetadata("localDifferentReceivers.kt") public void testLocalDifferentReceivers() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/localDifferentReceivers.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/localDifferentReceivers.kt"); doTest(fileName); } @TestMetadata("memberExtension.kt") public void testMemberExtension() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/memberExtension.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/memberExtension.kt"); doTest(fileName); } @TestMetadata("propertyMetadata.kt") public void testPropertyMetadata() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/propertyMetadata.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/propertyMetadata.kt"); doTest(fileName); } } diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeCodegenTestGenerated.java index a5fcc35dfb1..302ab6f7750 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeCodegenTestGenerated.java @@ -5993,89 +5993,89 @@ public class LightAnalysisModeCodegenTestGenerated extends AbstractLightAnalysis } } - @TestMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor") + @TestMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class ToDelegateFor extends AbstractLightAnalysisModeCodegenTest { - public void testAllFilesPresentInToDelegateFor() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/delegatedProperty/toDelegateFor"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); + public static class ProvideDelegate extends AbstractLightAnalysisModeCodegenTest { + public void testAllFilesPresentInProvideDelegate() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/delegatedProperty/provideDelegate"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } @TestMetadata("differentReceivers.kt") public void testDifferentReceivers() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/differentReceivers.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/differentReceivers.kt"); doTest(fileName); } @TestMetadata("evaluationOrder.kt") public void testEvaluationOrder() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/evaluationOrder.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/evaluationOrder.kt"); doTest(fileName); } @TestMetadata("evaluationOrderVar.kt") public void testEvaluationOrderVar() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/evaluationOrderVar.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/evaluationOrderVar.kt"); doTest(fileName); } @TestMetadata("extensionDelegated.kt") public void testExtensionDelegated() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/extensionDelegated.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/extensionDelegated.kt"); doTest(fileName); } @TestMetadata("generic.kt") public void testGeneric() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/generic.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/generic.kt"); doTest(fileName); } @TestMetadata("inClass.kt") public void testInClass() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/inClass.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inClass.kt"); doTest(fileName); } - @TestMetadata("inlineToDelegateFor.kt") - public void testInlineToDelegateFor() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/inlineToDelegateFor.kt"); + @TestMetadata("inlineProvideDelegate.kt") + public void testInlineProvideDelegate() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inlineProvideDelegate.kt"); doTest(fileName); } @TestMetadata("jvmStaticInObject.kt") public void testJvmStaticInObject() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/jvmStaticInObject.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/jvmStaticInObject.kt"); doTest(fileName); } @TestMetadata("local.kt") public void testLocal() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/local.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/local.kt"); doTest(fileName); } @TestMetadata("localCaptured.kt") public void testLocalCaptured() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/localCaptured.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/localCaptured.kt"); doTest(fileName); } @TestMetadata("localDifferentReceivers.kt") public void testLocalDifferentReceivers() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/localDifferentReceivers.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/localDifferentReceivers.kt"); doTest(fileName); } @TestMetadata("memberExtension.kt") public void testMemberExtension() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/memberExtension.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/memberExtension.kt"); doTest(fileName); } @TestMetadata("propertyMetadata.kt") public void testPropertyMetadata() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/propertyMetadata.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/propertyMetadata.kt"); doTest(fileName); } } diff --git a/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt b/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt index 75df3f967fb..0a139b3ac56 100644 --- a/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt +++ b/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt @@ -36,7 +36,7 @@ enum class LanguageFeature(val sinceVersion: LanguageVersion?) { DivisionByZeroInConstantExpressions(KOTLIN_1_1), InlineConstVals(KOTLIN_1_1), OperatorRem(KOTLIN_1_1), - OperatorToDelegateFor(KOTLIN_1_1), + OperatorProvideDelegate(KOTLIN_1_1), // Experimental features MultiPlatformProjects(null), diff --git a/core/descriptors/src/org/jetbrains/kotlin/util/OperatorNameConventions.kt b/core/descriptors/src/org/jetbrains/kotlin/util/OperatorNameConventions.kt index cd4413b8a6f..0fd275f59ab 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/util/OperatorNameConventions.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/util/OperatorNameConventions.kt @@ -22,7 +22,7 @@ object OperatorNameConventions { @JvmField val GET_VALUE = Name.identifier("getValue") @JvmField val SET_VALUE = Name.identifier("setValue") @JvmField val PROPERTY_DELEGATED = Name.identifier("propertyDelegated") - @JvmField val TO_DELEGATE_FOR = Name.identifier("toDelegateFor") + @JvmField val PROVIDE_DELEGATE = Name.identifier("provideDelegate") @JvmField val EQUALS = Name.identifier("equals") @JvmField val COMPARE_TO = Name.identifier("compareTo") diff --git a/core/descriptors/src/org/jetbrains/kotlin/util/modifierChecks.kt b/core/descriptors/src/org/jetbrains/kotlin/util/modifierChecks.kt index b99df7bf56f..d2d36d1ab36 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/util/modifierChecks.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/util/modifierChecks.kt @@ -37,7 +37,7 @@ import org.jetbrains.kotlin.util.OperatorNameConventions.CONTAINS import org.jetbrains.kotlin.util.OperatorNameConventions.COROUTINE_HANDLE_EXCEPTION import org.jetbrains.kotlin.util.OperatorNameConventions.COROUTINE_HANDLE_RESULT import org.jetbrains.kotlin.util.OperatorNameConventions.COROUTINE_INTERCEPT_RESUME -import org.jetbrains.kotlin.util.OperatorNameConventions.TO_DELEGATE_FOR +import org.jetbrains.kotlin.util.OperatorNameConventions.PROVIDE_DELEGATE import org.jetbrains.kotlin.util.OperatorNameConventions.DEC import org.jetbrains.kotlin.util.OperatorNameConventions.EQUALS import org.jetbrains.kotlin.util.OperatorNameConventions.GET @@ -186,7 +186,7 @@ object OperatorChecks : AbstractModifierChecks() { }, Checks(GET_VALUE, MemberOrExtension, NoDefaultAndVarargsCheck, ValueParameterCountCheck.AtLeast(2), IsKPropertyCheck), Checks(SET_VALUE, MemberOrExtension, NoDefaultAndVarargsCheck, ValueParameterCountCheck.AtLeast(3), IsKPropertyCheck), - Checks(TO_DELEGATE_FOR, MemberOrExtension, NoDefaultAndVarargsCheck, ValueParameterCountCheck.Equals(2), IsKPropertyCheck), + Checks(PROVIDE_DELEGATE, MemberOrExtension, NoDefaultAndVarargsCheck, ValueParameterCountCheck.Equals(2), IsKPropertyCheck), Checks(INVOKE, MemberOrExtension), Checks(CONTAINS, MemberOrExtension, SingleValueParameter, NoDefaultAndVarargsCheck, ReturnsBoolean), Checks(ITERATOR, MemberOrExtension, NoValueParameters), diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/references/KtPropertyDelegationMethodsReference.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/references/KtPropertyDelegationMethodsReference.kt index a58a4874c03..9974c559bb4 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/references/KtPropertyDelegationMethodsReference.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/references/KtPropertyDelegationMethodsReference.kt @@ -40,7 +40,7 @@ class KtPropertyDelegationMethodsReference(element: KtPropertyDelegate) : KtMult return (descriptor.accessors.mapNotNull { accessor -> context.get(BindingContext.DELEGATED_PROPERTY_RESOLVED_CALL, accessor)?.candidateDescriptor - } + listOfNotNull(context.get(BindingContext.TO_DELEGATE_FOR_RESOLVED_CALL, descriptor)?.candidateDescriptor)) + } + listOfNotNull(context.get(BindingContext.PROVIDE_DELEGATE_RESOLVED_CALL, descriptor)?.candidateDescriptor)) } override val resolvesByNames: Collection get() = NAMES diff --git a/jps-plugin/testData/incremental/lookupTracker/conventions/delegateProperty.kt b/jps-plugin/testData/incremental/lookupTracker/conventions/delegateProperty.kt index b817e205da6..ca1d169645b 100644 --- a/jps-plugin/testData/incremental/lookupTracker/conventions/delegateProperty.kt +++ b/jps-plugin/testData/incremental/lookupTracker/conventions/delegateProperty.kt @@ -20,11 +20,11 @@ import kotlin.reflect./*p:kotlin.reflect*/KProperty } -/*p:foo.bar*/val x1 by /*p:foo.bar c:foo.bar.D1(toDelegateFor) c:foo.bar.D1(getToDelegateFor) c:foo.bar.D1(getTODelegateFor) p:foo.bar(toDelegateFor) p:kotlin(toDelegateFor) p:kotlin.annotation(toDelegateFor) p:kotlin.collections(toDelegateFor) p:kotlin.coroutines(toDelegateFor) p:kotlin.ranges(toDelegateFor) p:kotlin.sequences(toDelegateFor) p:kotlin.text(toDelegateFor) p:java.lang(toDelegateFor) p:kotlin.jvm(toDelegateFor) p:kotlin.io(toDelegateFor) c:foo.bar.D1(getValue)*/D1() -/*p:foo.bar*/var y1 by /*p:foo.bar c:foo.bar.D1(toDelegateFor) c:foo.bar.D1(getToDelegateFor) c:foo.bar.D1(getTODelegateFor) p:foo.bar(toDelegateFor) p:kotlin(toDelegateFor) p:kotlin.annotation(toDelegateFor) p:kotlin.collections(toDelegateFor) p:kotlin.coroutines(toDelegateFor) p:kotlin.ranges(toDelegateFor) p:kotlin.sequences(toDelegateFor) p:kotlin.text(toDelegateFor) p:java.lang(toDelegateFor) p:kotlin.jvm(toDelegateFor) p:kotlin.io(toDelegateFor) c:foo.bar.D1(getValue) c:foo.bar.D1(setValue) c:foo.bar.D1(getSetValue) c:foo.bar.D1(getSETValue) p:foo.bar(setValue)*/D1() +/*p:foo.bar*/val x1 by /*p:foo.bar c:foo.bar.D1(provideDelegate) c:foo.bar.D1(getProvideDelegate) c:foo.bar.D1(getPROVIDEDelegate) p:foo.bar(provideDelegate) p:kotlin(provideDelegate) p:kotlin.annotation(provideDelegate) p:kotlin.collections(provideDelegate) p:kotlin.coroutines(provideDelegate) p:kotlin.ranges(provideDelegate) p:kotlin.sequences(provideDelegate) p:kotlin.text(provideDelegate) p:java.lang(provideDelegate) p:kotlin.jvm(provideDelegate) p:kotlin.io(provideDelegate) c:foo.bar.D1(getValue)*/D1() +/*p:foo.bar*/var y1 by /*p:foo.bar c:foo.bar.D1(provideDelegate) c:foo.bar.D1(getProvideDelegate) c:foo.bar.D1(getPROVIDEDelegate) p:foo.bar(provideDelegate) p:kotlin(provideDelegate) p:kotlin.annotation(provideDelegate) p:kotlin.collections(provideDelegate) p:kotlin.coroutines(provideDelegate) p:kotlin.ranges(provideDelegate) p:kotlin.sequences(provideDelegate) p:kotlin.text(provideDelegate) p:java.lang(provideDelegate) p:kotlin.jvm(provideDelegate) p:kotlin.io(provideDelegate) c:foo.bar.D1(getValue) c:foo.bar.D1(setValue) c:foo.bar.D1(getSetValue) c:foo.bar.D1(getSETValue) p:foo.bar(setValue)*/D1() -/*p:foo.bar*/val x2 by /*p:foo.bar c:foo.bar.D2(toDelegateFor) c:foo.bar.D2(getToDelegateFor) c:foo.bar.D2(getTODelegateFor) p:foo.bar(toDelegateFor) p:kotlin(toDelegateFor) p:kotlin.annotation(toDelegateFor) p:kotlin.collections(toDelegateFor) p:kotlin.coroutines(toDelegateFor) p:kotlin.ranges(toDelegateFor) p:kotlin.sequences(toDelegateFor) p:kotlin.text(toDelegateFor) p:java.lang(toDelegateFor) p:kotlin.jvm(toDelegateFor) p:kotlin.io(toDelegateFor) c:foo.bar.D2(getValue) c:foo.bar.D2(getGetValue) c:foo.bar.D2(getGETValue) p:foo.bar(getValue)*/D2() -/*p:foo.bar*/var y2 by /*p:foo.bar c:foo.bar.D2(toDelegateFor) c:foo.bar.D2(getToDelegateFor) c:foo.bar.D2(getTODelegateFor) p:foo.bar(toDelegateFor) p:kotlin(toDelegateFor) p:kotlin.annotation(toDelegateFor) p:kotlin.collections(toDelegateFor) p:kotlin.coroutines(toDelegateFor) p:kotlin.ranges(toDelegateFor) p:kotlin.sequences(toDelegateFor) p:kotlin.text(toDelegateFor) p:java.lang(toDelegateFor) p:kotlin.jvm(toDelegateFor) p:kotlin.io(toDelegateFor) c:foo.bar.D2(getValue) c:foo.bar.D2(getGetValue) c:foo.bar.D2(getGETValue) p:foo.bar(getValue) c:foo.bar.D2(setValue)*/D2() +/*p:foo.bar*/val x2 by /*p:foo.bar c:foo.bar.D2(provideDelegate) c:foo.bar.D2(getProvideDelegate) c:foo.bar.D2(getPROVIDEDelegate) p:foo.bar(provideDelegate) p:kotlin(provideDelegate) p:kotlin.annotation(provideDelegate) p:kotlin.collections(provideDelegate) p:kotlin.coroutines(provideDelegate) p:kotlin.ranges(provideDelegate) p:kotlin.sequences(provideDelegate) p:kotlin.text(provideDelegate) p:java.lang(provideDelegate) p:kotlin.jvm(provideDelegate) p:kotlin.io(provideDelegate) c:foo.bar.D2(getValue) c:foo.bar.D2(getGetValue) c:foo.bar.D2(getGETValue) p:foo.bar(getValue)*/D2() +/*p:foo.bar*/var y2 by /*p:foo.bar c:foo.bar.D2(provideDelegate) c:foo.bar.D2(getProvideDelegate) c:foo.bar.D2(getPROVIDEDelegate) p:foo.bar(provideDelegate) p:kotlin(provideDelegate) p:kotlin.annotation(provideDelegate) p:kotlin.collections(provideDelegate) p:kotlin.coroutines(provideDelegate) p:kotlin.ranges(provideDelegate) p:kotlin.sequences(provideDelegate) p:kotlin.text(provideDelegate) p:java.lang(provideDelegate) p:kotlin.jvm(provideDelegate) p:kotlin.io(provideDelegate) c:foo.bar.D2(getValue) c:foo.bar.D2(getGetValue) c:foo.bar.D2(getGETValue) p:foo.bar(getValue) c:foo.bar.D2(setValue)*/D2() -/*p:foo.bar*/val x3 by /*p:foo.bar c:foo.bar.D3(toDelegateFor) c:foo.bar.D2(toDelegateFor) c:foo.bar.D3(getToDelegateFor) c:foo.bar.D3(getTODelegateFor) p:foo.bar(toDelegateFor) p:kotlin(toDelegateFor) p:kotlin.annotation(toDelegateFor) p:kotlin.collections(toDelegateFor) p:kotlin.coroutines(toDelegateFor) p:kotlin.ranges(toDelegateFor) p:kotlin.sequences(toDelegateFor) p:kotlin.text(toDelegateFor) p:java.lang(toDelegateFor) p:kotlin.jvm(toDelegateFor) p:kotlin.io(toDelegateFor) c:foo.bar.D3(getValue) c:foo.bar.D2(getValue) c:foo.bar.D3(getGetValue) c:foo.bar.D3(getGETValue) p:foo.bar(getValue)*/D3() -/*p:foo.bar*/var y3 by /*p:foo.bar c:foo.bar.D3(toDelegateFor) c:foo.bar.D2(toDelegateFor) c:foo.bar.D3(getToDelegateFor) c:foo.bar.D3(getTODelegateFor) p:foo.bar(toDelegateFor) p:kotlin(toDelegateFor) p:kotlin.annotation(toDelegateFor) p:kotlin.collections(toDelegateFor) p:kotlin.coroutines(toDelegateFor) p:kotlin.ranges(toDelegateFor) p:kotlin.sequences(toDelegateFor) p:kotlin.text(toDelegateFor) p:java.lang(toDelegateFor) p:kotlin.jvm(toDelegateFor) p:kotlin.io(toDelegateFor) c:foo.bar.D3(getValue) c:foo.bar.D2(getValue) c:foo.bar.D3(getGetValue) c:foo.bar.D3(getGETValue) p:foo.bar(getValue) c:foo.bar.D3(setValue) c:foo.bar.D2(setValue)*/D3() +/*p:foo.bar*/val x3 by /*p:foo.bar c:foo.bar.D3(provideDelegate) c:foo.bar.D2(provideDelegate) c:foo.bar.D3(getProvideDelegate) c:foo.bar.D3(getPROVIDEDelegate) p:foo.bar(provideDelegate) p:kotlin(provideDelegate) p:kotlin.annotation(provideDelegate) p:kotlin.collections(provideDelegate) p:kotlin.coroutines(provideDelegate) p:kotlin.ranges(provideDelegate) p:kotlin.sequences(provideDelegate) p:kotlin.text(provideDelegate) p:java.lang(provideDelegate) p:kotlin.jvm(provideDelegate) p:kotlin.io(provideDelegate) c:foo.bar.D3(getValue) c:foo.bar.D2(getValue) c:foo.bar.D3(getGetValue) c:foo.bar.D3(getGETValue) p:foo.bar(getValue)*/D3() +/*p:foo.bar*/var y3 by /*p:foo.bar c:foo.bar.D3(provideDelegate) c:foo.bar.D2(provideDelegate) c:foo.bar.D3(getProvideDelegate) c:foo.bar.D3(getPROVIDEDelegate) p:foo.bar(provideDelegate) p:kotlin(provideDelegate) p:kotlin.annotation(provideDelegate) p:kotlin.collections(provideDelegate) p:kotlin.coroutines(provideDelegate) p:kotlin.ranges(provideDelegate) p:kotlin.sequences(provideDelegate) p:kotlin.text(provideDelegate) p:java.lang(provideDelegate) p:kotlin.jvm(provideDelegate) p:kotlin.io(provideDelegate) c:foo.bar.D3(getValue) c:foo.bar.D2(getValue) c:foo.bar.D3(getGetValue) c:foo.bar.D3(getGETValue) p:foo.bar(getValue) c:foo.bar.D3(setValue) c:foo.bar.D2(setValue)*/D3() 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 1226443cf0e..ff09e08b69c 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 @@ -6888,59 +6888,59 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { } } - @TestMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor") + @TestMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class ToDelegateFor extends AbstractJsCodegenBoxTest { - public void testAllFilesPresentInToDelegateFor() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/delegatedProperty/toDelegateFor"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); + public static class ProvideDelegate extends AbstractJsCodegenBoxTest { + public void testAllFilesPresentInProvideDelegate() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/delegatedProperty/provideDelegate"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); } @TestMetadata("differentReceivers.kt") public void testDifferentReceivers() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/differentReceivers.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/differentReceivers.kt"); doTest(fileName); } @TestMetadata("evaluationOrder.kt") public void testEvaluationOrder() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/evaluationOrder.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/evaluationOrder.kt"); doTest(fileName); } @TestMetadata("evaluationOrderVar.kt") public void testEvaluationOrderVar() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/evaluationOrderVar.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/evaluationOrderVar.kt"); doTest(fileName); } @TestMetadata("extensionDelegated.kt") public void testExtensionDelegated() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/extensionDelegated.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/extensionDelegated.kt"); doTest(fileName); } @TestMetadata("generic.kt") public void testGeneric() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/generic.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/generic.kt"); doTest(fileName); } @TestMetadata("inClass.kt") public void testInClass() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/inClass.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inClass.kt"); doTest(fileName); } - @TestMetadata("inlineToDelegateFor.kt") - public void testInlineToDelegateFor() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/inlineToDelegateFor.kt"); + @TestMetadata("inlineProvideDelegate.kt") + public void testInlineProvideDelegate() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/inlineProvideDelegate.kt"); doTest(fileName); } @TestMetadata("jvmStaticInObject.kt") public void testJvmStaticInObject() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/jvmStaticInObject.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/jvmStaticInObject.kt"); try { doTest(fileName); } @@ -6952,31 +6952,31 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { @TestMetadata("local.kt") public void testLocal() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/local.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/local.kt"); doTest(fileName); } @TestMetadata("localCaptured.kt") public void testLocalCaptured() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/localCaptured.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/localCaptured.kt"); doTest(fileName); } @TestMetadata("localDifferentReceivers.kt") public void testLocalDifferentReceivers() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/localDifferentReceivers.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/localDifferentReceivers.kt"); doTest(fileName); } @TestMetadata("memberExtension.kt") public void testMemberExtension() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/memberExtension.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/memberExtension.kt"); doTest(fileName); } @TestMetadata("propertyMetadata.kt") public void testPropertyMetadata() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/toDelegateFor/propertyMetadata.kt"); + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegatedProperty/provideDelegate/propertyMetadata.kt"); doTest(fileName); } } diff --git a/js/js.translator/src/org/jetbrains/kotlin/js/translate/declaration/PropertyTranslator.kt b/js/js.translator/src/org/jetbrains/kotlin/js/translate/declaration/PropertyTranslator.kt index f9ea10b5164..cfe253f76c7 100644 --- a/js/js.translator/src/org/jetbrains/kotlin/js/translate/declaration/PropertyTranslator.kt +++ b/js/js.translator/src/org/jetbrains/kotlin/js/translate/declaration/PropertyTranslator.kt @@ -141,10 +141,10 @@ fun TranslationContext.translateDelegateOrInitializerExpression(expression: KtPr val expressionPsi = expression.delegateExpressionOrInitializer ?: return null val initializer = Translation.translateAsExpression(expressionPsi, this) - val toDelegateForCall = bindingContext()[BindingContext.TO_DELEGATE_FOR_RESOLVED_CALL, propertyDescriptor] - return if (toDelegateForCall != null) { - val innerContext = this.contextWithPropertyMetadataCreationIntrinsified(toDelegateForCall, propertyDescriptor, JsLiteral.THIS) - CallTranslator.translate(innerContext, toDelegateForCall, initializer) + val provideDelegateCall = bindingContext()[BindingContext.PROVIDE_DELEGATE_RESOLVED_CALL, propertyDescriptor] + return if (provideDelegateCall != null) { + val innerContext = this.contextWithPropertyMetadataCreationIntrinsified(provideDelegateCall, propertyDescriptor, JsLiteral.THIS) + CallTranslator.translate(innerContext, provideDelegateCall, initializer) } else { initializer