Rename toDelegateFor to provideDelegate.

This commit is contained in:
Stanislav Erokhin
2016-12-12 14:56:16 +03:00
parent db5250a614
commit 9dc9fb578f
71 changed files with 278 additions and 276 deletions
@@ -4085,9 +4085,9 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
StackValue metadataValue = getVariableMetadataValue(variableDescriptor);
initializePropertyMetadata((KtProperty) variableDeclaration, variableDescriptor, metadataValue);
ResolvedCall<FunctionDescriptor> toDelegateForResolvedCall = bindingContext.get(TO_DELEGATE_FOR_RESOLVED_CALL, variableDescriptor);
if (toDelegateForResolvedCall != null) {
resultType = generateToDelegateForCallForLocalVariable(initializer, metadataValue, toDelegateForResolvedCall);
ResolvedCall<FunctionDescriptor> 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<StackValue, StackValue> impleme
}
@NotNull
private Type generateToDelegateForCallForLocalVariable(
private Type generateProvideDelegateCallForLocalVariable(
@NotNull StackValue initializer,
final StackValue metadataValue,
ResolvedCall<FunctionDescriptor> toDelegateForResolvedCall
ResolvedCall<FunctionDescriptor> provideDelegateResolvedCall
) {
StackValue toDelegateForReceiver = StackValue.onStack(initializer.type);
StackValue provideDelegateReceiver = StackValue.onStack(initializer.type);
List<? extends ValueArgument> arguments = toDelegateForResolvedCall.getCall().getValueArguments();
List<? extends ValueArgument> 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<StackValue, StackValue> 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());
@@ -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<T extends KtPureElement/* TODO: & KtDeclarat
StackValue.Property propValue = codegen.intermediateValueForProperty(
propertyDescriptor, true, false, null, true, StackValue.LOCAL_0, null);
ResolvedCall<FunctionDescriptor> toDelegateForResolvedCall = bindingContext.get(TO_DELEGATE_FOR_RESOLVED_CALL, propertyDescriptor);
if (toDelegateForResolvedCall == null) {
ResolvedCall<FunctionDescriptor> 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<? extends ValueArgument> arguments = toDelegateForResolvedCall.getCall().getValueArguments();
List<? extends ValueArgument> 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);
@@ -375,12 +375,12 @@ public class PropertyCodegen {
private KotlinType getDelegateTypeForProperty(@NotNull KtProperty p, @NotNull PropertyDescriptor propertyDescriptor) {
KotlinType delegateType = null;
ResolvedCall<FunctionDescriptor> toDelegateForResolvedCall =
bindingContext.get(BindingContext.TO_DELEGATE_FOR_RESOLVED_CALL, propertyDescriptor);
ResolvedCall<FunctionDescriptor> 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);
@@ -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);
}
@@ -141,8 +141,8 @@ public interface BindingContext {
WritableSlice<VariableAccessorDescriptor, ResolvedCall<FunctionDescriptor>> DELEGATED_PROPERTY_RESOLVED_CALL = Slices.createSimpleSlice();
WritableSlice<VariableAccessorDescriptor, Call> DELEGATED_PROPERTY_CALL = Slices.createSimpleSlice();
WritableSlice<VariableDescriptorWithAccessors, ResolvedCall<FunctionDescriptor>> TO_DELEGATE_FOR_RESOLVED_CALL = Slices.createSimpleSlice();
WritableSlice<VariableDescriptorWithAccessors, Call> TO_DELEGATE_FOR_CALL = Slices.createSimpleSlice();
WritableSlice<VariableDescriptorWithAccessors, ResolvedCall<FunctionDescriptor>> PROVIDE_DELEGATE_RESOLVED_CALL = Slices.createSimpleSlice();
WritableSlice<VariableDescriptorWithAccessors, Call> PROVIDE_DELEGATE_CALL = Slices.createSimpleSlice();
WritableSlice<KtDestructuringDeclarationEntry, ResolvedCall<FunctionDescriptor>> COMPONENT_RESOLVED_CALL = Slices.createSimpleSlice();
@@ -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}")
}
}
}
@@ -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
@@ -11,7 +11,7 @@ inline fun <T> 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 =
@@ -9,7 +9,7 @@ inline fun <T> 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 =
@@ -11,7 +11,7 @@ inline fun <T> 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 }
}
@@ -15,7 +15,7 @@ inline fun <T> runLogged(entry: String, action: () -> T): T {
return action()
}
operator fun <T: MyClass> T.toDelegateFor(host: Any?, p: Any): T =
operator fun <T: MyClass> T.provideDelegate(host: Any?, p: Any): T =
runLogged("tdf(${this.value});") { this }
operator fun <T> T.getValue(receiver: Any?, p: Any): T =
@@ -9,7 +9,7 @@ inline fun <T> 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 =
@@ -9,7 +9,7 @@ inline fun <T> 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 =
@@ -10,7 +10,7 @@ inline fun <T> 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 =
@@ -9,7 +9,7 @@ inline fun <T> 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 =
@@ -9,7 +9,7 @@ fun <T> 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 =
@@ -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 =
@@ -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"
@@ -10,7 +10,7 @@ inline fun <T> 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 =
@@ -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
}
@@ -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
}
@@ -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
}
}
@@ -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
}
@@ -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
}
@@ -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
}
}
@@ -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
}
@@ -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
}
}
@@ -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
}
@@ -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 <init>(@org.jetbrains.annotations.NotNull p0: java.lang.String): void
public final @org.jetbrains.annotations.NotNull method getValue(): java.lang.String
}
}
@@ -7,7 +7,7 @@ public final class Host {
private method <init>(): 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
}
@@ -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
}
}
@@ -5,7 +5,7 @@ object CommonCase {
fun <D, E, R> delegate() : Fas<D, E, R> = TODO()
operator fun <D, E, R> Fas<D, E, R>.toDelegateFor(host: D, p: Any?): Fas<D, E, R> = TODO()
operator fun <D, E, R> Fas<D, E, R>.provideDelegate(host: D, p: Any?): Fas<D, E, R> = TODO()
operator fun <D, E, R> Fas<D, E, R>.getValue(receiver: E, p: Any?): R = TODO()
val Long.test1: String by <!TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>delegate<!>() // common test, not working because of Inference1
@@ -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 </*0*/ D, /*1*/ E, /*2*/ R> CommonCase.Fas<D, E, R>.getValue(/*0*/ receiver: E, /*1*/ p: kotlin.Any?): R
public final operator fun </*0*/ D, /*1*/ E, /*2*/ R> CommonCase.Fas<D, E, R>.toDelegateFor(/*0*/ host: D, /*1*/ p: kotlin.Any?): CommonCase.Fas<D, E, R>
public final operator fun </*0*/ D, /*1*/ E, /*2*/ R> CommonCase.Fas<D, E, R>.provideDelegate(/*0*/ host: D, /*1*/ p: kotlin.Any?): CommonCase.Fas<D, E, R>
public interface Fas</*0*/ D, /*1*/ E, /*2*/ R> {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
@@ -4,7 +4,7 @@ class Cell<out V>(val value: V)
class GenericDelegate<V>(val value: V)
operator fun <T> T.toDelegateFor(a: Any?, p: Any?) = GenericDelegate(this)
operator fun <T> T.provideDelegate(a: Any?, p: Any?) = GenericDelegate(this)
operator fun <W> GenericDelegate<W>.getValue(a: Any?, p: Any?) = Cell(value)
@@ -4,7 +4,7 @@ public val test1: Cell<kotlin.String>
public val test2: Cell<kotlin.Any>
public val test3: Cell<kotlin.String>
public operator fun </*0*/ W> GenericDelegate<W>.getValue(/*0*/ a: kotlin.Any?, /*1*/ p: kotlin.Any?): Cell<W>
public operator fun </*0*/ T> T.toDelegateFor(/*0*/ a: kotlin.Any?, /*1*/ p: kotlin.Any?): GenericDelegate<T>
public operator fun </*0*/ T> T.provideDelegate(/*0*/ a: kotlin.Any?, /*1*/ p: kotlin.Any?): GenericDelegate<T>
public final class Cell</*0*/ out V> {
public constructor Cell</*0*/ out V>(/*0*/ value: V)
@@ -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
@@ -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
}
@@ -5,7 +5,7 @@ object T2 {
fun <T> delegate(): Foo<T> = TODO()
operator fun <T> Foo<T>.toDelegateFor(host: T2, p: Any?): Foo<T> = TODO()
operator fun <T> Foo<T>.provideDelegate(host: T2, p: Any?): Foo<T> = TODO()
operator fun <T> Foo<T>.getValue(receiver: String, p: Any?): T = TODO()
val String.test1: String by delegate()
@@ -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 </*0*/ T> T2.Foo<T>.getValue(/*0*/ receiver: kotlin.String, /*1*/ p: kotlin.Any?): T
public final operator fun </*0*/ T> T2.Foo<T>.toDelegateFor(/*0*/ host: T2, /*1*/ p: kotlin.Any?): T2.Foo<T>
public final operator fun </*0*/ T> T2.Foo<T>.provideDelegate(/*0*/ host: T2, /*1*/ p: kotlin.Any?): T2.Foo<T>
public interface Foo</*0*/ T> {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
@@ -5,7 +5,7 @@ object T3 {
fun <T> delegate(): Foo<T> = TODO()
operator fun <T> Foo<T>.toDelegateFor(host: T3, p: Any?): Foo<T> = TODO()
operator fun <T> Foo<T>.provideDelegate(host: T3, p: Any?): Foo<T> = TODO()
operator fun <T> Foo<T>.getValue(receiver: T3, p: Any?): T = TODO()
val test1: String by delegate()
@@ -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 </*0*/ T> T3.Foo<T>.getValue(/*0*/ receiver: T3, /*1*/ p: kotlin.Any?): T
public final operator fun </*0*/ T> T3.Foo<T>.toDelegateFor(/*0*/ host: T3, /*1*/ p: kotlin.Any?): T3.Foo<T>
public final operator fun </*0*/ T> T3.Foo<T>.provideDelegate(/*0*/ host: T3, /*1*/ p: kotlin.Any?): T3.Foo<T>
public interface Foo</*0*/ T> {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
@@ -5,7 +5,7 @@ object Inference2 {
fun <T> delegate(): Foo<T> = TODO()
operator fun <T> Foo<T>.toDelegateFor(host: T, p: Any?): Foo<T> = TODO()
operator fun <T> Foo<T>.provideDelegate(host: T, p: Any?): Foo<T> = TODO()
operator fun <T> Foo<T>.getValue(receiver: Inference2, p: Any?): String = TODO()
val test1: String by <!TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>delegate<!>() // same story like in Inference1
@@ -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 </*0*/ T> Inference2.Foo<T>.getValue(/*0*/ receiver: Inference2, /*1*/ p: kotlin.Any?): kotlin.String
public final operator fun </*0*/ T> Inference2.Foo<T>.toDelegateFor(/*0*/ host: T, /*1*/ p: kotlin.Any?): Inference2.Foo<T>
public final operator fun </*0*/ T> Inference2.Foo<T>.provideDelegate(/*0*/ host: T, /*1*/ p: kotlin.Any?): Inference2.Foo<T>
public interface Foo</*0*/ T> {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
@@ -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 {
@@ -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
@@ -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
@@ -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)
@@ -0,0 +1,32 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
import kotlin.reflect.KProperty
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun provideDelegate(x: Any?, p: KProperty<*>) {}
operator fun Any.provideDelegate(x: Any?, p: KProperty<*>) {}
operator fun Any.provideDelegate(x: Any?, p: Any) {}
<!INAPPLICABLE_OPERATOR_MODIFIER!>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 {
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun provideDelegate(x: Any?, p: KProperty<*>, foo: Int) {}
}
class Host4 {
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun provideDelegate(x: Any?, p: KProperty<*>, foo: Int = 0) {}
}
class Host5 {
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun provideDelegate(x: Any?, p: KProperty<*>, vararg foo: Int) {}
}
@@ -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
}
@@ -5,12 +5,12 @@ class Delegate<T>
operator fun Delegate<*>.getValue(receiver: Any?, p: Any): String = ""
operator fun <T> Delegate<T>.setValue(receiver: Any?, p: Any, value: T) {}
operator fun <T> String.toDelegateFor(receiver: Any?, p: Any) = Delegate<T>()
operator fun <T> String.provideDelegate(receiver: Any?, p: Any) = Delegate<T>()
var test1: String by <!TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>Delegate<!>()
var test2: String by Delegate<String>()
var test3: String by <!DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE, DELEGATE_SPECIAL_FUNCTION_MISSING, DELEGATE_SPECIAL_FUNCTION_MISSING!>"OK"<!>
var test4: String by "OK".<!TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>toDelegateFor<!>(null, "")
var test5: String by "OK".toDelegateFor<String>(null, "")
var test4: String by "OK".<!TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>provideDelegate<!>(null, "")
var test5: String by "OK".provideDelegate<String>(null, "")
@@ -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 </*0*/ T> kotlin.String.provideDelegate(/*0*/ receiver: kotlin.Any?, /*1*/ p: kotlin.Any): Delegate<T>
public operator fun </*0*/ T> Delegate<T>.setValue(/*0*/ receiver: kotlin.Any?, /*1*/ p: kotlin.Any, /*2*/ value: T): kotlin.Unit
public operator fun </*0*/ T> kotlin.String.toDelegateFor(/*0*/ receiver: kotlin.Any?, /*1*/ p: kotlin.Any): Delegate<T>
public final class Delegate</*0*/ T> {
public constructor Delegate</*0*/ T>()
@@ -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"
@@ -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
@@ -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
}
<!UNSUPPORTED_FEATURE!>operator<!> fun String.toDelegateFor(thisRef: Any?, prop: Any) = WrongDelegate(this.length)
<!UNSUPPORTED_FEATURE!>operator<!> fun String.provideDelegate(thisRef: Any?, prop: Any) = WrongDelegate(this.length)
operator fun String.getValue(thisRef: Any?, prop: Any) = this
@@ -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)
@@ -1,32 +0,0 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
import kotlin.reflect.KProperty
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun toDelegateFor(x: Any?, p: KProperty<*>) {}
operator fun Any.toDelegateFor(x: Any?, p: KProperty<*>) {}
operator fun Any.toDelegateFor(x: Any?, p: Any) {}
<!INAPPLICABLE_OPERATOR_MODIFIER!>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 {
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun toDelegateFor(x: Any?, p: KProperty<*>, foo: Int) {}
}
class Host4 {
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun toDelegateFor(x: Any?, p: KProperty<*>, foo: Int = 0) {}
}
class Host5 {
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun toDelegateFor(x: Any?, p: KProperty<*>, vararg foo: Int) {}
}
@@ -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);
}
}
@@ -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);
}
}
@@ -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);
}
}
@@ -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);
}
}
@@ -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),
@@ -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")
@@ -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),
@@ -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<Name> get() = NAMES
@@ -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()
@@ -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);
}
}
@@ -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