From 1f2b4e20fe9c628427fba15e57d556b95c528ba9 Mon Sep 17 00:00:00 2001 From: Yan Zhulanow Date: Mon, 5 Oct 2015 20:18:58 +0300 Subject: [PATCH] Replace get() and set() to getValue() and setValue() (property delegates) --- .../checkers/ReflectionAPICallChecker.kt | 1 - .../cfg/JetFlowInformationProvider.java | 3 +- .../jetbrains/kotlin/diagnostics/Errors.java | 1 + .../rendering/DefaultErrorMessages.java | 1 + .../org/jetbrains/kotlin/psi/userDataUtil.kt | 27 ++++++--- .../resolve/DelegatedPropertyResolver.java | 31 ++++++++-- .../properties/DelegatedProperty.instructions | 8 +-- .../properties/DelegatedProperty.kt | 2 +- .../properties/DelegatedProperty.values | 6 +- ...accessTopLevelDelegatedPropertyInClinit.kt | 2 +- .../capturePropertyInClosure.kt | 4 +- .../delegatedProperty/castGetReturnType.kt | 2 +- .../box/delegatedProperty/castSetParameter.kt | 4 +- .../box/delegatedProperty/defaultArgs.kt | 2 +- .../delegatedProperty/delegateAsInnerClass.kt | 4 +- .../delegateByOtherProperty.kt | 4 +- .../delegateByTopLevelFun.kt | 4 +- .../delegateByTopLevelProperty.kt | 4 +- .../delegateForExtProperty.kt | 2 +- .../delegateForExtPropertyInClass.kt | 2 +- .../box/delegatedProperty/genericDelegate.kt | 4 +- .../delegatedProperty/getAsExtensionFun.kt | 2 +- .../getAsExtensionFunInClass.kt | 2 +- .../box/delegatedProperty/inClassVal.kt | 2 +- .../box/delegatedProperty/inClassVar.kt | 4 +- .../codegen/box/delegatedProperty/inTrait.kt | 2 +- .../delegatedProperty/inferredPropertyType.kt | 4 +- .../codegen/box/delegatedProperty/kt4138.kt | 4 +- .../box/delegatedProperty/privateVar.kt | 4 +- .../propertyDelegatedMethod/defaultArgs.kt | 2 +- .../delegateAsInnerClass.kt | 2 +- .../delegateByOtherProperty.kt | 2 +- .../delegateByTopLevelFun.kt | 2 +- .../delegateByTopLevelProperty.kt | 2 +- .../delegateForExtProperty.kt | 2 +- .../delegateForExtPropertyInClass.kt | 2 +- .../propertyDelegatedMethod/inTrait.kt | 2 +- .../propertyDelegatedMethod/noneApplicable.kt | 2 +- .../pdAsExtensionFun.kt | 2 +- .../privateProperty.kt | 2 +- .../propertyDelegatedMethod/topLevel.kt | 2 +- .../twoPropsByOneDelegate.kt | 2 +- .../valInInnerClass.kt | 2 +- .../propertyDelegatedMethod/vararg.kt | 2 +- .../propertyMetadataEqualsHashCodeToString.kt | 2 +- .../propertyMetadataShouldBeCached.kt | 12 ++-- .../delegatedProperty/setAsExtensionFun.kt | 4 +- .../setAsExtensionFunInClass.kt | 4 +- .../box/delegatedProperty/topLevelVal.kt | 2 +- .../box/delegatedProperty/topLevelVar.kt | 4 +- .../delegatedProperty/twoPropByOneDelegete.kt | 2 +- .../box/delegatedProperty/valInInnerClass.kt | 2 +- .../box/delegatedProperty/varInInnerClass.kt | 4 +- .../codegen/box/delegatedProperty/vararg.kt | 2 +- .../codegen/box/fieldRename/delegates.kt | 4 +- .../testData/codegen/box/properties/kt4383.kt | 2 +- .../primitiveOverrideDelegateAccessor.kt | 4 +- .../codegen/box/typeMapping/kt3863.kt | 4 +- .../codegen/box/typeMapping/kt3976.kt | 4 +- .../annotations/delegatedPropertySetter.kt | 4 +- .../callableReference/property/delegated.kt | 2 +- .../property/delegatedMutable.kt | 4 +- .../property/genericProperty.kt | 2 +- .../boxWithStdlib/reified/DIExample.kt | 2 +- .../privateClassPropertyAccessors.kt | 4 +- ...recatedGetSetPropertyDelegateConvention.kt | 51 ++++++++++++++++ ...ecatedGetSetPropertyDelegateConvention.txt | 59 +++++++++++++++++++ .../testData/diagnostics/tests/LateInit.kt | 2 +- .../testData/diagnostics/tests/LateInit.txt | 2 +- .../diagnostics/tests/UnusedParameters.kt | 8 +-- .../diagnostics/tests/UnusedParameters.txt | 4 +- .../testData/diagnostics/tests/Variance.kt | 6 +- .../withUseSiteTarget/FieldAnnotations.kt | 2 +- .../withUseSiteTarget/FieldAnnotations.txt | 2 +- .../withUseSiteTarget/GetterAnnotations.kt | 2 +- .../withUseSiteTarget/GetterAnnotations.txt | 2 +- .../withUseSiteTarget/PropertyAnnotations.kt | 2 +- .../withUseSiteTarget/PropertyAnnotations.txt | 2 +- .../withUseSiteTarget/SetterAnnotations.kt | 4 +- .../withUseSiteTarget/SetterAnnotations.txt | 4 +- .../withUseSiteTarget/SparamAnnotations.kt | 4 +- .../withUseSiteTarget/SparamAnnotations.txt | 4 +- .../local/LocalClassDelegatedProperties.kt | 2 +- .../local/LocalClassDelegatedProperties.txt | 2 +- .../absentErrorAboutInitializer.kt | 2 +- .../absentErrorAboutInitializer.txt | 2 +- .../delegatedProperty/absentErrorAboutType.kt | 2 +- .../absentErrorAboutType.txt | 2 +- .../abstractDelegatedProperty.kt | 2 +- .../abstractDelegatedProperty.txt | 2 +- .../tests/delegatedProperty/backingField.kt | 2 +- .../tests/delegatedProperty/backingField.txt | 2 +- .../tests/delegatedProperty/defaultGetter.kt | 2 +- .../tests/delegatedProperty/defaultGetter.txt | 2 +- .../tests/delegatedProperty/defaultSetter.kt | 4 +- .../tests/delegatedProperty/defaultSetter.txt | 4 +- .../delegatedPropertyOverridedInTrait.kt | 2 +- .../delegatedPropertyOverridedInTrait.txt | 2 +- ...tedPropertyOverridedInTraitTypeMismatch.kt | 2 +- ...edPropertyOverridedInTraitTypeMismatch.txt | 2 +- .../disallowImplInTypeParameter.kt | 2 +- .../disallowImplInTypeParameter.txt | 2 +- .../tests/delegatedProperty/genericGetter.kt | 2 +- .../tests/delegatedProperty/genericGetter.txt | 2 +- .../delegatedProperty/getterWithSubtype.kt | 2 +- .../delegatedProperty/getterWithSubtype.txt | 2 +- .../tests/delegatedProperty/inTrait.kt | 2 +- .../tests/delegatedProperty/inTrait.txt | 2 +- .../differentDelegatedExpressions.kt | 4 +- .../differentDelegatedExpressions.txt | 4 +- .../inference/extensionGet.kt | 6 +- .../inference/extensionGet.txt | 6 +- .../inference/extensionProperty.kt | 2 +- .../inference/extensionProperty.txt | 2 +- .../inference/genericMethodInGenericClass.kt | 12 ++-- .../inference/genericMethodInGenericClass.txt | 12 ++-- .../inference/genericMethods.kt | 12 ++-- .../inference/genericMethods.txt | 12 ++-- .../inference/labeledDelegatedExpression.kt | 2 +- .../inference/labeledDelegatedExpression.txt | 2 +- .../noErrorsForImplicitConstraints.kt | 8 +-- .../noErrorsForImplicitConstraints.txt | 8 +-- .../noExpectedTypeForSupertypeConstraint.kt | 4 +- .../noExpectedTypeForSupertypeConstraint.txt | 4 +- .../useCompleterWithoutExpectedType.kt | 2 +- .../useCompleterWithoutExpectedType.txt | 2 +- .../inference/useExpectedType.kt | 12 ++-- .../inference/useExpectedType.txt | 12 ++-- .../inference/useExpectedTypeForVal.kt | 6 +- .../inference/useExpectedTypeForVal.txt | 6 +- .../tests/delegatedProperty/kt4640.kt | 6 +- .../tests/delegatedProperty/kt4640.txt | 6 +- .../tests/delegatedProperty/localVariable.kt | 2 +- .../tests/delegatedProperty/localVariable.txt | 2 +- .../tests/delegatedProperty/missedGetter.kt | 2 +- .../tests/delegatedProperty/missedSetter.kt | 4 +- .../tests/delegatedProperty/missedSetter.txt | 2 +- .../delegatedProperty/propertyDefferedType.kt | 2 +- .../propertyDefferedType.txt | 2 +- .../propertyDelegatedAmbiguity.kt | 2 +- .../propertyDelegatedAmbiguity.txt | 2 +- .../propertyDelegatedIncomplete.kt | 2 +- .../propertyDelegatedIncomplete.txt | 2 +- .../propertyDelegatedMissing.kt | 2 +- .../propertyDelegatedMissing.txt | 2 +- .../propertyDelegatedPrivate.kt | 2 +- .../propertyDelegatedPrivate.txt | 2 +- .../propertyDelegatedWrongArguments.kt | 2 +- .../propertyDelegatedWrongArguments.txt | 2 +- .../tests/delegatedProperty/recursiveType.kt | 2 +- .../tests/delegatedProperty/recursiveType.txt | 2 +- .../delegatedProperty/redundantGetter.kt | 2 +- .../delegatedProperty/redundantGetter.txt | 2 +- .../delegatedProperty/redundantSetter.kt | 4 +- .../delegatedProperty/redundantSetter.txt | 4 +- .../setterThisTypeMismatch.kt | 4 +- .../setterThisTypeMismatch.txt | 4 +- .../delegatedProperty/setterWithSupertype.kt | 4 +- .../delegatedProperty/setterWithSupertype.txt | 4 +- .../tests/delegatedProperty/thisInDelegate.kt | 2 +- .../delegatedProperty/thisInDelegate.txt | 2 +- .../tests/delegatedProperty/thisOfAnyType.kt | 4 +- .../tests/delegatedProperty/thisOfAnyType.txt | 4 +- .../thisOfNothingNullableType.kt | 4 +- .../thisOfNothingNullableType.txt | 4 +- .../delegatedProperty/thisOfNothingType.kt | 4 +- .../delegatedProperty/thisOfNothingType.txt | 4 +- .../tests/delegatedProperty/twoGetMethods.kt | 4 +- .../tests/delegatedProperty/twoGetMethods.txt | 4 +- .../typeMismatchForGetReturnType.kt | 2 +- .../typeMismatchForGetReturnType.txt | 2 +- .../typeMismatchForGetWithGeneric.kt | 2 +- .../typeMismatchForGetWithGeneric.txt | 2 +- .../typeMismatchForSetParameter.kt | 4 +- .../typeMismatchForSetParameter.txt | 4 +- .../typeMismatchForThisGetParameter.kt | 2 +- .../typeMismatchForThisGetParameter.txt | 2 +- .../wrongCountOfParametersInGet.kt | 2 +- .../wrongCountOfParametersInGet.txt | 2 +- .../wrongCountOfParametersInSet.kt | 4 +- .../wrongCountOfParametersInSet.txt | 4 +- .../wrongSetterReturnType.kt | 4 +- .../wrongSetterReturnType.txt | 4 +- .../tests/deprecated/functionUsage.kt | 4 +- .../tests/deprecated/functionUsage.txt | 4 +- .../tests/deprecated/propertyUsage.kt | 4 +- .../tests/deprecated/propertyUsage.txt | 4 +- .../specialNames/propertyMetadataCache.kt | 2 +- .../specialNames/propertyMetadataCache.txt | 2 +- .../tests/inference/regressions/kt3496.kt | 2 +- .../tests/inference/regressions/kt3496_2.kt | 2 +- .../substitutions/delegationAndInference.kt | 4 +- .../substitutions/delegationAndInference.txt | 4 +- .../tests/modifiers/const/applicability.kt | 4 +- .../tests/modifiers/const/applicability.txt | 4 +- .../delegatedProperties.kt | 4 +- .../delegatedProperties.txt | 4 +- .../diagnostics/tests/regressions/Jet169.kt | 4 +- .../diagnostics/tests/regressions/kt235.kt | 26 ++++---- .../diagnostics/tests/regressions/kt258.kt | 2 +- .../diagnostics/tests/regressions/kt459.kt | 2 +- .../diagnostics/tests/smartCasts/kt2865.kt | 2 +- .../tests/smartCasts/publicVals/delegate.kt | 2 +- .../tests/smartCasts/publicVals/delegate.txt | 2 +- .../diagnostics/tests/variance/ValProperty.kt | 4 +- .../tests/variance/ValProperty.txt | 4 +- .../diagnostics/tests/variance/VarProperty.kt | 4 +- .../tests/variance/VarProperty.txt | 4 +- .../dynamicTypes/conventions.dynamic.txt | 6 +- .../testsWithStdLib/kt7585/delegate.kt | 2 +- .../classMembers/DelegatedProperty.kt | 2 +- .../packageMembers/DelegatedProperty.kt | 2 +- .../compiledKotlin/prop/VarWithDelegated.kt | 4 +- .../compiledKotlin/prop/VarWithDelegated.txt | 4 +- .../visibility/privateSet.kt | 4 +- .../class/delegatedProtectedVar.kt | 4 +- .../classObject/class/delegatedPublicVal.kt | 2 +- .../rename/delegatedAndDelegated.kt | 4 +- .../rename/delegatedAndProperty.kt | 4 +- .../trait/delegatedProtectedVar.kt | 4 +- .../classObject/trait/delegatedPublicVal.kt | 2 +- .../checkers/JetDiagnosticsTestGenerated.java | 6 ++ .../descriptors/LazyJavaPackageFragment.kt | 1 + .../kotlin/builtins/ReflectionTypes.kt | 3 +- .../impl/LazyPackageViewDescriptorImpl.kt | 1 + .../DeserializedPackageFragment.kt | 1 + .../DeserializedPackageMemberScope.kt | 1 + .../org/jetbrains/kotlin/storage/storage.kt | 4 ++ .../idea/search/usagesSearch/conventions.kt | 5 +- ...ePropertyDelegateAccessorsActionFactory.kt | 4 +- idea/testData/checker/Variance.kt | 4 +- .../infos/CapturedConstructorParameter.kt | 2 +- idea/testData/checker/regression/Jet169.kt | 2 +- .../imports/DelegatedProperty.expected.kt | 4 +- .../imports/DelegatedProperty.expected.names | 4 +- .../copyPaste/imports/DelegatedProperty.kt | 4 +- .../smartStepInto/delegatedPropertyGetter.kt | 4 +- .../tinyApp/outs/delegatedPropertyInClass.out | 4 +- .../delegatedPropertyInClassWoRenderer.out | 2 +- .../singleBreakpoint/dependentOnFile.kt | 2 +- .../frame/delegatedPropertyInClass.kt | 4 +- .../delegatedPropertyInClassWoRenderer.kt | 2 +- .../conventions/getAsPropertyDelegate.0.kt | 2 +- .../propertyDelegatedFunction.0.kt | 4 +- .../conventions/setAsPropertyDelegate.0.kt | 4 +- .../delegatedProperty.kt | 2 +- idea/testData/javaFacade/ea46019.kt | 2 +- .../callInMemberValDelegateRuntime.kt | 1 - .../callInMemberValDelegateRuntime.kt.after | 1 - ...rInMemberValDelegate.after.Dependency.java | 13 ++++ .../createFunction/delegateAccessors/val.kt | 2 +- .../delegateAccessors/val.kt.after | 4 +- .../createFunction/delegateAccessors/var.kt | 2 +- .../delegateAccessors/var.kt.after | 6 +- .../delegateAccessors/varMissingGet.kt | 4 +- .../delegateAccessors/varMissingGet.kt.after | 6 +- .../delegateAccessors/varMissingSet.kt | 4 +- .../delegateAccessors/varMissingSet.kt.after | 2 +- .../delegatedPropertyWithTypeParameters.kt | 4 +- ...tedPropertyWithTypeParametersDependency.kt | 4 +- .../inSource/getExtension.kt | 4 +- .../inSource/getMember.kt | 4 +- .../inSource/getMultipleDeclarations.kt | 12 ++-- .../inSource/getOneFakeOverride.kt | 4 +- .../getSetPropertyDelegatedExtension.kt | 8 +-- .../inSource/getSetPropertyDelegatedMember.kt | 8 +-- .../inStandardLibrary/lazy.kt | 2 +- .../inStandardLibrary/notNull.kt | 4 +- .../conventions/delegateProperty.kt | 12 ++-- .../inlineGet.kt | 2 +- .../inlineGet.kt.new.1 | 2 +- .../inlineSet.kt | 2 +- .../inlineSet.kt.new.2 | 2 +- .../inline.kt | 4 +- .../inline.kt.new.1 | 4 +- .../inline.kt.new.2 | 4 +- .../js/ast/metadata/MetadataProperty.kt | 7 ++- .../property/cases/delegated.kt | 2 +- .../property/cases/delegatedMutable.kt | 4 +- .../cases/delegateByExtensionProperty.kt | 4 +- .../cases/delegateByTopLevelFun.kt | 4 +- .../cases/delegateByTopLevelProperty.kt | 4 +- .../cases/delegateWithPropertyAccess.kt | 4 +- .../cases/getAsExtensionFun.kt | 2 +- .../cases/propertyMetadata.kt | 4 +- .../cases/setAsExtensionFun.kt | 4 +- .../testData/delegateProperty/cases/simple.kt | 4 +- .../delegateProperty/cases/topLevelVal.kt | 2 +- .../delegateProperty/cases/topLevelVar.kt | 4 +- .../delegateProperty/cases/withGenerics.kt | 4 +- .../delegationExtensionPropertyDelegated.kt | 4 +- .../src/kotlin/properties/Delegation.kt | 22 ++++--- .../src/kotlin/properties/Interfaces.kt | 20 ++++++- .../src/kotlin/properties/MapAccessors.kt | 12 ++++ libraries/stdlib/src/kotlin/util/Lazy.kt | 3 + 295 files changed, 718 insertions(+), 511 deletions(-) create mode 100644 compiler/testData/diagnostics/tests/DeprecatedGetSetPropertyDelegateConvention.kt create mode 100644 compiler/testData/diagnostics/tests/DeprecatedGetSetPropertyDelegateConvention.txt diff --git a/compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/calls/checkers/ReflectionAPICallChecker.kt b/compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/calls/checkers/ReflectionAPICallChecker.kt index 9c765fac59f..d9dcdb12b05 100644 --- a/compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/calls/checkers/ReflectionAPICallChecker.kt +++ b/compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/calls/checkers/ReflectionAPICallChecker.kt @@ -28,7 +28,6 @@ import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall import org.jetbrains.kotlin.resolve.jvm.diagnostics.ErrorsJvm.NO_REFLECTION_IN_CLASS_PATH import org.jetbrains.kotlin.serialization.deserialization.findClassAcrossModuleDependencies import org.jetbrains.kotlin.storage.StorageManager -import org.jetbrains.kotlin.types.expressions.OperatorConventions import org.jetbrains.kotlin.storage.get import org.jetbrains.kotlin.util.OperatorNameConventions diff --git a/compiler/frontend/src/org/jetbrains/kotlin/cfg/JetFlowInformationProvider.java b/compiler/frontend/src/org/jetbrains/kotlin/cfg/JetFlowInformationProvider.java index 65faff403dd..9a5fbc63e8e 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/cfg/JetFlowInformationProvider.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/cfg/JetFlowInformationProvider.java @@ -684,7 +684,8 @@ public class JetFlowInformationProvider { if (isMain || functionDescriptor.getModality().isOverridable() || !functionDescriptor.getOverriddenDescriptors().isEmpty() - || "get".equals(functionName) || "set".equals(functionName) || "propertyDelegated".equals(functionName) + || "getValue".equals(functionName) || "setValue".equals(functionName) + || "propertyDelegated".equals(functionName) ) { return; } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java index 9c140537876..d68d99b4a41 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java @@ -542,6 +542,7 @@ public interface Errors { DiagnosticFactory1>> ITERATOR_AMBIGUITY = DiagnosticFactory1.create(ERROR); DiagnosticFactory2 DELEGATE_SPECIAL_FUNCTION_MISSING = DiagnosticFactory2.create(ERROR); + DiagnosticFactory3 DELEGATE_RESOLVED_TO_DEPRECATED_CONVENTION = DiagnosticFactory3.create(WARNING); DiagnosticFactory2>> DELEGATE_SPECIAL_FUNCTION_AMBIGUITY = DiagnosticFactory2.create(ERROR); DiagnosticFactory2>> DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE = DiagnosticFactory2.create(ERROR); DiagnosticFactory3 DELEGATE_SPECIAL_FUNCTION_RETURN_TYPE_MISMATCH = DiagnosticFactory3.create(ERROR); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java index 677254ab404..12ca5e43b9b 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java @@ -361,6 +361,7 @@ public class DefaultErrorMessages { MAP.put(ITERATOR_AMBIGUITY, "Method ''iterator()'' is ambiguous for this expression: {0}", AMBIGUOUS_CALLS); MAP.put(DELEGATE_SPECIAL_FUNCTION_MISSING, "Missing ''{0}'' method on delegate of type ''{1}''", STRING, RENDER_TYPE); + MAP.put(DELEGATE_RESOLVED_TO_DEPRECATED_CONVENTION, " ''{0}'' method convention on type ''{1}'' is deprecated. Rename to ''{2}''", NAME, RENDER_TYPE, STRING); MAP.put(DELEGATE_SPECIAL_FUNCTION_AMBIGUITY, "Overload resolution ambiguity on method ''{0}'': {1}", STRING, AMBIGUOUS_CALLS); MAP.put(DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE, "Property delegate must have a ''{0}'' method. None of the following functions is suitable: {1}", STRING, AMBIGUOUS_CALLS); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/userDataUtil.kt b/compiler/frontend/src/org/jetbrains/kotlin/psi/userDataUtil.kt index 1889bd6546b..e38e07e5840 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/userDataUtil.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/userDataUtil.kt @@ -21,32 +21,41 @@ import com.intellij.openapi.util.Key import com.intellij.openapi.util.UserDataHolder import com.intellij.psi.PsiElement -public class UserDataProperty(val key: Key, val default: T? = null) : ReadWriteProperty { - override fun get(thisRef: R, desc: kotlin.PropertyMetadata): T? { +public class UserDataProperty(val key: Key, val default: T? = null) { + fun get(thisRef: R, desc: kotlin.PropertyMetadata) = getValue(thisRef, desc) + fun set(thisRef: R, desc: kotlin.PropertyMetadata, value: T?) = setValue(thisRef, desc, value) + + fun getValue(thisRef: R, desc: kotlin.PropertyMetadata): T? { return thisRef.getUserData(key) } - override fun set(thisRef: R, desc: kotlin.PropertyMetadata, value: T?) { + fun setValue(thisRef: R, desc: kotlin.PropertyMetadata, value: T?) { thisRef.putUserData(key, value) } } -public class NotNullableUserDataProperty(val key: Key, val defaultValue: T) : ReadWriteProperty { - override fun get(thisRef: R, desc: kotlin.PropertyMetadata): T { +public class NotNullableUserDataProperty(val key: Key, val defaultValue: T) { + fun get(thisRef: R, desc: kotlin.PropertyMetadata) = getValue(thisRef, desc) + fun set(thisRef: R, desc: kotlin.PropertyMetadata, value: T) = setValue(thisRef, desc, value) + + fun getValue(thisRef: R, desc: kotlin.PropertyMetadata): T { return thisRef.getUserData(key) ?: defaultValue } - override fun set(thisRef: R, desc: kotlin.PropertyMetadata, value: T) { + fun setValue(thisRef: R, desc: kotlin.PropertyMetadata, value: T) { thisRef.putUserData(key, value) } } -public class CopyableUserDataProperty(val key: Key, val default: T? = null) : ReadWriteProperty { - override fun get(thisRef: R, property: PropertyMetadata): T? { +public class CopyableUserDataProperty(val key: Key, val default: T? = null) { + fun get(thisRef: R, desc: kotlin.PropertyMetadata) = getValue(thisRef, desc) + fun set(thisRef: R, desc: kotlin.PropertyMetadata, value: T?) = setValue(thisRef, desc, value) + + fun getValue(thisRef: R, property: PropertyMetadata): T? { return thisRef.getCopyableUserData(key) } - override fun set(thisRef: R, property: PropertyMetadata, value: T?) { + fun setValue(thisRef: R, property: PropertyMetadata, value: T?) { thisRef.putCopyableUserData(key, value) } } \ No newline at end of file diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/DelegatedPropertyResolver.java b/compiler/frontend/src/org/jetbrains/kotlin/resolve/DelegatedPropertyResolver.java index f65ebf2eaf8..8f4ab87ecb4 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/DelegatedPropertyResolver.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/DelegatedPropertyResolver.java @@ -58,8 +58,11 @@ import static org.jetbrains.kotlin.types.expressions.ExpressionTypingUtils.creat public class DelegatedPropertyResolver { public static final Name PROPERTY_DELEGATED_FUNCTION_NAME = Name.identifier("propertyDelegated"); - public static final Name GETTER_NAME = Name.identifier("get"); - public static final Name SETTER_NAME = Name.identifier("set"); + public static final Name GETTER_NAME = Name.identifier("getValue"); + public static final Name SETTER_NAME = Name.identifier("setValue"); + + public static final Name OLD_GETTER_NAME = Name.identifier("get"); + public static final Name OLD_SETTER_NAME = Name.identifier("set"); @NotNull private final ExpressionTypingServices expressionTypingServices; @NotNull private final FakeCallResolver fakeCallResolver; @@ -223,7 +226,7 @@ public class DelegatedPropertyResolver { trace.record(DELEGATED_PROPERTY_RESOLVED_CALL, accessor, resultingCall); } - /* Resolve get() or set() methods from delegate */ + /* Resolve getValue() or setValue() methods from delegate */ public OverloadResolutionResults getDelegatedPropertyConventionMethod( @NotNull PropertyDescriptor propertyDescriptor, @NotNull JetExpression delegateExpression, @@ -252,8 +255,8 @@ public class DelegatedPropertyResolver { if (!isGet) { JetReferenceExpression fakeArgument = (JetReferenceExpression) createFakeExpressionOfType(delegateExpression.getProject(), trace, - "fakeArgument" + arguments.size(), - propertyDescriptor.getType()); + "fakeArgument" + arguments.size(), + propertyDescriptor.getType()); arguments.add(fakeArgument); List valueParameters = accessor.getValueParameters(); trace.record(REFERENCE_TARGET, fakeArgument, valueParameters.get(0)); @@ -265,8 +268,24 @@ public class DelegatedPropertyResolver { Pair> resolutionResult = fakeCallResolver.makeAndResolveFakeCallInContext(receiver, context, arguments, functionName, delegateExpression); + OverloadResolutionResults resolutionResults = resolutionResult.getSecond(); + + // Resolve get/set is getValue/setValue was not found. Temporary, for code migration + if (!resolutionResults.isSuccess() && !resolutionResults.isAmbiguity()) { + Name oldFunctionName = isGet ? OLD_GETTER_NAME : OLD_SETTER_NAME; + Pair> additionalResolutionResult = + fakeCallResolver.makeAndResolveFakeCallInContext(receiver, context, arguments, oldFunctionName, delegateExpression); + if (additionalResolutionResult.getSecond().isSuccess()) { + FunctionDescriptor resultingDescriptor = additionalResolutionResult.getSecond().getResultingDescriptor(); + trace.report(DELEGATE_RESOLVED_TO_DEPRECATED_CONVENTION.on( + delegateExpression, resultingDescriptor, delegateType, functionName.asString())); + trace.record(BindingContext.DELEGATED_PROPERTY_CALL, accessor, additionalResolutionResult.getFirst()); + return additionalResolutionResult.getSecond(); + } + } + trace.record(BindingContext.DELEGATED_PROPERTY_CALL, accessor, resolutionResult.getFirst()); - return resolutionResult.getSecond(); + return resolutionResults; } private static String renderCall(@NotNull Call call, @NotNull BindingContext context) { diff --git a/compiler/testData/cfg/declarations/properties/DelegatedProperty.instructions b/compiler/testData/cfg/declarations/properties/DelegatedProperty.instructions index 3313b2454a8..e34e33a765f 100644 --- a/compiler/testData/cfg/declarations/properties/DelegatedProperty.instructions +++ b/compiler/testData/cfg/declarations/properties/DelegatedProperty.instructions @@ -1,6 +1,6 @@ == Delegate == class Delegate { - fun get(_this: Nothing?, p: PropertyMetadata): Int = 0 + fun getValue(_this: Nothing?, p: PropertyMetadata): Int = 0 } --------------------- L0: @@ -12,8 +12,8 @@ error: sink: PREV:[, ] ===================== -== get == -fun get(_this: Nothing?, p: PropertyMetadata): Int = 0 +== getValue == +fun getValue(_this: Nothing?, p: PropertyMetadata): Int = 0 --------------------- L0: 1 @@ -62,4 +62,4 @@ error: PREV:[] sink: PREV:[, ] -===================== \ No newline at end of file +===================== diff --git a/compiler/testData/cfg/declarations/properties/DelegatedProperty.kt b/compiler/testData/cfg/declarations/properties/DelegatedProperty.kt index d0f6e621021..4976c20b35b 100644 --- a/compiler/testData/cfg/declarations/properties/DelegatedProperty.kt +++ b/compiler/testData/cfg/declarations/properties/DelegatedProperty.kt @@ -1,5 +1,5 @@ class Delegate { - fun get(_this: Nothing?, p: PropertyMetadata): Int = 0 + fun getValue(_this: Nothing?, p: PropertyMetadata): Int = 0 } val a = Delegate() diff --git a/compiler/testData/cfg/declarations/properties/DelegatedProperty.values b/compiler/testData/cfg/declarations/properties/DelegatedProperty.values index b4aff3f3a6c..5dc0cc807d6 100644 --- a/compiler/testData/cfg/declarations/properties/DelegatedProperty.values +++ b/compiler/testData/cfg/declarations/properties/DelegatedProperty.values @@ -1,11 +1,11 @@ == Delegate == class Delegate { - fun get(_this: Nothing?, p: PropertyMetadata): Int = 0 + fun getValue(_this: Nothing?, p: PropertyMetadata): Int = 0 } --------------------- ===================== -== get == -fun get(_this: Nothing?, p: PropertyMetadata): Int = 0 +== getValue == +fun getValue(_this: Nothing?, p: PropertyMetadata): Int = 0 --------------------- : {<: Nothing?} NEW: magic[FAKE_INITIALIZER](_this: Nothing?) -> : {<: PropertyMetadata} NEW: magic[FAKE_INITIALIZER](p: PropertyMetadata) -> diff --git a/compiler/testData/codegen/box/delegatedProperty/accessTopLevelDelegatedPropertyInClinit.kt b/compiler/testData/codegen/box/delegatedProperty/accessTopLevelDelegatedPropertyInClinit.kt index 26d5724a6e1..e41350a0c34 100644 --- a/compiler/testData/codegen/box/delegatedProperty/accessTopLevelDelegatedPropertyInClinit.kt +++ b/compiler/testData/codegen/box/delegatedProperty/accessTopLevelDelegatedPropertyInClinit.kt @@ -1,7 +1,7 @@ // KT-5612 class Delegate { - public fun get(thisRef: Any?, prop: PropertyMetadata): String { + public fun getValue(thisRef: Any?, prop: PropertyMetadata): String { return "OK" } } diff --git a/compiler/testData/codegen/box/delegatedProperty/capturePropertyInClosure.kt b/compiler/testData/codegen/box/delegatedProperty/capturePropertyInClosure.kt index c8859bd20db..dbbab1e0e3f 100644 --- a/compiler/testData/codegen/box/delegatedProperty/capturePropertyInClosure.kt +++ b/compiler/testData/codegen/box/delegatedProperty/capturePropertyInClosure.kt @@ -1,7 +1,7 @@ class Delegate { var inner = 1 - fun get(t: Any?, p: PropertyMetadata): Int = inner - fun set(t: Any?, p: PropertyMetadata, i: Int) { inner = i } + fun getValue(t: Any?, p: PropertyMetadata): Int = inner + fun setValue(t: Any?, p: PropertyMetadata, i: Int) { inner = i } } class B { diff --git a/compiler/testData/codegen/box/delegatedProperty/castGetReturnType.kt b/compiler/testData/codegen/box/delegatedProperty/castGetReturnType.kt index 1e304fc609f..538a63749bb 100644 --- a/compiler/testData/codegen/box/delegatedProperty/castGetReturnType.kt +++ b/compiler/testData/codegen/box/delegatedProperty/castGetReturnType.kt @@ -1,5 +1,5 @@ class Delegate { - fun get(t: Any?, p: PropertyMetadata): Int = 1 + fun getValue(t: Any?, p: PropertyMetadata): Int = 1 } class AImpl { diff --git a/compiler/testData/codegen/box/delegatedProperty/castSetParameter.kt b/compiler/testData/codegen/box/delegatedProperty/castSetParameter.kt index 91ba84a3821..022e8ec4159 100644 --- a/compiler/testData/codegen/box/delegatedProperty/castSetParameter.kt +++ b/compiler/testData/codegen/box/delegatedProperty/castSetParameter.kt @@ -1,10 +1,10 @@ class Delegate { var inner = Derived() - fun get(t: Any?, p: PropertyMetadata): Derived { + fun getValue(t: Any?, p: PropertyMetadata): Derived { inner = Derived(inner.a + "-get") return inner } - fun set(t: Any?, p: PropertyMetadata, i: Base) { inner = Derived(inner.a + "-" + i.a + "-set") } + fun setValue(t: Any?, p: PropertyMetadata, i: Base) { inner = Derived(inner.a + "-" + i.a + "-set") } } class A { diff --git a/compiler/testData/codegen/box/delegatedProperty/defaultArgs.kt b/compiler/testData/codegen/box/delegatedProperty/defaultArgs.kt index abb9cd6bd09..ddde67bdd92 100644 --- a/compiler/testData/codegen/box/delegatedProperty/defaultArgs.kt +++ b/compiler/testData/codegen/box/delegatedProperty/defaultArgs.kt @@ -1,5 +1,5 @@ class Delegate { - fun get(t: Any?, p: PropertyMetadata, s: String = ""): Int = 1 + fun getValue(t: Any?, p: PropertyMetadata, s: String = ""): Int = 1 } val prop: Int by Delegate() diff --git a/compiler/testData/codegen/box/delegatedProperty/delegateAsInnerClass.kt b/compiler/testData/codegen/box/delegatedProperty/delegateAsInnerClass.kt index aa13f9cb5e0..b7d9b13be59 100644 --- a/compiler/testData/codegen/box/delegatedProperty/delegateAsInnerClass.kt +++ b/compiler/testData/codegen/box/delegatedProperty/delegateAsInnerClass.kt @@ -3,8 +3,8 @@ class A { class Delegate { var inner = 1 - fun get(t: Any?, p: PropertyMetadata): Int = inner - fun set(t: Any?, p: PropertyMetadata, i: Int) { inner = i } + fun getValue(t: Any?, p: PropertyMetadata): Int = inner + fun setValue(t: Any?, p: PropertyMetadata, i: Int) { inner = i } } } diff --git a/compiler/testData/codegen/box/delegatedProperty/delegateByOtherProperty.kt b/compiler/testData/codegen/box/delegatedProperty/delegateByOtherProperty.kt index 1329f708dfe..8dcfdaad66f 100644 --- a/compiler/testData/codegen/box/delegatedProperty/delegateByOtherProperty.kt +++ b/compiler/testData/codegen/box/delegatedProperty/delegateByOtherProperty.kt @@ -1,7 +1,7 @@ class Delegate { var inner = 1 - fun get(t: Any?, p: PropertyMetadata): Int = inner - fun set(t: Any?, p: PropertyMetadata, i: Int) { inner = i } + fun getValue(t: Any?, p: PropertyMetadata): Int = inner + fun setValue(t: Any?, p: PropertyMetadata, i: Int) { inner = i } } class A { diff --git a/compiler/testData/codegen/box/delegatedProperty/delegateByTopLevelFun.kt b/compiler/testData/codegen/box/delegatedProperty/delegateByTopLevelFun.kt index e8bc1bbe992..a6640b22522 100644 --- a/compiler/testData/codegen/box/delegatedProperty/delegateByTopLevelFun.kt +++ b/compiler/testData/codegen/box/delegatedProperty/delegateByTopLevelFun.kt @@ -1,7 +1,7 @@ class Delegate { var inner = 1 - fun get(t: Any?, p: PropertyMetadata): Int = inner - fun set(t: Any?, p: PropertyMetadata, i: Int) { inner = i } + fun getValue(t: Any?, p: PropertyMetadata): Int = inner + fun setValue(t: Any?, p: PropertyMetadata, i: Int) { inner = i } } fun foo() = Delegate() diff --git a/compiler/testData/codegen/box/delegatedProperty/delegateByTopLevelProperty.kt b/compiler/testData/codegen/box/delegatedProperty/delegateByTopLevelProperty.kt index e0103969899..f44b1d4efc2 100644 --- a/compiler/testData/codegen/box/delegatedProperty/delegateByTopLevelProperty.kt +++ b/compiler/testData/codegen/box/delegatedProperty/delegateByTopLevelProperty.kt @@ -1,7 +1,7 @@ class Delegate { var inner = 1 - fun get(t: Any?, p: PropertyMetadata): Int = inner - fun set(t: Any?, p: PropertyMetadata, i: Int) { inner = i } + fun getValue(t: Any?, p: PropertyMetadata): Int = inner + fun setValue(t: Any?, p: PropertyMetadata, i: Int) { inner = i } } val p = Delegate() diff --git a/compiler/testData/codegen/box/delegatedProperty/delegateForExtProperty.kt b/compiler/testData/codegen/box/delegatedProperty/delegateForExtProperty.kt index 754912349a7..41add8830e3 100644 --- a/compiler/testData/codegen/box/delegatedProperty/delegateForExtProperty.kt +++ b/compiler/testData/codegen/box/delegatedProperty/delegateForExtProperty.kt @@ -1,5 +1,5 @@ class Delegate { - fun get(t: A, p: PropertyMetadata): Int = 1 + fun getValue(t: A, p: PropertyMetadata): Int = 1 } val A.prop: Int by Delegate() diff --git a/compiler/testData/codegen/box/delegatedProperty/delegateForExtPropertyInClass.kt b/compiler/testData/codegen/box/delegatedProperty/delegateForExtPropertyInClass.kt index 40c82203866..f07fa201b3f 100644 --- a/compiler/testData/codegen/box/delegatedProperty/delegateForExtPropertyInClass.kt +++ b/compiler/testData/codegen/box/delegatedProperty/delegateForExtPropertyInClass.kt @@ -1,5 +1,5 @@ class Delegate { - fun get(t: F.A, p: PropertyMetadata): Int = 1 + fun getValue(t: F.A, p: PropertyMetadata): Int = 1 } class F { diff --git a/compiler/testData/codegen/box/delegatedProperty/genericDelegate.kt b/compiler/testData/codegen/box/delegatedProperty/genericDelegate.kt index 4f2043751a1..871486f5303 100644 --- a/compiler/testData/codegen/box/delegatedProperty/genericDelegate.kt +++ b/compiler/testData/codegen/box/delegatedProperty/genericDelegate.kt @@ -1,6 +1,6 @@ class Delegate(var inner: T) { - fun get(t: Any?, p: PropertyMetadata): T = inner - fun set(t: Any?, p: PropertyMetadata, i: T) { inner = i } + fun getValue(t: Any?, p: PropertyMetadata): T = inner + fun setValue(t: Any?, p: PropertyMetadata, i: T) { inner = i } } class A { diff --git a/compiler/testData/codegen/box/delegatedProperty/getAsExtensionFun.kt b/compiler/testData/codegen/box/delegatedProperty/getAsExtensionFun.kt index fee5e1d7fbc..473aa27d088 100644 --- a/compiler/testData/codegen/box/delegatedProperty/getAsExtensionFun.kt +++ b/compiler/testData/codegen/box/delegatedProperty/getAsExtensionFun.kt @@ -1,7 +1,7 @@ class Delegate { } -fun Delegate.get(t: Any?, p: PropertyMetadata): Int = 1 +fun Delegate.getValue(t: Any?, p: PropertyMetadata): Int = 1 class A { val prop: Int by Delegate() diff --git a/compiler/testData/codegen/box/delegatedProperty/getAsExtensionFunInClass.kt b/compiler/testData/codegen/box/delegatedProperty/getAsExtensionFunInClass.kt index e0434b14155..018999efe91 100644 --- a/compiler/testData/codegen/box/delegatedProperty/getAsExtensionFunInClass.kt +++ b/compiler/testData/codegen/box/delegatedProperty/getAsExtensionFunInClass.kt @@ -2,7 +2,7 @@ class Delegate { } class A { - fun Delegate.get(t: Any?, p: PropertyMetadata): Int = 1 + fun Delegate.getValue(t: Any?, p: PropertyMetadata): Int = 1 val prop: Int by Delegate() } diff --git a/compiler/testData/codegen/box/delegatedProperty/inClassVal.kt b/compiler/testData/codegen/box/delegatedProperty/inClassVal.kt index 52931d2061e..a5c9c8d22fc 100644 --- a/compiler/testData/codegen/box/delegatedProperty/inClassVal.kt +++ b/compiler/testData/codegen/box/delegatedProperty/inClassVal.kt @@ -1,5 +1,5 @@ class Delegate { - fun get(t: Any?, p: PropertyMetadata): Int = 1 + fun getValue(t: Any?, p: PropertyMetadata): Int = 1 } class A { diff --git a/compiler/testData/codegen/box/delegatedProperty/inClassVar.kt b/compiler/testData/codegen/box/delegatedProperty/inClassVar.kt index a9a12550217..9df93c6e278 100644 --- a/compiler/testData/codegen/box/delegatedProperty/inClassVar.kt +++ b/compiler/testData/codegen/box/delegatedProperty/inClassVar.kt @@ -1,7 +1,7 @@ class Delegate { var inner = 1 - fun get(t: Any?, p: PropertyMetadata): Int = inner - fun set(t: Any?, p: PropertyMetadata, i: Int) { inner = i } + fun getValue(t: Any?, p: PropertyMetadata): Int = inner + fun setValue(t: Any?, p: PropertyMetadata, i: Int) { inner = i } } class A { diff --git a/compiler/testData/codegen/box/delegatedProperty/inTrait.kt b/compiler/testData/codegen/box/delegatedProperty/inTrait.kt index 1f5e64731a9..10b0915b1c1 100644 --- a/compiler/testData/codegen/box/delegatedProperty/inTrait.kt +++ b/compiler/testData/codegen/box/delegatedProperty/inTrait.kt @@ -1,5 +1,5 @@ class Delegate { - fun get(t: Any?, p: PropertyMetadata): Int = 1 + fun getValue(t: Any?, p: PropertyMetadata): Int = 1 } interface A { diff --git a/compiler/testData/codegen/box/delegatedProperty/inferredPropertyType.kt b/compiler/testData/codegen/box/delegatedProperty/inferredPropertyType.kt index fff6188290a..1f0cf6e0498 100644 --- a/compiler/testData/codegen/box/delegatedProperty/inferredPropertyType.kt +++ b/compiler/testData/codegen/box/delegatedProperty/inferredPropertyType.kt @@ -1,6 +1,6 @@ class Delegate(var inner: T) { - fun get(t: Any?, p: PropertyMetadata): T = inner - fun set(t: Any?, p: PropertyMetadata, i: T) { inner = i } + fun getValue(t: Any?, p: PropertyMetadata): T = inner + fun setValue(t: Any?, p: PropertyMetadata, i: T) { inner = i } } class A { diff --git a/compiler/testData/codegen/box/delegatedProperty/kt4138.kt b/compiler/testData/codegen/box/delegatedProperty/kt4138.kt index f1f85eeaee1..5cf5739fa77 100644 --- a/compiler/testData/codegen/box/delegatedProperty/kt4138.kt +++ b/compiler/testData/codegen/box/delegatedProperty/kt4138.kt @@ -1,6 +1,6 @@ class Delegate(var inner: T) { - fun get(t: Any?, p: PropertyMetadata): T = inner - fun set(t: Any?, p: PropertyMetadata, i: T) { inner = i } + fun getValue(t: Any?, p: PropertyMetadata): T = inner + fun setValue(t: Any?, p: PropertyMetadata, i: T) { inner = i } } diff --git a/compiler/testData/codegen/box/delegatedProperty/privateVar.kt b/compiler/testData/codegen/box/delegatedProperty/privateVar.kt index 9de3bf20066..4fcdeab90e1 100644 --- a/compiler/testData/codegen/box/delegatedProperty/privateVar.kt +++ b/compiler/testData/codegen/box/delegatedProperty/privateVar.kt @@ -1,7 +1,7 @@ class Delegate { var inner = 1 - fun get(t: Any?, p: PropertyMetadata): Int = inner - fun set(t: Any?, p: PropertyMetadata, i: Int) { inner = i } + fun getValue(t: Any?, p: PropertyMetadata): Int = inner + fun setValue(t: Any?, p: PropertyMetadata, i: Int) { inner = i } } class A { diff --git a/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/defaultArgs.kt b/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/defaultArgs.kt index 8e9c3fa8ee7..80800dc65d9 100644 --- a/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/defaultArgs.kt +++ b/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/defaultArgs.kt @@ -1,6 +1,6 @@ class Delegate { var name = "" - fun get(t: Any?, p: PropertyMetadata): String = name + fun getValue(t: Any?, p: PropertyMetadata): String = name fun propertyDelegated(p: PropertyMetadata, s: String = "is OK") { name = "${p.name} $s" } } diff --git a/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/delegateAsInnerClass.kt b/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/delegateAsInnerClass.kt index bfdcab95031..3387def41b4 100644 --- a/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/delegateAsInnerClass.kt +++ b/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/delegateAsInnerClass.kt @@ -3,7 +3,7 @@ class A { inner class Delegate { var name = "" - fun get(t: Any?, p: PropertyMetadata): String = name + fun getValue(t: Any?, p: PropertyMetadata): String = name fun propertyDelegated(p: PropertyMetadata) { name = p.name } } } diff --git a/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/delegateByOtherProperty.kt b/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/delegateByOtherProperty.kt index 662e8c3558d..3984543b306 100644 --- a/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/delegateByOtherProperty.kt +++ b/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/delegateByOtherProperty.kt @@ -1,6 +1,6 @@ class Delegate { var name = "" - fun get(t: Any?, p: PropertyMetadata): String = name + fun getValue(t: Any?, p: PropertyMetadata): String = name fun propertyDelegated(p: PropertyMetadata) { name = p.name } } diff --git a/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/delegateByTopLevelFun.kt b/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/delegateByTopLevelFun.kt index 3d04b072ad6..541fa424235 100644 --- a/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/delegateByTopLevelFun.kt +++ b/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/delegateByTopLevelFun.kt @@ -1,6 +1,6 @@ class Delegate { var name = "" - fun get(t: Any?, p: PropertyMetadata): String = name + fun getValue(t: Any?, p: PropertyMetadata): String = name fun propertyDelegated(p: PropertyMetadata) { name = p.name } } diff --git a/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/delegateByTopLevelProperty.kt b/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/delegateByTopLevelProperty.kt index ecd202ed1b2..c31f242705f 100644 --- a/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/delegateByTopLevelProperty.kt +++ b/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/delegateByTopLevelProperty.kt @@ -1,6 +1,6 @@ class Delegate { var name = "" - fun get(t: Any?, p: PropertyMetadata): String = name + fun getValue(t: Any?, p: PropertyMetadata): String = name fun propertyDelegated(p: PropertyMetadata) { name = p.name } } diff --git a/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/delegateForExtProperty.kt b/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/delegateForExtProperty.kt index 78b6b72c799..16c4257b655 100644 --- a/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/delegateForExtProperty.kt +++ b/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/delegateForExtProperty.kt @@ -1,6 +1,6 @@ class Delegate { var name = "" - fun get(t: A, p: PropertyMetadata): String = name + fun getValue(t: A, p: PropertyMetadata): String = name fun propertyDelegated(p: PropertyMetadata) { name = p.name } } diff --git a/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/delegateForExtPropertyInClass.kt b/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/delegateForExtPropertyInClass.kt index 9847d59141e..db55e874656 100644 --- a/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/delegateForExtPropertyInClass.kt +++ b/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/delegateForExtPropertyInClass.kt @@ -1,6 +1,6 @@ class Delegate { var name = "" - fun get(t: F.A, p: PropertyMetadata): String = name + fun getValue(t: F.A, p: PropertyMetadata): String = name fun propertyDelegated(p: PropertyMetadata) { name = p.name } } diff --git a/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/inTrait.kt b/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/inTrait.kt index 370b3ec7275..3721c144ebc 100644 --- a/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/inTrait.kt +++ b/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/inTrait.kt @@ -1,6 +1,6 @@ class Delegate { var name = "" - fun get(t: Any?, p: PropertyMetadata): String = name + fun getValue(t: Any?, p: PropertyMetadata): String = name fun propertyDelegated(p: PropertyMetadata) { name = p.name } } diff --git a/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/noneApplicable.kt b/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/noneApplicable.kt index d9d872f3692..e503457cc01 100644 --- a/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/noneApplicable.kt +++ b/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/noneApplicable.kt @@ -1,6 +1,6 @@ class Delegate { var inner = "OK" - fun get(t: Any?, p: PropertyMetadata): String = inner + fun getValue(t: Any?, p: PropertyMetadata): String = inner private fun propertyDelegated(p: PropertyMetadata) { inner = "fail" } fun propertyDelegated() { inner = "fail" } diff --git a/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/pdAsExtensionFun.kt b/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/pdAsExtensionFun.kt index 288da33c340..106be45e098 100644 --- a/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/pdAsExtensionFun.kt +++ b/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/pdAsExtensionFun.kt @@ -1,6 +1,6 @@ class Delegate { var name = "" - fun get(t: Any?, p: PropertyMetadata): String = name + fun getValue(t: Any?, p: PropertyMetadata): String = name } fun Delegate.propertyDelegated(p: PropertyMetadata) { name = p.name } diff --git a/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/privateProperty.kt b/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/privateProperty.kt index 90b752b9d35..7e5143377c6 100644 --- a/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/privateProperty.kt +++ b/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/privateProperty.kt @@ -1,6 +1,6 @@ class Delegate { var name = "" - fun get(t: Any?, p: PropertyMetadata): String = name + fun getValue(t: Any?, p: PropertyMetadata): String = name fun propertyDelegated(p: PropertyMetadata) { name = p.name } } diff --git a/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/topLevel.kt b/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/topLevel.kt index 3aee0c69b88..79dc6a3a92c 100644 --- a/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/topLevel.kt +++ b/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/topLevel.kt @@ -1,6 +1,6 @@ class Delegate { var name = "" - fun get(t: Any?, p: PropertyMetadata): String = name + fun getValue(t: Any?, p: PropertyMetadata): String = name fun propertyDelegated(p: PropertyMetadata) { name = p.name } } diff --git a/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/twoPropsByOneDelegate.kt b/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/twoPropsByOneDelegate.kt index 2d7c5413cbe..c527b0e0885 100644 --- a/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/twoPropsByOneDelegate.kt +++ b/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/twoPropsByOneDelegate.kt @@ -1,6 +1,6 @@ class Delegate { var count = 0 - fun get(t: Any?, p: PropertyMetadata) {} + fun getValue(t: Any?, p: PropertyMetadata) {} fun propertyDelegated(vararg p: PropertyMetadata) { count++ } } diff --git a/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/valInInnerClass.kt b/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/valInInnerClass.kt index fb933a3716f..c01f5d89d7b 100644 --- a/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/valInInnerClass.kt +++ b/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/valInInnerClass.kt @@ -1,6 +1,6 @@ class Delegate { var name = "" - fun get(t: Any?, p: PropertyMetadata): String = name + fun getValue(t: Any?, p: PropertyMetadata): String = name fun propertyDelegated(p: PropertyMetadata) { name = p.name } } diff --git a/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/vararg.kt b/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/vararg.kt index 91935aaa9c9..267f9ac22c7 100644 --- a/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/vararg.kt +++ b/compiler/testData/codegen/box/delegatedProperty/propertyDelegatedMethod/vararg.kt @@ -1,6 +1,6 @@ class Delegate { var name = "" - fun get(t: Any?, p: PropertyMetadata): String = name + fun getValue(t: Any?, p: PropertyMetadata): String = name fun propertyDelegated(vararg p: PropertyMetadata) { name = p[0].name } } diff --git a/compiler/testData/codegen/box/delegatedProperty/propertyMetadataEqualsHashCodeToString.kt b/compiler/testData/codegen/box/delegatedProperty/propertyMetadataEqualsHashCodeToString.kt index cddf2cd6487..a50b7964f3b 100644 --- a/compiler/testData/codegen/box/delegatedProperty/propertyMetadataEqualsHashCodeToString.kt +++ b/compiler/testData/codegen/box/delegatedProperty/propertyMetadataEqualsHashCodeToString.kt @@ -13,7 +13,7 @@ val Int.foo: String by O object O { val metadatas = HashSet() - fun get(t: Any?, p: PropertyMetadata): String { + fun getValue(t: Any?, p: PropertyMetadata): String { metadatas.add(p) return "" } diff --git a/compiler/testData/codegen/box/delegatedProperty/propertyMetadataShouldBeCached.kt b/compiler/testData/codegen/box/delegatedProperty/propertyMetadataShouldBeCached.kt index 49d26c466e3..c575e75a7f6 100644 --- a/compiler/testData/codegen/box/delegatedProperty/propertyMetadataShouldBeCached.kt +++ b/compiler/testData/codegen/box/delegatedProperty/propertyMetadataShouldBeCached.kt @@ -17,18 +17,18 @@ val metadatas = IdentityHashMap() fun record(p: PropertyMetadata) = metadatas.put(p, Unit) object IntHandler { - fun get(t: Any?, p: PropertyMetadata): Int { record(p); return 42 } - fun set(t: Any?, p: PropertyMetadata, value: Int) { record(p) } + fun getValue(t: Any?, p: PropertyMetadata): Int { record(p); return 42 } + fun setValue(t: Any?, p: PropertyMetadata, value: Int) { record(p) } } object AnyHandler { - fun get(t: Any?, p: PropertyMetadata): Any? { record(p); return 3.14 } - fun set(t: Any?, p: PropertyMetadata, value: Any?) { record(p) } + fun getValue(t: Any?, p: PropertyMetadata): Any? { record(p); return 3.14 } + fun setValue(t: Any?, p: PropertyMetadata, value: Any?) { record(p) } } object StringHandler { - fun get(t: Any?, p: PropertyMetadata): String { record(p); return p.name } - fun set(t: Any?, p: PropertyMetadata, value: String) { record(p) } + fun getValue(t: Any?, p: PropertyMetadata): String { record(p); return p.name } + fun setValue(t: Any?, p: PropertyMetadata, value: String) { record(p) } } fun box(): String { diff --git a/compiler/testData/codegen/box/delegatedProperty/setAsExtensionFun.kt b/compiler/testData/codegen/box/delegatedProperty/setAsExtensionFun.kt index fa6432c9922..206769601b8 100644 --- a/compiler/testData/codegen/box/delegatedProperty/setAsExtensionFun.kt +++ b/compiler/testData/codegen/box/delegatedProperty/setAsExtensionFun.kt @@ -1,9 +1,9 @@ class Delegate { var inner = 1 - fun get(t: Any?, p: PropertyMetadata): Int = inner + fun getValue(t: Any?, p: PropertyMetadata): Int = inner } -fun Delegate.set(t: Any?, p: PropertyMetadata, i: Int) { inner = i } +fun Delegate.setValue(t: Any?, p: PropertyMetadata, i: Int) { inner = i } class A { var prop: Int by Delegate() diff --git a/compiler/testData/codegen/box/delegatedProperty/setAsExtensionFunInClass.kt b/compiler/testData/codegen/box/delegatedProperty/setAsExtensionFunInClass.kt index bfd4100178a..172c051c433 100644 --- a/compiler/testData/codegen/box/delegatedProperty/setAsExtensionFunInClass.kt +++ b/compiler/testData/codegen/box/delegatedProperty/setAsExtensionFunInClass.kt @@ -1,10 +1,10 @@ class Delegate { var inner = 1 - fun get(t: Any?, p: PropertyMetadata): Int = inner + fun getValue(t: Any?, p: PropertyMetadata): Int = inner } class A { - fun Delegate.set(t: Any?, p: PropertyMetadata, i: Int) { inner = i } + fun Delegate.setValue(t: Any?, p: PropertyMetadata, i: Int) { inner = i } var prop: Int by Delegate() } diff --git a/compiler/testData/codegen/box/delegatedProperty/topLevelVal.kt b/compiler/testData/codegen/box/delegatedProperty/topLevelVal.kt index 6a8edfcb330..0971759657f 100644 --- a/compiler/testData/codegen/box/delegatedProperty/topLevelVal.kt +++ b/compiler/testData/codegen/box/delegatedProperty/topLevelVal.kt @@ -1,5 +1,5 @@ class Delegate { - fun get(t: Any?, p: PropertyMetadata): Int = 1 + fun getValue(t: Any?, p: PropertyMetadata): Int = 1 } val prop: Int by Delegate() diff --git a/compiler/testData/codegen/box/delegatedProperty/topLevelVar.kt b/compiler/testData/codegen/box/delegatedProperty/topLevelVar.kt index 1fcc7116867..0cf4b420aa0 100644 --- a/compiler/testData/codegen/box/delegatedProperty/topLevelVar.kt +++ b/compiler/testData/codegen/box/delegatedProperty/topLevelVar.kt @@ -1,7 +1,7 @@ class Delegate { var inner = 1 - fun get(t: Any?, p: PropertyMetadata): Int = inner - fun set(t: Any?, p: PropertyMetadata, i: Int) { inner = i } + fun getValue(t: Any?, p: PropertyMetadata): Int = inner + fun setValue(t: Any?, p: PropertyMetadata, i: Int) { inner = i } } var prop: Int by Delegate() diff --git a/compiler/testData/codegen/box/delegatedProperty/twoPropByOneDelegete.kt b/compiler/testData/codegen/box/delegatedProperty/twoPropByOneDelegete.kt index 6eca6c0a38f..9c05a46dadc 100644 --- a/compiler/testData/codegen/box/delegatedProperty/twoPropByOneDelegete.kt +++ b/compiler/testData/codegen/box/delegatedProperty/twoPropByOneDelegete.kt @@ -1,5 +1,5 @@ class Delegate(val f: (T) -> Int) { - fun get(t: T, p: PropertyMetadata): Int = f(t) + fun getValue(t: T, p: PropertyMetadata): Int = f(t) } val p = Delegate { t -> t.foo() } diff --git a/compiler/testData/codegen/box/delegatedProperty/valInInnerClass.kt b/compiler/testData/codegen/box/delegatedProperty/valInInnerClass.kt index 2bb28dadbd8..7ac3af2a8c8 100644 --- a/compiler/testData/codegen/box/delegatedProperty/valInInnerClass.kt +++ b/compiler/testData/codegen/box/delegatedProperty/valInInnerClass.kt @@ -1,5 +1,5 @@ class Delegate { - fun get(t: Any?, p: PropertyMetadata): Int = 1 + fun getValue(t: Any?, p: PropertyMetadata): Int = 1 } class A { diff --git a/compiler/testData/codegen/box/delegatedProperty/varInInnerClass.kt b/compiler/testData/codegen/box/delegatedProperty/varInInnerClass.kt index 698a00b6665..1f341e82267 100644 --- a/compiler/testData/codegen/box/delegatedProperty/varInInnerClass.kt +++ b/compiler/testData/codegen/box/delegatedProperty/varInInnerClass.kt @@ -1,7 +1,7 @@ class Delegate { var inner = 1 - fun get(t: Any?, p: PropertyMetadata): Int = inner - fun set(t: Any?, p: PropertyMetadata, i: Int) { inner = i } + fun getValue(t: Any?, p: PropertyMetadata): Int = inner + fun setValue(t: Any?, p: PropertyMetadata, i: Int) { inner = i } } class A { diff --git a/compiler/testData/codegen/box/delegatedProperty/vararg.kt b/compiler/testData/codegen/box/delegatedProperty/vararg.kt index 9eecf777daa..9ff39c61431 100644 --- a/compiler/testData/codegen/box/delegatedProperty/vararg.kt +++ b/compiler/testData/codegen/box/delegatedProperty/vararg.kt @@ -1,5 +1,5 @@ class Delegate { - fun get(t: Any?, vararg p: PropertyMetadata): Int = 1 + fun getValue(t: Any?, vararg p: PropertyMetadata): Int = 1 } val prop: Int by Delegate() diff --git a/compiler/testData/codegen/box/fieldRename/delegates.kt b/compiler/testData/codegen/box/fieldRename/delegates.kt index 4b76de93ab0..22c2a06b911 100644 --- a/compiler/testData/codegen/box/fieldRename/delegates.kt +++ b/compiler/testData/codegen/box/fieldRename/delegates.kt @@ -1,14 +1,14 @@ public open class TestDelegate(private val initializer: () -> T) { private var value: T? = null - public open fun get(thisRef: Any?, desc: PropertyMetadata): T { + public open fun getValue(thisRef: Any?, desc: PropertyMetadata): T { if (value == null) { value = initializer() } return value!! } - public open fun set(thisRef: Any?, desc: PropertyMetadata, svalue : T) { + public open fun setValue(thisRef: Any?, desc: PropertyMetadata, svalue : T) { value = svalue } } diff --git a/compiler/testData/codegen/box/properties/kt4383.kt b/compiler/testData/codegen/box/properties/kt4383.kt index 2002a7ed776..62a11761550 100644 --- a/compiler/testData/codegen/box/properties/kt4383.kt +++ b/compiler/testData/codegen/box/properties/kt4383.kt @@ -1,5 +1,5 @@ class D { - fun get(a: Any, p: PropertyMetadata) { } + fun getValue(a: Any, p: PropertyMetadata) { } } object P { diff --git a/compiler/testData/codegen/box/properties/primitiveOverrideDelegateAccessor.kt b/compiler/testData/codegen/box/properties/primitiveOverrideDelegateAccessor.kt index 315732f3f1f..400fbaaf0ab 100644 --- a/compiler/testData/codegen/box/properties/primitiveOverrideDelegateAccessor.kt +++ b/compiler/testData/codegen/box/properties/primitiveOverrideDelegateAccessor.kt @@ -1,6 +1,6 @@ class Holder(var value: Int) { - fun get(that: Any?, desc: PropertyMetadata) = value - fun set(that: Any?, desc: PropertyMetadata, newValue: Int) { value = newValue } + fun getValue(that: Any?, desc: PropertyMetadata) = value + fun setValue(that: Any?, desc: PropertyMetadata, newValue: Int) { value = newValue } } interface R> { diff --git a/compiler/testData/codegen/box/typeMapping/kt3863.kt b/compiler/testData/codegen/box/typeMapping/kt3863.kt index bde717a6d48..b0fd8df3668 100644 --- a/compiler/testData/codegen/box/typeMapping/kt3863.kt +++ b/compiler/testData/codegen/box/typeMapping/kt3863.kt @@ -1,8 +1,8 @@ // java.lang.VerifyError: (class: NotImplemented, method: get signature: (Ljava/lang/Object;Ljet/PropertyMetadata;)Ljava/lang/Object;) Unable to pop operand off an empty stack class NotImplemented(){ - fun get(thisRef: Any?, prop: PropertyMetadata): T = notImplemented() - fun set(thisRef: Any?, prop: PropertyMetadata, value: T) = notImplemented() + fun getValue(thisRef: Any?, prop: PropertyMetadata): T = notImplemented() + fun setValue(thisRef: Any?, prop: PropertyMetadata, value: T) = notImplemented() } fun notImplemented() : Nothing = notImplemented() diff --git a/compiler/testData/codegen/box/typeMapping/kt3976.kt b/compiler/testData/codegen/box/typeMapping/kt3976.kt index d90c3595cc2..93efed7f36b 100644 --- a/compiler/testData/codegen/box/typeMapping/kt3976.kt +++ b/compiler/testData/codegen/box/typeMapping/kt3976.kt @@ -2,11 +2,11 @@ var currentAccountId: Int? by SessionAccessor() class SessionAccessor { - fun get(o : Nothing?, desc: PropertyMetadata): T { + fun getValue(o : Nothing?, desc: PropertyMetadata): T { return null as T } - fun set(o : Nothing?, desc: PropertyMetadata, value: T) { + fun setValue(o : Nothing?, desc: PropertyMetadata, value: T) { } } diff --git a/compiler/testData/codegen/boxWithStdlib/annotations/delegatedPropertySetter.kt b/compiler/testData/codegen/boxWithStdlib/annotations/delegatedPropertySetter.kt index ad90d9fad42..04bdc21495d 100644 --- a/compiler/testData/codegen/boxWithStdlib/annotations/delegatedPropertySetter.kt +++ b/compiler/testData/codegen/boxWithStdlib/annotations/delegatedPropertySetter.kt @@ -7,11 +7,11 @@ class MyClass() { } class Delegate { - fun get(t: Any?, p: PropertyMetadata): String { + fun getValue(t: Any?, p: PropertyMetadata): String { return "OK" } - fun set(t: Any?, p: PropertyMetadata, i: String) {} + fun setValue(t: Any?, p: PropertyMetadata, i: String) {} } fun box(): String { diff --git a/compiler/testData/codegen/boxWithStdlib/callableReference/property/delegated.kt b/compiler/testData/codegen/boxWithStdlib/callableReference/property/delegated.kt index 5c52e97b42a..56fac3e782b 100644 --- a/compiler/testData/codegen/boxWithStdlib/callableReference/property/delegated.kt +++ b/compiler/testData/codegen/boxWithStdlib/callableReference/property/delegated.kt @@ -5,7 +5,7 @@ class A { } object NumberDecrypter { - fun get(instance: Any?, data: PropertyMetadata) = when (data.name) { + fun getValue(instance: Any?, data: PropertyMetadata) = when (data.name) { "four" -> 4 "two" -> 2 else -> throw AssertionError() diff --git a/compiler/testData/codegen/boxWithStdlib/callableReference/property/delegatedMutable.kt b/compiler/testData/codegen/boxWithStdlib/callableReference/property/delegatedMutable.kt index e7a364cb432..d0570e84810 100644 --- a/compiler/testData/codegen/boxWithStdlib/callableReference/property/delegatedMutable.kt +++ b/compiler/testData/codegen/boxWithStdlib/callableReference/property/delegatedMutable.kt @@ -3,11 +3,11 @@ var result: String by Delegate object Delegate { var value = "lol" - fun get(instance: Any?, data: PropertyMetadata): String { + fun getValue(instance: Any?, data: PropertyMetadata): String { return value } - fun set(instance: Any?, data: PropertyMetadata, newValue: String) { + fun setValue(instance: Any?, data: PropertyMetadata, newValue: String) { value = newValue } } diff --git a/compiler/testData/codegen/boxWithStdlib/callableReference/property/genericProperty.kt b/compiler/testData/codegen/boxWithStdlib/callableReference/property/genericProperty.kt index fae016e0a82..435ae56e151 100644 --- a/compiler/testData/codegen/boxWithStdlib/callableReference/property/genericProperty.kt +++ b/compiler/testData/codegen/boxWithStdlib/callableReference/property/genericProperty.kt @@ -9,7 +9,7 @@ val Value.additionalText by DVal(Value::text) //works val Value.additionalValue by DVal(Value::value) //not work class DVal>(val kmember: P) { - fun get(t: T, p: PropertyMetadata): R { + fun getValue(t: T, p: PropertyMetadata): R { return kmember.get(t) } } diff --git a/compiler/testData/codegen/boxWithStdlib/reified/DIExample.kt b/compiler/testData/codegen/boxWithStdlib/reified/DIExample.kt index 95ad5cbad15..186bb9daea5 100644 --- a/compiler/testData/codegen/boxWithStdlib/reified/DIExample.kt +++ b/compiler/testData/codegen/boxWithStdlib/reified/DIExample.kt @@ -9,7 +9,7 @@ class Project { } } -inline fun Project.get(t: Any?, p: PropertyMetadata): T = getInstance(javaClass()) +inline fun Project.getValue(t: Any?, p: PropertyMetadata): T = getInstance(javaClass()) val project = Project() val x1: Int by project diff --git a/compiler/testData/codegen/properties/privateClassPropertyAccessors.kt b/compiler/testData/codegen/properties/privateClassPropertyAccessors.kt index 2924da71399..04a648f59bc 100644 --- a/compiler/testData/codegen/properties/privateClassPropertyAccessors.kt +++ b/compiler/testData/codegen/properties/privateClassPropertyAccessors.kt @@ -25,7 +25,7 @@ class C { object Delegate { - fun get(x: C, p: PropertyMetadata) = throw AssertionError() + fun getValue(x: C, p: PropertyMetadata) = throw AssertionError() - fun set(x: C, p: PropertyMetadata, value: Int) = throw AssertionError() + fun setValue(x: C, p: PropertyMetadata, value: Int) = throw AssertionError() } diff --git a/compiler/testData/diagnostics/tests/DeprecatedGetSetPropertyDelegateConvention.kt b/compiler/testData/diagnostics/tests/DeprecatedGetSetPropertyDelegateConvention.kt new file mode 100644 index 00000000000..2e94959306a --- /dev/null +++ b/compiler/testData/diagnostics/tests/DeprecatedGetSetPropertyDelegateConvention.kt @@ -0,0 +1,51 @@ +// !DIAGNOSTICS: -UNUSED_PARAMETER + +class CustomDelegate { + fun get(thisRef: Any?, prop: PropertyMetadata): String = prop.name + fun set(thisRef: Any?, prop: PropertyMetadata, value: String) {} +} + +class OkDelegate { + fun getValue(thisRef: Any?, prop: PropertyMetadata): String = prop.name + fun setValue(thisRef: Any?, prop: PropertyMetadata, value: String) {} +} + +class CustomDelegate2 { + fun get(thisRef: Any?, prop: PropertyMetadata): String = prop.name + fun set(thisRef: Any?, prop: PropertyMetadata, value: String) {} + + fun getValue(thisRef: Any?, prop: PropertyMetadata): Int = 5 + fun setValue(thisRef: Any?, prop: PropertyMetadata, value: Int) {} +} + +class CustomDelegate3 { + fun get(thisRef: Any?, prop: PropertyMetadata): String = prop.name + fun set(thisRef: Any?, prop: PropertyMetadata, value: String) {} +} + +fun OkDelegate.get(thisRef: Any?, prop: PropertyMetadata): Int = 4 +fun OkDelegate.set(thisRef: Any?, prop: PropertyMetadata, value: Int) {} + +fun CustomDelegate3.getValue(thisRef: Any?, prop: PropertyMetadata): Int = 4 +fun CustomDelegate3.setValue(thisRef: Any?, prop: PropertyMetadata, value: Int) {} + +class Example { + + var a by CustomDelegate() + val aval by CustomDelegate() + var b by OkDelegate() + var c by CustomDelegate2() + var d by CustomDelegate3() + + fun test() { + requireString(a) + requireString(aval) + requireString(b) + requireInt(c) + requireInt(d) + } + + fun requireString(s: String) {} + fun requireInt(n: Int) {} + +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/DeprecatedGetSetPropertyDelegateConvention.txt b/compiler/testData/diagnostics/tests/DeprecatedGetSetPropertyDelegateConvention.txt new file mode 100644 index 00000000000..42e62e920a3 --- /dev/null +++ b/compiler/testData/diagnostics/tests/DeprecatedGetSetPropertyDelegateConvention.txt @@ -0,0 +1,59 @@ +package + +public fun OkDelegate.get(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.PropertyMetadata): kotlin.Int +public fun CustomDelegate3.getValue(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.PropertyMetadata): kotlin.Int +public fun OkDelegate.set(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.PropertyMetadata, /*2*/ value: kotlin.Int): kotlin.Unit +public fun CustomDelegate3.setValue(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.PropertyMetadata, /*2*/ value: kotlin.Int): kotlin.Unit + +public final class CustomDelegate { + public constructor CustomDelegate() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public final fun get(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.PropertyMetadata): kotlin.String + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public final fun set(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.PropertyMetadata, /*2*/ value: kotlin.String): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public final class CustomDelegate2 { + public constructor CustomDelegate2() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public final fun get(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.PropertyMetadata): kotlin.String + public final fun getValue(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.PropertyMetadata): kotlin.Int + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public final fun set(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.PropertyMetadata, /*2*/ value: kotlin.String): kotlin.Unit + public final fun setValue(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.PropertyMetadata, /*2*/ value: kotlin.Int): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public final class CustomDelegate3 { + public constructor CustomDelegate3() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public final fun get(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.PropertyMetadata): kotlin.String + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public final fun set(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.PropertyMetadata, /*2*/ value: kotlin.String): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public final class Example { + public constructor Example() + public final var a: kotlin.String + public final val aval: kotlin.String + public final var b: kotlin.String + public final var c: kotlin.Int + public final var d: kotlin.Int + 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 fun requireInt(/*0*/ n: kotlin.Int): kotlin.Unit + public final fun requireString(/*0*/ s: kotlin.String): kotlin.Unit + public final fun test(): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public final class OkDelegate { + public constructor OkDelegate() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public final fun getValue(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.PropertyMetadata): kotlin.String + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public final fun setValue(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.PropertyMetadata, /*2*/ value: kotlin.String): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/testData/diagnostics/tests/LateInit.kt b/compiler/testData/diagnostics/tests/LateInit.kt index 0dfec9029dc..a2f60e45140 100644 --- a/compiler/testData/diagnostics/tests/LateInit.kt +++ b/compiler/testData/diagnostics/tests/LateInit.kt @@ -1,5 +1,5 @@ class CustomDelegate { - public fun get(thisRef: Any?, prop: PropertyMetadata): String = prop.name + public fun getValue(thisRef: Any?, prop: PropertyMetadata): String = prop.name } public abstract class A(lateinit var p2: String) { diff --git a/compiler/testData/diagnostics/tests/LateInit.txt b/compiler/testData/diagnostics/tests/LateInit.txt index b4d00b2f3f8..97a812d3de8 100644 --- a/compiler/testData/diagnostics/tests/LateInit.txt +++ b/compiler/testData/diagnostics/tests/LateInit.txt @@ -56,7 +56,7 @@ public final class B { public final class CustomDelegate { public constructor CustomDelegate() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.PropertyMetadata): kotlin.String + public final fun getValue(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.PropertyMetadata): kotlin.String public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/UnusedParameters.kt b/compiler/testData/diagnostics/tests/UnusedParameters.kt index 17e344f27d5..b031f2b2fdd 100644 --- a/compiler/testData/diagnostics/tests/UnusedParameters.kt +++ b/compiler/testData/diagnostics/tests/UnusedParameters.kt @@ -14,17 +14,17 @@ fun f(a: Int, b: Int, c: Int = b) { a + a } -fun Any.get(thisRef: Any?, prop: PropertyMetadata): String = ":)" -fun Any.set(thisRef: Any?, prop: PropertyMetadata, value: String) { +fun Any.getValue(thisRef: Any?, prop: PropertyMetadata): String = ":)" +fun Any.setValue(thisRef: Any?, prop: PropertyMetadata, value: String) { } fun Any.propertyDelegated(prop: PropertyMetadata) { } -fun get(p: Any) { +fun get(p: Any) { } -fun set(p: Any) { +fun set(p: Any) { } fun foo(s: String) { diff --git a/compiler/testData/diagnostics/tests/UnusedParameters.txt b/compiler/testData/diagnostics/tests/UnusedParameters.txt index 961ad0934d4..6df8d42e7f4 100644 --- a/compiler/testData/diagnostics/tests/UnusedParameters.txt +++ b/compiler/testData/diagnostics/tests/UnusedParameters.txt @@ -4,9 +4,9 @@ public fun f(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int, /*2*/ c: kotlin.Int = ... public fun foo(/*0*/ s: kotlin.String): kotlin.Unit public fun get(/*0*/ p: kotlin.Any): kotlin.Unit public fun set(/*0*/ p: kotlin.Any): kotlin.Unit -public fun kotlin.Any.get(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.PropertyMetadata): kotlin.String +public fun kotlin.Any.getValue(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.PropertyMetadata): kotlin.String public fun kotlin.Any.propertyDelegated(/*0*/ prop: kotlin.PropertyMetadata): kotlin.Unit -public fun kotlin.Any.set(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.PropertyMetadata, /*2*/ value: kotlin.String): kotlin.Unit +public fun kotlin.Any.setValue(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.PropertyMetadata, /*2*/ value: kotlin.String): kotlin.Unit public final class C { public constructor C(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int, /*2*/ c: kotlin.Int, /*3*/ d: kotlin.Int, /*4*/ e: kotlin.Int = ..., /*5*/ f: kotlin.String) diff --git a/compiler/testData/diagnostics/tests/Variance.kt b/compiler/testData/diagnostics/tests/Variance.kt index 69737a756f1..da27ecfa5ba 100644 --- a/compiler/testData/diagnostics/tests/Variance.kt +++ b/compiler/testData/diagnostics/tests/Variance.kt @@ -19,8 +19,8 @@ fun foo(c: Consumer, p: Producer, u: Usual) { //Arrays copy example class Array(val length : Int, val t : T) { - fun get(index : Int) : T { return t } - fun set(index : Int, value : T) { /* ... */ } + fun get(index : Int) : T { return t } + fun set(index : Int, value : T) { /* ... */ } } fun copy1(from : Array, to : Array) {} @@ -37,4 +37,4 @@ fun f(ints: Array, any: Array, numbers: Array) { copy2(ints, numbers) copy3(ints, numbers) copy4(ints, numbers) //ok -} +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/FieldAnnotations.kt b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/FieldAnnotations.kt index e7d3f63959e..fedbe43a1eb 100644 --- a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/FieldAnnotations.kt +++ b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/FieldAnnotations.kt @@ -1,7 +1,7 @@ annotation class Ann class CustomDelegate { - public fun get(thisRef: Any?, prop: PropertyMetadata): String = prop.name + public fun getValue(thisRef: Any?, prop: PropertyMetadata): String = prop.name } @field:Ann diff --git a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/FieldAnnotations.txt b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/FieldAnnotations.txt index 5341d5eb046..5cd54f4d8f5 100644 --- a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/FieldAnnotations.txt +++ b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/FieldAnnotations.txt @@ -10,7 +10,7 @@ package public final class CustomDelegate { public constructor CustomDelegate() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.PropertyMetadata): kotlin.String + public final fun getValue(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.PropertyMetadata): kotlin.String public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/GetterAnnotations.kt b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/GetterAnnotations.kt index bb788277ac5..13615356368 100644 --- a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/GetterAnnotations.kt +++ b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/GetterAnnotations.kt @@ -1,7 +1,7 @@ annotation class Ann class CustomDelegate { - public fun get(thisRef: Any?, prop: PropertyMetadata): String = prop.name + public fun getValue(thisRef: Any?, prop: PropertyMetadata): String = prop.name } @get:Ann diff --git a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/GetterAnnotations.txt b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/GetterAnnotations.txt index 0ddb889c72e..d21defd9009 100644 --- a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/GetterAnnotations.txt +++ b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/GetterAnnotations.txt @@ -10,7 +10,7 @@ package public final class CustomDelegate { public constructor CustomDelegate() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.PropertyMetadata): kotlin.String + public final fun getValue(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.PropertyMetadata): kotlin.String public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/PropertyAnnotations.kt b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/PropertyAnnotations.kt index 0192ce2215a..e5e85fcaa8d 100644 --- a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/PropertyAnnotations.kt +++ b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/PropertyAnnotations.kt @@ -2,7 +2,7 @@ annotation class Ann annotation class Second class CustomDelegate { - public fun get(thisRef: Any?, prop: PropertyMetadata): String = prop.name + public fun getValue(thisRef: Any?, prop: PropertyMetadata): String = prop.name } @property:Ann diff --git a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/PropertyAnnotations.txt b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/PropertyAnnotations.txt index eeb49ea3b75..507ca881931 100644 --- a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/PropertyAnnotations.txt +++ b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/PropertyAnnotations.txt @@ -10,7 +10,7 @@ package public final class CustomDelegate { public constructor CustomDelegate() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.PropertyMetadata): kotlin.String + public final fun getValue(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.PropertyMetadata): kotlin.String public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/SetterAnnotations.kt b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/SetterAnnotations.kt index 637f82e7a88..23c9903091f 100644 --- a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/SetterAnnotations.kt +++ b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/SetterAnnotations.kt @@ -1,8 +1,8 @@ annotation class Ann class CustomDelegate { - public fun get(thisRef: Any?, prop: PropertyMetadata): String = prop.name - fun set(thisRef: Any?, prop: PropertyMetadata, value: String) {} + public fun getValue(thisRef: Any?, prop: PropertyMetadata): String = prop.name + fun setValue(thisRef: Any?, prop: PropertyMetadata, value: String) {} } @set:Ann diff --git a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/SetterAnnotations.txt b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/SetterAnnotations.txt index c85af096596..6ec39ff5b77 100644 --- a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/SetterAnnotations.txt +++ b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/SetterAnnotations.txt @@ -10,9 +10,9 @@ package public final class CustomDelegate { public constructor CustomDelegate() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.PropertyMetadata): kotlin.String + public final fun getValue(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.PropertyMetadata): kotlin.String public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun set(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.PropertyMetadata, /*2*/ value: kotlin.String): kotlin.Unit + public final fun setValue(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.PropertyMetadata, /*2*/ value: kotlin.String): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/SparamAnnotations.kt b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/SparamAnnotations.kt index f05884c458e..48fb508b786 100644 --- a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/SparamAnnotations.kt +++ b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/SparamAnnotations.kt @@ -1,8 +1,8 @@ annotation class Ann class CustomDelegate { - public fun get(thisRef: Any?, prop: PropertyMetadata): String = prop.name - fun set(thisRef: Any?, prop: PropertyMetadata, value: String) {} + public fun getValue(thisRef: Any?, prop: PropertyMetadata): String = prop.name + fun setValue(thisRef: Any?, prop: PropertyMetadata, value: String) {} } @setparam:Ann diff --git a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/SparamAnnotations.txt b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/SparamAnnotations.txt index ace6401319a..781f288b8c8 100644 --- a/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/SparamAnnotations.txt +++ b/compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/SparamAnnotations.txt @@ -10,9 +10,9 @@ package public final class CustomDelegate { public constructor CustomDelegate() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.PropertyMetadata): kotlin.String + public final fun getValue(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.PropertyMetadata): kotlin.String public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun set(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.PropertyMetadata, /*2*/ value: kotlin.String): kotlin.Unit + public final fun setValue(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.PropertyMetadata, /*2*/ value: kotlin.String): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/dataFlow/local/LocalClassDelegatedProperties.kt b/compiler/testData/diagnostics/tests/dataFlow/local/LocalClassDelegatedProperties.kt index beb9fa4cd98..1e8ec539c35 100644 --- a/compiler/testData/diagnostics/tests/dataFlow/local/LocalClassDelegatedProperties.kt +++ b/compiler/testData/diagnostics/tests/dataFlow/local/LocalClassDelegatedProperties.kt @@ -1,5 +1,5 @@ class Del { - fun get(_this: Any?, p: PropertyMetadata): Int = 0 + fun getValue(_this: Any?, p: PropertyMetadata): Int = 0 } fun df(del: Del): Del = del diff --git a/compiler/testData/diagnostics/tests/dataFlow/local/LocalClassDelegatedProperties.txt b/compiler/testData/diagnostics/tests/dataFlow/local/LocalClassDelegatedProperties.txt index 2ac3e4914cb..1418464deef 100644 --- a/compiler/testData/diagnostics/tests/dataFlow/local/LocalClassDelegatedProperties.txt +++ b/compiler/testData/diagnostics/tests/dataFlow/local/LocalClassDelegatedProperties.txt @@ -6,7 +6,7 @@ public fun test(/*0*/ del: kotlin.Any?): kotlin.Unit public final class Del { public constructor Del() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ _this: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int + public final fun getValue(/*0*/ _this: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/absentErrorAboutInitializer.kt b/compiler/testData/diagnostics/tests/delegatedProperty/absentErrorAboutInitializer.kt index d56d33c1af0..4d656eeb425 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/absentErrorAboutInitializer.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/absentErrorAboutInitializer.kt @@ -3,7 +3,7 @@ val a: Int by Delegate() class Delegate { - fun get(t: Any?, p: PropertyMetadata): Int { + fun getValue(t: Any?, p: PropertyMetadata): Int { return 1 } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/absentErrorAboutInitializer.txt b/compiler/testData/diagnostics/tests/delegatedProperty/absentErrorAboutInitializer.txt index eaeab9e6048..bb49ab03638 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/absentErrorAboutInitializer.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/absentErrorAboutInitializer.txt @@ -5,7 +5,7 @@ public val a: kotlin.Int public final class Delegate { public constructor Delegate() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int + public final fun getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/absentErrorAboutType.kt b/compiler/testData/diagnostics/tests/delegatedProperty/absentErrorAboutType.kt index 760ab8e50fd..e336ead00b4 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/absentErrorAboutType.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/absentErrorAboutType.kt @@ -3,7 +3,7 @@ val a by Delegate() class Delegate { - fun get(t: Any?, p: PropertyMetadata): Int { + fun getValue(t: Any?, p: PropertyMetadata): Int { return 1 } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/absentErrorAboutType.txt b/compiler/testData/diagnostics/tests/delegatedProperty/absentErrorAboutType.txt index eaeab9e6048..bb49ab03638 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/absentErrorAboutType.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/absentErrorAboutType.txt @@ -5,7 +5,7 @@ public val a: kotlin.Int public final class Delegate { public constructor Delegate() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int + public final fun getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/abstractDelegatedProperty.kt b/compiler/testData/diagnostics/tests/delegatedProperty/abstractDelegatedProperty.kt index 0a1ca6f1e35..67712e45d1a 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/abstractDelegatedProperty.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/abstractDelegatedProperty.kt @@ -5,7 +5,7 @@ abstract class A { } class Delegate { - fun get(t: Any?, p: PropertyMetadata): Int { + fun getValue(t: Any?, p: PropertyMetadata): Int { return 1 } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/abstractDelegatedProperty.txt b/compiler/testData/diagnostics/tests/delegatedProperty/abstractDelegatedProperty.txt index f503aa310ca..5e1a3ad8855 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/abstractDelegatedProperty.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/abstractDelegatedProperty.txt @@ -11,7 +11,7 @@ public abstract class A { public final class Delegate { public constructor Delegate() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int + public final fun getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/backingField.kt b/compiler/testData/diagnostics/tests/delegatedProperty/backingField.kt index e0cec2e9e6a..22af3183d93 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/backingField.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/backingField.kt @@ -7,7 +7,7 @@ class B { } class Delegate { - fun get(t: Any?, p: PropertyMetadata): Int { + fun getValue(t: Any?, p: PropertyMetadata): Int { return 1 } } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/backingField.txt b/compiler/testData/diagnostics/tests/delegatedProperty/backingField.txt index 1af41ba67cc..6a6ebf4d884 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/backingField.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/backingField.txt @@ -12,7 +12,7 @@ public final class B { public final class Delegate { public constructor Delegate() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int + public final fun getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/defaultGetter.kt b/compiler/testData/diagnostics/tests/delegatedProperty/defaultGetter.kt index 3b172935461..51e35629507 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/defaultGetter.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/defaultGetter.kt @@ -4,7 +4,7 @@ val a: Int by Delegate() get class Delegate { - fun get(t: Any?, p: PropertyMetadata): Int { + fun getValue(t: Any?, p: PropertyMetadata): Int { return 1 } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/defaultGetter.txt b/compiler/testData/diagnostics/tests/delegatedProperty/defaultGetter.txt index eaeab9e6048..bb49ab03638 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/defaultGetter.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/defaultGetter.txt @@ -5,7 +5,7 @@ public val a: kotlin.Int public final class Delegate { public constructor Delegate() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int + public final fun getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/defaultSetter.kt b/compiler/testData/diagnostics/tests/delegatedProperty/defaultSetter.kt index 727cb6013b3..ba2a0eb958d 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/defaultSetter.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/defaultSetter.kt @@ -4,9 +4,9 @@ var a: Int by Delegate() private set class Delegate { - fun get(t: Any?, p: PropertyMetadata): Int { + fun getValue(t: Any?, p: PropertyMetadata): Int { return 1 } - fun set(t: Any?, p: PropertyMetadata, i: Int) {} + fun setValue(t: Any?, p: PropertyMetadata, i: Int) {} } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/defaultSetter.txt b/compiler/testData/diagnostics/tests/delegatedProperty/defaultSetter.txt index 13bdf8a84fa..3cc7f53f52d 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/defaultSetter.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/defaultSetter.txt @@ -5,8 +5,8 @@ public var a: kotlin.Int public final class Delegate { public constructor Delegate() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int + public final fun getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun set(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata, /*2*/ i: kotlin.Int): kotlin.Unit + public final fun setValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata, /*2*/ i: kotlin.Int): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/delegatedPropertyOverridedInTrait.kt b/compiler/testData/diagnostics/tests/delegatedProperty/delegatedPropertyOverridedInTrait.kt index 0560f15cf9d..2fdda6e420a 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/delegatedPropertyOverridedInTrait.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/delegatedPropertyOverridedInTrait.kt @@ -13,7 +13,7 @@ fun foo() { } class Delegate { - fun get(t: Any?, p: PropertyMetadata): Int { + fun getValue(t: Any?, p: PropertyMetadata): Int { return 1 } } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/delegatedPropertyOverridedInTrait.txt b/compiler/testData/diagnostics/tests/delegatedProperty/delegatedPropertyOverridedInTrait.txt index 664d2fe9674..ba93f4735a5 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/delegatedPropertyOverridedInTrait.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/delegatedPropertyOverridedInTrait.txt @@ -20,7 +20,7 @@ public final class AImpl : A { public final class Delegate { public constructor Delegate() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int + public final fun getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/delegatedPropertyOverridedInTraitTypeMismatch.kt b/compiler/testData/diagnostics/tests/delegatedProperty/delegatedPropertyOverridedInTraitTypeMismatch.kt index ca7cb09ce06..22c8d14fffe 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/delegatedPropertyOverridedInTraitTypeMismatch.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/delegatedPropertyOverridedInTraitTypeMismatch.kt @@ -13,7 +13,7 @@ fun foo() { } class Delegate { - fun get(t: Any?, p: PropertyMetadata): String { + fun getValue(t: Any?, p: PropertyMetadata): String { return "" } } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/delegatedPropertyOverridedInTraitTypeMismatch.txt b/compiler/testData/diagnostics/tests/delegatedProperty/delegatedPropertyOverridedInTraitTypeMismatch.txt index 3bab4fa133e..397ffa6eac2 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/delegatedPropertyOverridedInTraitTypeMismatch.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/delegatedPropertyOverridedInTraitTypeMismatch.txt @@ -20,7 +20,7 @@ public final class AImpl : A { public final class Delegate { public constructor Delegate() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.String + public final fun getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.String public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/disallowImplInTypeParameter.kt b/compiler/testData/diagnostics/tests/delegatedProperty/disallowImplInTypeParameter.kt index fefb3a6209d..499628b927c 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/disallowImplInTypeParameter.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/disallowImplInTypeParameter.kt @@ -1,5 +1,5 @@ val a: Int by A() class A { - fun get(t: Any?, p: PropertyMetadataImpl): Int = 1 + fun getValue(t: Any?, p: PropertyMetadataImpl): Int = 1 } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/disallowImplInTypeParameter.txt b/compiler/testData/diagnostics/tests/delegatedProperty/disallowImplInTypeParameter.txt index 53f66317ca2..5fdde7c3a03 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/disallowImplInTypeParameter.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/disallowImplInTypeParameter.txt @@ -5,7 +5,7 @@ public val a: kotlin.Int public final class A { public constructor A() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadataImpl): kotlin.Int + public final fun getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadataImpl): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/genericGetter.kt b/compiler/testData/diagnostics/tests/delegatedProperty/genericGetter.kt index 7ee6c7dc4de..9b264fdb878 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/genericGetter.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/genericGetter.kt @@ -3,7 +3,7 @@ val a: Int by A(1) class A(i: T) { - fun get(t: Any?, p: PropertyMetadata): T { + fun getValue(t: Any?, p: PropertyMetadata): T { throw Exception() } } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/genericGetter.txt b/compiler/testData/diagnostics/tests/delegatedProperty/genericGetter.txt index 7c977191d84..a06f9d88944 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/genericGetter.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/genericGetter.txt @@ -5,7 +5,7 @@ public val a: kotlin.Int public final class A { public constructor A(/*0*/ i: T) public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): T + public final fun getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): T public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/getterWithSubtype.kt b/compiler/testData/diagnostics/tests/delegatedProperty/getterWithSubtype.kt index 756889d733a..661b9a7379c 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/getterWithSubtype.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/getterWithSubtype.kt @@ -6,7 +6,7 @@ class Derived: Base() val a: Base by A() class A { - fun get(t: Any?, p: PropertyMetadata): Derived { + fun getValue(t: Any?, p: PropertyMetadata): Derived { return Derived() } } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/getterWithSubtype.txt b/compiler/testData/diagnostics/tests/delegatedProperty/getterWithSubtype.txt index a186bd45d21..b1cada7be41 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/getterWithSubtype.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/getterWithSubtype.txt @@ -5,7 +5,7 @@ public val a: Base public final class A { public constructor A() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): Derived + public final fun getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): Derived public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inTrait.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inTrait.kt index eef69f71f7b..6f17f79263b 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inTrait.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inTrait.kt @@ -5,7 +5,7 @@ interface T { } class Delegate { - fun get(t: Any?, p: PropertyMetadata): Int { + fun getValue(t: Any?, p: PropertyMetadata): Int { return 1 } } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inTrait.txt b/compiler/testData/diagnostics/tests/delegatedProperty/inTrait.txt index 0a7cfa28a6e..796fe7a7ab5 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inTrait.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inTrait.txt @@ -3,7 +3,7 @@ package public final class Delegate { public constructor Delegate() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int + public final fun getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/differentDelegatedExpressions.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/differentDelegatedExpressions.kt index fdc281eea1b..17c78cadb23 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/differentDelegatedExpressions.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/differentDelegatedExpressions.kt @@ -21,12 +21,12 @@ fun getMyConcreteProperty() = MyProperty() class MyProperty { - public fun get(thisRef: R, desc: PropertyMetadata): T { + public fun getValue(thisRef: R, desc: PropertyMetadata): T { println("get $thisRef ${desc.name}") return null as T } - public fun set(thisRef: R, desc: PropertyMetadata, value: T) { + public fun setValue(thisRef: R, desc: PropertyMetadata, value: T) { println("set $thisRef ${desc.name} $value") } } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/differentDelegatedExpressions.txt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/differentDelegatedExpressions.txt index 62427ced9b4..b2180c535cb 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/differentDelegatedExpressions.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/differentDelegatedExpressions.txt @@ -26,9 +26,9 @@ package baz { public final class MyProperty { public constructor MyProperty() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ thisRef: R, /*1*/ desc: kotlin.PropertyMetadata): T + public final fun getValue(/*0*/ thisRef: R, /*1*/ desc: kotlin.PropertyMetadata): T public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun set(/*0*/ thisRef: R, /*1*/ desc: kotlin.PropertyMetadata, /*2*/ value: T): kotlin.Unit + public final fun setValue(/*0*/ thisRef: R, /*1*/ desc: kotlin.PropertyMetadata, /*2*/ value: T): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/extensionGet.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/extensionGet.kt index 835be3527de..0031f7ddb13 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/extensionGet.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/extensionGet.kt @@ -5,7 +5,7 @@ class A1 { } class MyProperty1 {} -fun MyProperty1.get(thisRef: Any?, desc: PropertyMetadata): String { +fun MyProperty1.getValue(thisRef: Any?, desc: PropertyMetadata): String { throw Exception("$thisRef $desc") } @@ -16,7 +16,7 @@ class A2 { } class MyProperty2 {} -fun MyProperty2.get(thisRef: Any?, desc: PropertyMetadata): T { +fun MyProperty2.getValue(thisRef: Any?, desc: PropertyMetadata): T { throw Exception("$thisRef $desc") } @@ -27,7 +27,7 @@ class A3 { class MyProperty3 {} - fun MyProperty3.get(thisRef: Any?, desc: PropertyMetadata): T { + fun MyProperty3.getValue(thisRef: Any?, desc: PropertyMetadata): T { throw Exception("$thisRef $desc") } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/extensionGet.txt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/extensionGet.txt index 2a12f6edc86..ea94f785dc2 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/extensionGet.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/extensionGet.txt @@ -1,8 +1,8 @@ package package foo { - public fun foo.MyProperty1.get(/*0*/ thisRef: kotlin.Any?, /*1*/ desc: kotlin.PropertyMetadata): kotlin.String - public fun foo.MyProperty2.get(/*0*/ thisRef: kotlin.Any?, /*1*/ desc: kotlin.PropertyMetadata): T + public fun foo.MyProperty1.getValue(/*0*/ thisRef: kotlin.Any?, /*1*/ desc: kotlin.PropertyMetadata): kotlin.String + public fun foo.MyProperty2.getValue(/*0*/ thisRef: kotlin.Any?, /*1*/ desc: kotlin.PropertyMetadata): T public final class A1 { public constructor A1() @@ -26,7 +26,7 @@ package foo { 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 fun foo.A3.MyProperty3.get(/*0*/ thisRef: kotlin.Any?, /*1*/ desc: kotlin.PropertyMetadata): T + public final fun foo.A3.MyProperty3.getValue(/*0*/ thisRef: kotlin.Any?, /*1*/ desc: kotlin.PropertyMetadata): T public final class MyProperty3 { public constructor MyProperty3() diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/extensionProperty.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/extensionProperty.kt index ad3d058475b..8ed85b28049 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/extensionProperty.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/extensionProperty.kt @@ -13,7 +13,7 @@ class B { } class MyProperty { - public fun get(thisRef: R, desc: PropertyMetadata): T { + public fun getValue(thisRef: R, desc: PropertyMetadata): T { throw Exception("$thisRef $desc") } } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/extensionProperty.txt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/extensionProperty.txt index 381fe585432..50efc83ce87 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/extensionProperty.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/extensionProperty.txt @@ -23,7 +23,7 @@ package foo { public final class MyProperty { public constructor MyProperty() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ thisRef: R, /*1*/ desc: kotlin.PropertyMetadata): T + public final fun getValue(/*0*/ thisRef: R, /*1*/ desc: kotlin.PropertyMetadata): T public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethodInGenericClass.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethodInGenericClass.kt index 6a1de8d4a40..14dc7ece411 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethodInGenericClass.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethodInGenericClass.kt @@ -1,24 +1,24 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER class A() { - fun get(t: Any?, p: PropertyMetadata): T = null!! - fun set(t: Any?, p: PropertyMetadata, x: T) = Unit + fun getValue(t: Any?, p: PropertyMetadata): T = null!! + fun setValue(t: Any?, p: PropertyMetadata, x: T) = Unit } var a1: Int by A() var a2: Int by A() class B() { - fun get(t: Any?, p: PropertyMetadata): T = null!! - fun set(t: Any?, p: PropertyMetadata, x: R) = Unit + fun getValue(t: Any?, p: PropertyMetadata): T = null!! + fun setValue(t: Any?, p: PropertyMetadata, x: R) = Unit } var b1: Int by B() var b2: Int by B() class C() { - fun get(t: Any?, p: PropertyMetadata): R = null!! - fun set(t: Any?, p: PropertyMetadata, x: T) = Unit + fun getValue(t: Any?, p: PropertyMetadata): R = null!! + fun setValue(t: Any?, p: PropertyMetadata, x: T) = Unit } var c1: Int by C() diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethodInGenericClass.txt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethodInGenericClass.txt index 313acdda0a5..ae3eac0c521 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethodInGenericClass.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethodInGenericClass.txt @@ -10,26 +10,26 @@ public var c2: kotlin.Int public final class A { public constructor A() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): T + public final fun getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): T public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun set(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata, /*2*/ x: T): kotlin.Unit + public final fun setValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata, /*2*/ x: T): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } public final class B { public constructor B() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): T + public final fun getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): T public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun set(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata, /*2*/ x: R): kotlin.Unit + public final fun setValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata, /*2*/ x: R): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } public final class C { public constructor C() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): R + public final fun getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): R public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun set(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata, /*2*/ x: T): kotlin.Unit + public final fun setValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata, /*2*/ x: T): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethods.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethods.kt index e8230477cec..7bf4f8b0812 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethods.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethods.kt @@ -8,16 +8,16 @@ val cObj = C() var c: String by cObj class A { - fun get(t: Any?, p: PropertyMetadata): T = null!! - fun set(t: Any?, p: PropertyMetadata, x: T) = Unit + fun getValue(t: Any?, p: PropertyMetadata): T = null!! + fun setValue(t: Any?, p: PropertyMetadata, x: T) = Unit } class B -fun B.get(t: Any?, p: PropertyMetadata): T = null!! -fun B.set(t: Any?, p: PropertyMetadata, x: T) = Unit +fun B.getValue(t: Any?, p: PropertyMetadata): T = null!! +fun B.setValue(t: Any?, p: PropertyMetadata, x: T) = Unit class C -inline fun C.get(t: Any?, p: PropertyMetadata): T = null!! -inline fun C.set(t: Any?, p: PropertyMetadata, x: T) = Unit +inline fun C.getValue(t: Any?, p: PropertyMetadata): T = null!! +inline fun C.setValue(t: Any?, p: PropertyMetadata, x: T) = Unit diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethods.txt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethods.txt index 90743605c81..62afbd71568 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethods.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethods.txt @@ -5,17 +5,17 @@ public var a1: [ERROR : Type from delegate] public var b: kotlin.Int public var c: kotlin.String public val cObj: C -public fun B.get(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): T -@kotlin.inline() public fun C.get(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): T -public fun B.set(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata, /*2*/ x: T): kotlin.Unit -@kotlin.inline() public fun C.set(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata, /*2*/ x: T): kotlin.Unit +public fun B.getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): T +@kotlin.inline() public fun C.getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): T +public fun B.setValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata, /*2*/ x: T): kotlin.Unit +@kotlin.inline() public fun C.setValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata, /*2*/ x: T): kotlin.Unit public final class A { public constructor A() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): T + public final fun getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): T public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun set(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata, /*2*/ x: T): kotlin.Unit + public final fun setValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata, /*2*/ x: T): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/labeledDelegatedExpression.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/labeledDelegatedExpression.kt index 698667649c3..d53ad723679 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/labeledDelegatedExpression.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/labeledDelegatedExpression.kt @@ -3,7 +3,7 @@ class A3 { class MyProperty {} - fun MyProperty.get(thisRef: Any?, desc: PropertyMetadata): T { + fun MyProperty.getValue(thisRef: Any?, desc: PropertyMetadata): T { throw Exception("$thisRef $desc") } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/labeledDelegatedExpression.txt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/labeledDelegatedExpression.txt index eb51bec21e3..4af5ac0d5f4 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/labeledDelegatedExpression.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/labeledDelegatedExpression.txt @@ -6,7 +6,7 @@ public final class A3 { 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 fun A3.MyProperty.get(/*0*/ thisRef: kotlin.Any?, /*1*/ desc: kotlin.PropertyMetadata): T + public final fun A3.MyProperty.getValue(/*0*/ thisRef: kotlin.Any?, /*1*/ desc: kotlin.PropertyMetadata): T public final class MyProperty { public constructor MyProperty() diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/noErrorsForImplicitConstraints.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/noErrorsForImplicitConstraints.kt index 0903f4262eb..4a7dd85c6cf 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/noErrorsForImplicitConstraints.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/noErrorsForImplicitConstraints.kt @@ -9,11 +9,11 @@ fun getMyProperty1() = MyProperty1() class MyProperty1 { - public fun get(thisRef: R, desc: PropertyMetadata): T { + public fun getValue(thisRef: R, desc: PropertyMetadata): T { throw Exception() } - public fun set(i: Int, j: Int, k: Int) { + public fun setValue(i: Int, j: Int, k: Int) { println("set") } } @@ -29,11 +29,11 @@ fun getMyProperty2() = MyProperty2() class MyProperty2 { - public fun get(thisRef: R, desc: PropertyMetadata): T { + public fun getValue(thisRef: R, desc: PropertyMetadata): T { throw Exception() } - public fun set(i: Int) { + public fun setValue(i: Int) { println("set") } } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/noErrorsForImplicitConstraints.txt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/noErrorsForImplicitConstraints.txt index ac4746ee7ff..fa2c11bf1e1 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/noErrorsForImplicitConstraints.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/noErrorsForImplicitConstraints.txt @@ -26,18 +26,18 @@ package foo { public final class MyProperty1 { public constructor MyProperty1() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ thisRef: R, /*1*/ desc: kotlin.PropertyMetadata): T + public final fun getValue(/*0*/ thisRef: R, /*1*/ desc: kotlin.PropertyMetadata): T public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun set(/*0*/ i: kotlin.Int, /*1*/ j: kotlin.Int, /*2*/ k: kotlin.Int): kotlin.Unit + public final fun setValue(/*0*/ i: kotlin.Int, /*1*/ j: kotlin.Int, /*2*/ k: kotlin.Int): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } public final class MyProperty2 { public constructor MyProperty2() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ thisRef: R, /*1*/ desc: kotlin.PropertyMetadata): T + public final fun getValue(/*0*/ thisRef: R, /*1*/ desc: kotlin.PropertyMetadata): T public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun set(/*0*/ i: kotlin.Int): kotlin.Unit + public final fun setValue(/*0*/ i: kotlin.Int): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/noExpectedTypeForSupertypeConstraint.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/noExpectedTypeForSupertypeConstraint.kt index ef49de08bae..45f7fe4747e 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/noExpectedTypeForSupertypeConstraint.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/noExpectedTypeForSupertypeConstraint.kt @@ -4,11 +4,11 @@ class A { class MyProperty { - public fun get(thisRef: R, desc: PropertyMetadata): T { + public fun getValue(thisRef: R, desc: PropertyMetadata): T { throw Exception("$thisRef $desc") } - public fun set(thisRef: R, desc: PropertyMetadata, t: T) { + public fun setValue(thisRef: R, desc: PropertyMetadata, t: T) { throw Exception("$thisRef $desc $t") } } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/noExpectedTypeForSupertypeConstraint.txt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/noExpectedTypeForSupertypeConstraint.txt index bd66ed4f680..b6747adeeed 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/noExpectedTypeForSupertypeConstraint.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/noExpectedTypeForSupertypeConstraint.txt @@ -11,8 +11,8 @@ public final class A { public final class MyProperty { public constructor MyProperty() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ thisRef: R, /*1*/ desc: kotlin.PropertyMetadata): T + public final fun getValue(/*0*/ thisRef: R, /*1*/ desc: kotlin.PropertyMetadata): T public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun set(/*0*/ thisRef: R, /*1*/ desc: kotlin.PropertyMetadata, /*2*/ t: T): kotlin.Unit + public final fun setValue(/*0*/ thisRef: R, /*1*/ desc: kotlin.PropertyMetadata, /*2*/ t: T): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/useCompleterWithoutExpectedType.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/useCompleterWithoutExpectedType.kt index b5d3ad8167b..a3ba12e19e4 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/useCompleterWithoutExpectedType.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/useCompleterWithoutExpectedType.kt @@ -9,5 +9,5 @@ class A { } class MyProperty { - public fun get(thisRef: R, desc: PropertyMetadata): Int = throw Exception("$thisRef $desc") + public fun getValue(thisRef: R, desc: PropertyMetadata): Int = throw Exception("$thisRef $desc") } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/useCompleterWithoutExpectedType.txt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/useCompleterWithoutExpectedType.txt index 823003b6923..9e8c8249e7a 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/useCompleterWithoutExpectedType.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/useCompleterWithoutExpectedType.txt @@ -12,7 +12,7 @@ public final class A { public final class MyProperty { public constructor MyProperty() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ thisRef: R, /*1*/ desc: kotlin.PropertyMetadata): kotlin.Int + public final fun getValue(/*0*/ thisRef: R, /*1*/ desc: kotlin.PropertyMetadata): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/useExpectedType.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/useExpectedType.kt index 133edc32f94..03949c69a5d 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/useExpectedType.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/useExpectedType.kt @@ -12,12 +12,12 @@ fun getMyProperty1() = MyProperty1() class MyProperty1 { - public fun get(thisRef: R, desc: PropertyMetadata): T { + public fun getValue(thisRef: R, desc: PropertyMetadata): T { println("get $thisRef ${desc.name}") throw Exception() } - public fun set(thisRef: R, desc: PropertyMetadata, value: T) { + public fun setValue(thisRef: R, desc: PropertyMetadata, value: T) { println("set $thisRef ${desc.name} $value") } } @@ -36,12 +36,12 @@ fun getMyProperty2() = MyProperty2() class MyProperty2 { - public fun get(thisRef: Any?, desc: PropertyMetadata): T { + public fun getValue(thisRef: Any?, desc: PropertyMetadata): T { println("get $thisRef ${desc.name}") throw Exception() } - public fun set(thisRef: Any?, desc: PropertyMetadata, value: T) { + public fun setValue(thisRef: Any?, desc: PropertyMetadata, value: T) { println("set $thisRef ${desc.name} $value") } } @@ -60,12 +60,12 @@ fun getMyProperty3() = MyProperty3() class MyProperty3 { - public fun get(thisRef: T, desc: PropertyMetadata): String { + public fun getValue(thisRef: T, desc: PropertyMetadata): String { println("get $thisRef ${desc.name}") return "" } - public fun set(thisRef: Any?, desc: PropertyMetadata, value: T) { + public fun setValue(thisRef: Any?, desc: PropertyMetadata, value: T) { println("set $thisRef ${desc.name} $value") } } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/useExpectedType.txt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/useExpectedType.txt index ea13eb721f4..cea46bc9ab4 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/useExpectedType.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/useExpectedType.txt @@ -42,27 +42,27 @@ package foo { public final class MyProperty1 { public constructor MyProperty1() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ thisRef: R, /*1*/ desc: kotlin.PropertyMetadata): T + public final fun getValue(/*0*/ thisRef: R, /*1*/ desc: kotlin.PropertyMetadata): T public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun set(/*0*/ thisRef: R, /*1*/ desc: kotlin.PropertyMetadata, /*2*/ value: T): kotlin.Unit + public final fun setValue(/*0*/ thisRef: R, /*1*/ desc: kotlin.PropertyMetadata, /*2*/ value: T): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } public final class MyProperty2 { public constructor MyProperty2() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ thisRef: kotlin.Any?, /*1*/ desc: kotlin.PropertyMetadata): T + public final fun getValue(/*0*/ thisRef: kotlin.Any?, /*1*/ desc: kotlin.PropertyMetadata): T public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun set(/*0*/ thisRef: kotlin.Any?, /*1*/ desc: kotlin.PropertyMetadata, /*2*/ value: T): kotlin.Unit + public final fun setValue(/*0*/ thisRef: kotlin.Any?, /*1*/ desc: kotlin.PropertyMetadata, /*2*/ value: T): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } public final class MyProperty3 { public constructor MyProperty3() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ thisRef: T, /*1*/ desc: kotlin.PropertyMetadata): kotlin.String + public final fun getValue(/*0*/ thisRef: T, /*1*/ desc: kotlin.PropertyMetadata): kotlin.String public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun set(/*0*/ thisRef: kotlin.Any?, /*1*/ desc: kotlin.PropertyMetadata, /*2*/ value: T): kotlin.Unit + public final fun setValue(/*0*/ thisRef: kotlin.Any?, /*1*/ desc: kotlin.PropertyMetadata, /*2*/ value: T): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/useExpectedTypeForVal.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/useExpectedTypeForVal.kt index ec727cdaa92..3c5f688f9ec 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/useExpectedTypeForVal.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/useExpectedTypeForVal.kt @@ -12,7 +12,7 @@ fun getMyProperty1() = MyProperty1() class MyProperty1 { - public fun get(thisRef: R, desc: PropertyMetadata): T { + public fun getValue(thisRef: R, desc: PropertyMetadata): T { println("get $thisRef ${desc.name}") throw Exception() } @@ -32,7 +32,7 @@ fun getMyProperty2() = MyProperty2() class MyProperty2 { - public fun get(thisRef: Any?, desc: PropertyMetadata): T { + public fun getValue(thisRef: Any?, desc: PropertyMetadata): T { println("get $thisRef ${desc.name}") throw Exception() } @@ -52,7 +52,7 @@ fun getMyProperty3() = MyProperty3() class MyProperty3 { - public fun get(thisRef: T, desc: PropertyMetadata): String { + public fun getValue(thisRef: T, desc: PropertyMetadata): String { println("get $thisRef ${desc.name}") return "" } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/useExpectedTypeForVal.txt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/useExpectedTypeForVal.txt index 3f2d5462022..7be9c542da3 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/useExpectedTypeForVal.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/useExpectedTypeForVal.txt @@ -42,7 +42,7 @@ package foo { public final class MyProperty1 { public constructor MyProperty1() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ thisRef: R, /*1*/ desc: kotlin.PropertyMetadata): T + public final fun getValue(/*0*/ thisRef: R, /*1*/ desc: kotlin.PropertyMetadata): T public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } @@ -50,7 +50,7 @@ package foo { public final class MyProperty2 { public constructor MyProperty2() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ thisRef: kotlin.Any?, /*1*/ desc: kotlin.PropertyMetadata): T + public final fun getValue(/*0*/ thisRef: kotlin.Any?, /*1*/ desc: kotlin.PropertyMetadata): T public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } @@ -58,7 +58,7 @@ package foo { public final class MyProperty3 { public constructor MyProperty3() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ thisRef: T, /*1*/ desc: kotlin.PropertyMetadata): kotlin.String + public final fun getValue(/*0*/ thisRef: T, /*1*/ desc: kotlin.PropertyMetadata): kotlin.String public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/kt4640.kt b/compiler/testData/diagnostics/tests/delegatedProperty/kt4640.kt index c6e337e3212..d9f51272123 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/kt4640.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/kt4640.kt @@ -2,10 +2,10 @@ class ValueWrapper() { - var value: Int = 0 + var backingValue: Int = 0 - fun get() = value - fun set(v: Int) { value = v } + fun getValue() = backingValue + fun setValue(v: Int) { backingValue = v } } val foo by ValueWrapper() diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/kt4640.txt b/compiler/testData/diagnostics/tests/delegatedProperty/kt4640.txt index 39633d53d34..441639b76e8 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/kt4640.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/kt4640.txt @@ -4,10 +4,10 @@ public val foo: [ERROR : Type from delegate] public final class ValueWrapper { public constructor ValueWrapper() - public final var value: kotlin.Int + public final var backingValue: kotlin.Int public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(): kotlin.Int + public final fun getValue(): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun set(/*0*/ v: kotlin.Int): kotlin.Unit + public final fun setValue(/*0*/ v: kotlin.Int): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/localVariable.kt b/compiler/testData/diagnostics/tests/delegatedProperty/localVariable.kt index 7352e77f641..6d3b666be44 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/localVariable.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/localVariable.kt @@ -7,7 +7,7 @@ class Local { } class Delegate { - fun get(t: Any?, p: PropertyMetadata): Int { + fun getValue(t: Any?, p: PropertyMetadata): Int { return 1 } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/localVariable.txt b/compiler/testData/diagnostics/tests/delegatedProperty/localVariable.txt index 63191af6322..0f41079c789 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/localVariable.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/localVariable.txt @@ -3,7 +3,7 @@ package public final class Delegate { public constructor Delegate() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int + public final fun getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/missedGetter.kt b/compiler/testData/diagnostics/tests/delegatedProperty/missedGetter.kt index 91cccacc9f6..8636cf66c57 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/missedGetter.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/missedGetter.kt @@ -1,3 +1,3 @@ -val a: Int by A() +val a: Int by A() class A diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/missedSetter.kt b/compiler/testData/diagnostics/tests/delegatedProperty/missedSetter.kt index a88d4caddeb..4d61bb40303 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/missedSetter.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/missedSetter.kt @@ -1,9 +1,9 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -var a: Int by A() +var a: Int by A() class A { - fun get(t: Any?, p: PropertyMetadata): Int { + fun getValue(t: Any?, p: PropertyMetadata): Int { return 1 } } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/missedSetter.txt b/compiler/testData/diagnostics/tests/delegatedProperty/missedSetter.txt index f10cd278a1b..80dcaaf3e28 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/missedSetter.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/missedSetter.txt @@ -5,7 +5,7 @@ public var a: kotlin.Int public final class A { public constructor A() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int + public final fun getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/propertyDefferedType.kt b/compiler/testData/diagnostics/tests/delegatedProperty/propertyDefferedType.kt index 088955a611d..fbee36c03cb 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/propertyDefferedType.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/propertyDefferedType.kt @@ -5,5 +5,5 @@ class B { } class Delegate(val init: T) { - fun get(t: Any?, p: PropertyMetadata): Int = null!! + fun getValue(t: Any?, p: PropertyMetadata): Int = null!! } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/propertyDefferedType.txt b/compiler/testData/diagnostics/tests/delegatedProperty/propertyDefferedType.txt index b8932ae1cc9..86b698cc2c7 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/propertyDefferedType.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/propertyDefferedType.txt @@ -12,7 +12,7 @@ public final class Delegate { public constructor Delegate(/*0*/ init: T) public final val init: T public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int + public final fun getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/propertyDelegatedAmbiguity.kt b/compiler/testData/diagnostics/tests/delegatedProperty/propertyDelegatedAmbiguity.kt index a14adb28f24..b27ee45602b 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/propertyDelegatedAmbiguity.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/propertyDelegatedAmbiguity.kt @@ -3,7 +3,7 @@ val a: Int by Delegate() class Delegate { - fun get(t: Any?, p: PropertyMetadata): Int { + fun getValue(t: Any?, p: PropertyMetadata): Int { return 1 } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/propertyDelegatedAmbiguity.txt b/compiler/testData/diagnostics/tests/delegatedProperty/propertyDelegatedAmbiguity.txt index daeb385f593..8e646bf5991 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/propertyDelegatedAmbiguity.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/propertyDelegatedAmbiguity.txt @@ -5,7 +5,7 @@ public val a: kotlin.Int public final class Delegate { public constructor Delegate() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int + public final fun getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public final fun propertyDelegated(/*0*/ p: kotlin.PropertyMetadata, /*1*/ i: kotlin.Int = ...): kotlin.Unit public final fun propertyDelegated(/*0*/ p: kotlin.PropertyMetadata, /*1*/ s: kotlin.String = ...): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/propertyDelegatedIncomplete.kt b/compiler/testData/diagnostics/tests/delegatedProperty/propertyDelegatedIncomplete.kt index 6b6fedef080..40946895e32 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/propertyDelegatedIncomplete.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/propertyDelegatedIncomplete.kt @@ -3,7 +3,7 @@ val a: Int by Delegate() class Delegate { - fun get(t: Any?, p: PropertyMetadata): Int { + fun getValue(t: Any?, p: PropertyMetadata): Int { return 1 } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/propertyDelegatedIncomplete.txt b/compiler/testData/diagnostics/tests/delegatedProperty/propertyDelegatedIncomplete.txt index ae1c85bf536..9fbef8ad842 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/propertyDelegatedIncomplete.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/propertyDelegatedIncomplete.txt @@ -5,7 +5,7 @@ public val a: kotlin.Int public final class Delegate { public constructor Delegate() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int + public final fun getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public final fun propertyDelegated(/*0*/ p: kotlin.PropertyMetadata): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/propertyDelegatedMissing.kt b/compiler/testData/diagnostics/tests/delegatedProperty/propertyDelegatedMissing.kt index 071c0ca7451..9bfb986f8bb 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/propertyDelegatedMissing.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/propertyDelegatedMissing.kt @@ -3,7 +3,7 @@ val a: Int by Delegate() class Delegate { - fun get(t: Any?, p: PropertyMetadata): Int { + fun getValue(t: Any?, p: PropertyMetadata): Int { return 1 } } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/propertyDelegatedMissing.txt b/compiler/testData/diagnostics/tests/delegatedProperty/propertyDelegatedMissing.txt index eaeab9e6048..bb49ab03638 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/propertyDelegatedMissing.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/propertyDelegatedMissing.txt @@ -5,7 +5,7 @@ public val a: kotlin.Int public final class Delegate { public constructor Delegate() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int + public final fun getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/propertyDelegatedPrivate.kt b/compiler/testData/diagnostics/tests/delegatedProperty/propertyDelegatedPrivate.kt index 9fa1dd18cdd..a5be0a34c82 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/propertyDelegatedPrivate.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/propertyDelegatedPrivate.kt @@ -3,7 +3,7 @@ val a: Int by Delegate() class Delegate { - fun get(t: Any?, p: PropertyMetadata): Int { + fun getValue(t: Any?, p: PropertyMetadata): Int { return 1 } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/propertyDelegatedPrivate.txt b/compiler/testData/diagnostics/tests/delegatedProperty/propertyDelegatedPrivate.txt index 4387b18251f..260de41acd5 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/propertyDelegatedPrivate.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/propertyDelegatedPrivate.txt @@ -5,7 +5,7 @@ public val a: kotlin.Int public final class Delegate { public constructor Delegate() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int + public final fun getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int private final fun propertyDelegated(/*0*/ p: kotlin.PropertyMetadata): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/propertyDelegatedWrongArguments.kt b/compiler/testData/diagnostics/tests/delegatedProperty/propertyDelegatedWrongArguments.kt index 5dadd738407..bc2d7b10b73 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/propertyDelegatedWrongArguments.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/propertyDelegatedWrongArguments.kt @@ -3,7 +3,7 @@ val a: Int by Delegate() class Delegate { - fun get(t: Any?, p: PropertyMetadata): Int { + fun getValue(t: Any?, p: PropertyMetadata): Int { return 1 } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/propertyDelegatedWrongArguments.txt b/compiler/testData/diagnostics/tests/delegatedProperty/propertyDelegatedWrongArguments.txt index 9290f37e90f..4a9261f274e 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/propertyDelegatedWrongArguments.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/propertyDelegatedWrongArguments.txt @@ -5,7 +5,7 @@ public val a: kotlin.Int public final class Delegate { public constructor Delegate() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int + public final fun getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public final fun propertyDelegated(): kotlin.Unit public final fun propertyDelegated(/*0*/ a: kotlin.Int): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/recursiveType.kt b/compiler/testData/diagnostics/tests/delegatedProperty/recursiveType.kt index 68acb20bcc5..a8c26f81bbb 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/recursiveType.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/recursiveType.kt @@ -8,7 +8,7 @@ val c by d val d by c class Delegate(i: Int) { - fun get(t: Any?, p: PropertyMetadata): Int { + fun getValue(t: Any?, p: PropertyMetadata): Int { return 1 } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/recursiveType.txt b/compiler/testData/diagnostics/tests/delegatedProperty/recursiveType.txt index bb76549ec57..d9ed6e94f25 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/recursiveType.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/recursiveType.txt @@ -8,7 +8,7 @@ public val d: [ERROR : ] public final class Delegate { public constructor Delegate(/*0*/ i: kotlin.Int) public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int + public final fun getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/redundantGetter.kt b/compiler/testData/diagnostics/tests/delegatedProperty/redundantGetter.kt index e5b493cc00a..5daa82aabf2 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/redundantGetter.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/redundantGetter.kt @@ -4,7 +4,7 @@ val a: Int by Delegate() get() = 1 class Delegate { - fun get(t: Any?, p: PropertyMetadata): Int { + fun getValue(t: Any?, p: PropertyMetadata): Int { return 1 } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/redundantGetter.txt b/compiler/testData/diagnostics/tests/delegatedProperty/redundantGetter.txt index eaeab9e6048..bb49ab03638 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/redundantGetter.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/redundantGetter.txt @@ -5,7 +5,7 @@ public val a: kotlin.Int public final class Delegate { public constructor Delegate() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int + public final fun getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/redundantSetter.kt b/compiler/testData/diagnostics/tests/delegatedProperty/redundantSetter.kt index 7d9baba771e..fa56b4cedcf 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/redundantSetter.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/redundantSetter.kt @@ -5,9 +5,9 @@ var a: Int by Delegate() set(i) {} class Delegate { - fun get(t: Any?, p: PropertyMetadata): Int { + fun getValue(t: Any?, p: PropertyMetadata): Int { return 1 } - fun set(t: Any?, p: PropertyMetadata, i: Int) {} + fun setValue(t: Any?, p: PropertyMetadata, i: Int) {} } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/redundantSetter.txt b/compiler/testData/diagnostics/tests/delegatedProperty/redundantSetter.txt index 13bdf8a84fa..3cc7f53f52d 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/redundantSetter.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/redundantSetter.txt @@ -5,8 +5,8 @@ public var a: kotlin.Int public final class Delegate { public constructor Delegate() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int + public final fun getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun set(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata, /*2*/ i: kotlin.Int): kotlin.Unit + public final fun setValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata, /*2*/ i: kotlin.Int): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/setterThisTypeMismatch.kt b/compiler/testData/diagnostics/tests/delegatedProperty/setterThisTypeMismatch.kt index ce3c7608672..ac0846f8b28 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/setterThisTypeMismatch.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/setterThisTypeMismatch.kt @@ -9,8 +9,8 @@ var cTopLevel: Int by Delegate() class A class Delegate { - fun get(t: Any?, p: PropertyMetadata): Int { + fun getValue(t: Any?, p: PropertyMetadata): Int { return 1 } - fun set(t: A, p: PropertyMetadata, i: Int) {} + fun setValue(t: A, p: PropertyMetadata, i: Int) {} } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/setterThisTypeMismatch.txt b/compiler/testData/diagnostics/tests/delegatedProperty/setterThisTypeMismatch.txt index 6eeed186a1a..9cf90aed897 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/setterThisTypeMismatch.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/setterThisTypeMismatch.txt @@ -20,8 +20,8 @@ public final class D { public final class Delegate { public constructor Delegate() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int + public final fun getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun set(/*0*/ t: A, /*1*/ p: kotlin.PropertyMetadata, /*2*/ i: kotlin.Int): kotlin.Unit + public final fun setValue(/*0*/ t: A, /*1*/ p: kotlin.PropertyMetadata, /*2*/ i: kotlin.Int): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/setterWithSupertype.kt b/compiler/testData/diagnostics/tests/delegatedProperty/setterWithSupertype.kt index 0c186aea2e9..218e21fdde2 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/setterWithSupertype.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/setterWithSupertype.kt @@ -6,10 +6,10 @@ class Derived: Base() var a: Derived by A() class A { - fun get(t: Any?, p: PropertyMetadata): Derived { + fun getValue(t: Any?, p: PropertyMetadata): Derived { return Derived() } - fun set(t: Any?, p: PropertyMetadata, i: Base) {} + fun setValue(t: Any?, p: PropertyMetadata, i: Base) {} } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/setterWithSupertype.txt b/compiler/testData/diagnostics/tests/delegatedProperty/setterWithSupertype.txt index 4d10296e9e5..b4cba5a4479 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/setterWithSupertype.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/setterWithSupertype.txt @@ -5,9 +5,9 @@ public var a: Derived public final class A { public constructor A() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): Derived + public final fun getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): Derived public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun set(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata, /*2*/ i: Base): kotlin.Unit + public final fun setValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata, /*2*/ i: Base): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/thisInDelegate.kt b/compiler/testData/diagnostics/tests/delegatedProperty/thisInDelegate.kt index 80a7b8d9679..bece51a2080 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/thisInDelegate.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/thisInDelegate.kt @@ -7,7 +7,7 @@ class A { } class Delegate(i: Int) { - fun get(t: Any?, p: PropertyMetadata): Int { + fun getValue(t: Any?, p: PropertyMetadata): Int { return 1 } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/thisInDelegate.txt b/compiler/testData/diagnostics/tests/delegatedProperty/thisInDelegate.txt index 262477dba3d..4202ab486ae 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/thisInDelegate.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/thisInDelegate.txt @@ -13,7 +13,7 @@ public final class A { public final class Delegate { public constructor Delegate(/*0*/ i: kotlin.Int) public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int + public final fun getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/thisOfAnyType.kt b/compiler/testData/diagnostics/tests/delegatedProperty/thisOfAnyType.kt index 1f1789bf64a..88a219f4878 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/thisOfAnyType.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/thisOfAnyType.kt @@ -7,8 +7,8 @@ class A { var aTopLevel: Int by Delegate() class Delegate { - fun get(t: Any?, p: PropertyMetadata): Int { + fun getValue(t: Any?, p: PropertyMetadata): Int { return 1 } - fun set(t: Any?, p: PropertyMetadata, a: Int) {} + fun setValue(t: Any?, p: PropertyMetadata, a: Int) {} } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/thisOfAnyType.txt b/compiler/testData/diagnostics/tests/delegatedProperty/thisOfAnyType.txt index 87e297af88d..0f086cb5730 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/thisOfAnyType.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/thisOfAnyType.txt @@ -13,8 +13,8 @@ public final class A { public final class Delegate { public constructor Delegate() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int + public final fun getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun set(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata, /*2*/ a: kotlin.Int): kotlin.Unit + public final fun setValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata, /*2*/ a: kotlin.Int): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/thisOfNothingNullableType.kt b/compiler/testData/diagnostics/tests/delegatedProperty/thisOfNothingNullableType.kt index b97e30db73e..6410bbd30b9 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/thisOfNothingNullableType.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/thisOfNothingNullableType.kt @@ -5,11 +5,11 @@ class A { var aTopLevel: Int by Delegate() class Delegate { - fun get(t: Nothing?, p: PropertyMetadata): Int { + fun getValue(t: Nothing?, p: PropertyMetadata): Int { p.equals(null) // to avoid UNUSED_PARAMETER warning return 1 } - fun set(t: Nothing?, p: PropertyMetadata, a: Int) { + fun setValue(t: Nothing?, p: PropertyMetadata, a: Int) { p.equals(a) // to avoid UNUSED_PARAMETER warning } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/thisOfNothingNullableType.txt b/compiler/testData/diagnostics/tests/delegatedProperty/thisOfNothingNullableType.txt index abf204a2c04..f10559a92b8 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/thisOfNothingNullableType.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/thisOfNothingNullableType.txt @@ -13,8 +13,8 @@ public final class A { public final class Delegate { public constructor Delegate() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ t: kotlin.Nothing?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int + public final fun getValue(/*0*/ t: kotlin.Nothing?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun set(/*0*/ t: kotlin.Nothing?, /*1*/ p: kotlin.PropertyMetadata, /*2*/ a: kotlin.Int): kotlin.Unit + public final fun setValue(/*0*/ t: kotlin.Nothing?, /*1*/ p: kotlin.PropertyMetadata, /*2*/ a: kotlin.Int): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/thisOfNothingType.kt b/compiler/testData/diagnostics/tests/delegatedProperty/thisOfNothingType.kt index 09d63bedc09..f3c24e96c18 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/thisOfNothingType.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/thisOfNothingType.kt @@ -5,11 +5,11 @@ class A { var aTopLevel: Int by Delegate() class Delegate { - fun get(t: Nothing, p: PropertyMetadata): Int { + fun getValue(t: Nothing, p: PropertyMetadata): Int { p.equals(null) // to avoid UNUSED_PARAMETER warning return 1 } - fun set(t: Nothing, p: PropertyMetadata, a: Int) { + fun setValue(t: Nothing, p: PropertyMetadata, a: Int) { p.equals(a) // to avoid UNUSED_PARAMETER warning } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/thisOfNothingType.txt b/compiler/testData/diagnostics/tests/delegatedProperty/thisOfNothingType.txt index c706d7e1d97..a17618c28fa 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/thisOfNothingType.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/thisOfNothingType.txt @@ -13,8 +13,8 @@ public final class A { public final class Delegate { public constructor Delegate() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ t: kotlin.Nothing, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int + public final fun getValue(/*0*/ t: kotlin.Nothing, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun set(/*0*/ t: kotlin.Nothing, /*1*/ p: kotlin.PropertyMetadata, /*2*/ a: kotlin.Int): kotlin.Unit + public final fun setValue(/*0*/ t: kotlin.Nothing, /*1*/ p: kotlin.PropertyMetadata, /*2*/ a: kotlin.Int): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/twoGetMethods.kt b/compiler/testData/diagnostics/tests/delegatedProperty/twoGetMethods.kt index 750633291b7..899d7648258 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/twoGetMethods.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/twoGetMethods.kt @@ -3,12 +3,12 @@ class A { } class Delegate { - fun get(t: Int, p: PropertyMetadata): Int { + fun getValue(t: Int, p: PropertyMetadata): Int { t.equals(p) // to avoid UNUSED_PARAMETER warning return 1 } - fun get(t: String, p: PropertyMetadata): Int { + fun getValue(t: String, p: PropertyMetadata): Int { t.equals(p) // to avoid UNUSED_PARAMETER warning return 1 } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/twoGetMethods.txt b/compiler/testData/diagnostics/tests/delegatedProperty/twoGetMethods.txt index 0af1af7bbdd..f461969b47f 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/twoGetMethods.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/twoGetMethods.txt @@ -11,8 +11,8 @@ public final class A { public final class Delegate { public constructor Delegate() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ t: kotlin.Int, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int - public final fun get(/*0*/ t: kotlin.String, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int + public final fun getValue(/*0*/ t: kotlin.Int, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int + public final fun getValue(/*0*/ t: kotlin.String, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForGetReturnType.kt b/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForGetReturnType.kt index be2f06d1161..b3ff2e71f1a 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForGetReturnType.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForGetReturnType.kt @@ -3,7 +3,7 @@ val c: Int by Delegate() class Delegate { - fun get(t: Any?, p: PropertyMetadata): String { + fun getValue(t: Any?, p: PropertyMetadata): String { return "" } } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForGetReturnType.txt b/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForGetReturnType.txt index 10bf69b4aa3..bf9b9c0012a 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForGetReturnType.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForGetReturnType.txt @@ -5,7 +5,7 @@ public val c: kotlin.Int public final class Delegate { public constructor Delegate() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.String + public final fun getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.String public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForGetWithGeneric.kt b/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForGetWithGeneric.kt index ebf4ec533b2..25081c8bef2 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForGetWithGeneric.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForGetWithGeneric.kt @@ -14,7 +14,7 @@ class C { val cTopLevel: Int by Delegate() class Delegate { - fun get(t: T, p: PropertyMetadata): Int { + fun getValue(t: T, p: PropertyMetadata): Int { return 1 } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForGetWithGeneric.txt b/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForGetWithGeneric.txt index f7caabdf3ad..6c4958c6087 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForGetWithGeneric.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForGetWithGeneric.txt @@ -29,7 +29,7 @@ public final class C { public final class Delegate { public constructor Delegate() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ t: T, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int + public final fun getValue(/*0*/ t: T, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForSetParameter.kt b/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForSetParameter.kt index 7ea01f408ff..a9a4084edab 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForSetParameter.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForSetParameter.kt @@ -7,8 +7,8 @@ class A { var aTopLevel: Int by Delegate() class Delegate { - fun get(t: Any?, p: PropertyMetadata): Int { + fun getValue(t: Any?, p: PropertyMetadata): Int { return 1 } - fun set(t: Any?, p: PropertyMetadata, i: String) {} + fun setValue(t: Any?, p: PropertyMetadata, i: String) {} } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForSetParameter.txt b/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForSetParameter.txt index 340864636ec..96042f83bc6 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForSetParameter.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForSetParameter.txt @@ -13,8 +13,8 @@ public final class A { public final class Delegate { public constructor Delegate() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int + public final fun getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun set(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata, /*2*/ i: kotlin.String): kotlin.Unit + public final fun setValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata, /*2*/ i: kotlin.String): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForThisGetParameter.kt b/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForThisGetParameter.kt index 69062bb195c..e76e2c7ea6f 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForThisGetParameter.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForThisGetParameter.kt @@ -7,7 +7,7 @@ val bTopLevel: Int by Delegate() class A class Delegate { - fun get(t: A, p: PropertyMetadata): Int { + fun getValue(t: A, p: PropertyMetadata): Int { t.equals(p) // to avoid UNUSED_PARAMETER warning return 1 } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForThisGetParameter.txt b/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForThisGetParameter.txt index e16646d6d93..a5a27cd600e 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForThisGetParameter.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/typeMismatchForThisGetParameter.txt @@ -20,7 +20,7 @@ public final class B { public final class Delegate { public constructor Delegate() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ t: A, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int + public final fun getValue(/*0*/ t: A, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/wrongCountOfParametersInGet.kt b/compiler/testData/diagnostics/tests/delegatedProperty/wrongCountOfParametersInGet.kt index 384a0fedf21..3453a995913 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/wrongCountOfParametersInGet.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/wrongCountOfParametersInGet.kt @@ -7,7 +7,7 @@ class A { val aTopLevel: Int by Delegate() class Delegate { - fun get(t: Any?, p: PropertyMetadata, a: Int): Int { + fun getValue(t: Any?, p: PropertyMetadata, a: Int): Int { return a } } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/wrongCountOfParametersInGet.txt b/compiler/testData/diagnostics/tests/delegatedProperty/wrongCountOfParametersInGet.txt index 6389885a030..f58c48f4a42 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/wrongCountOfParametersInGet.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/wrongCountOfParametersInGet.txt @@ -13,7 +13,7 @@ public final class A { public final class Delegate { public constructor Delegate() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata, /*2*/ a: kotlin.Int): kotlin.Int + public final fun getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata, /*2*/ a: kotlin.Int): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/wrongCountOfParametersInSet.kt b/compiler/testData/diagnostics/tests/delegatedProperty/wrongCountOfParametersInSet.kt index 39bddd0ac56..e99e2d43614 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/wrongCountOfParametersInSet.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/wrongCountOfParametersInSet.kt @@ -7,9 +7,9 @@ class A { var aTopLevel: Int by Delegate() class Delegate { - fun get(t: Any?, p: PropertyMetadata): Int { + fun getValue(t: Any?, p: PropertyMetadata): Int { return 1 } - fun set(t: Any?, p: PropertyMetadata, a: Int, c: Int) {} + fun setValue(t: Any?, p: PropertyMetadata, a: Int, c: Int) {} } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/wrongCountOfParametersInSet.txt b/compiler/testData/diagnostics/tests/delegatedProperty/wrongCountOfParametersInSet.txt index aa3832f6e7b..af7519912ba 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/wrongCountOfParametersInSet.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/wrongCountOfParametersInSet.txt @@ -13,8 +13,8 @@ public final class A { public final class Delegate { public constructor Delegate() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int + public final fun getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun set(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata, /*2*/ a: kotlin.Int, /*3*/ c: kotlin.Int): kotlin.Unit + public final fun setValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata, /*2*/ a: kotlin.Int, /*3*/ c: kotlin.Int): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/wrongSetterReturnType.kt b/compiler/testData/diagnostics/tests/delegatedProperty/wrongSetterReturnType.kt index fdee6cf5874..2a28c219069 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/wrongSetterReturnType.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/wrongSetterReturnType.kt @@ -3,11 +3,11 @@ var b: Int by Delegate() class Delegate { - fun get(t: Any?, p: PropertyMetadata): Int { + fun getValue(t: Any?, p: PropertyMetadata): Int { return 1 } - fun set(t: Any?, p: PropertyMetadata, i: Int): Int { + fun setValue(t: Any?, p: PropertyMetadata, i: Int): Int { return i } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/wrongSetterReturnType.txt b/compiler/testData/diagnostics/tests/delegatedProperty/wrongSetterReturnType.txt index f6f6e1ad2d7..fad4e0e4c74 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/wrongSetterReturnType.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/wrongSetterReturnType.txt @@ -5,8 +5,8 @@ public var b: kotlin.Int public final class Delegate { public constructor Delegate() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int + public final fun getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun set(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata, /*2*/ i: kotlin.Int): kotlin.Int + public final fun setValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.PropertyMetadata, /*2*/ i: kotlin.Int): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/deprecated/functionUsage.kt b/compiler/testData/diagnostics/tests/deprecated/functionUsage.kt index b6531229503..b233b286a9c 100644 --- a/compiler/testData/diagnostics/tests/deprecated/functionUsage.kt +++ b/compiler/testData/diagnostics/tests/deprecated/functionUsage.kt @@ -1,8 +1,8 @@ // !DIAGNOSTICS: -UNUSED_EXPRESSION class UsefulClass(val param: Int = 2) { - fun get(instance: Any, property: PropertyMetadata) : Int = 1 - fun set(instance: Any, property: PropertyMetadata, value: Int) {} + fun getValue(instance: Any, property: PropertyMetadata) : Int = 1 + fun setValue(instance: Any, property: PropertyMetadata, value: Int) {} @Deprecated("message") fun member() {} diff --git a/compiler/testData/diagnostics/tests/deprecated/functionUsage.txt b/compiler/testData/diagnostics/tests/deprecated/functionUsage.txt index ec207129a7b..686c86b55bc 100644 --- a/compiler/testData/diagnostics/tests/deprecated/functionUsage.txt +++ b/compiler/testData/diagnostics/tests/deprecated/functionUsage.txt @@ -45,9 +45,9 @@ public final class UsefulClass { public constructor UsefulClass(/*0*/ param: kotlin.Int = ...) public final val param: kotlin.Int public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ instance: kotlin.Any, /*1*/ property: kotlin.PropertyMetadata): kotlin.Int + public final fun getValue(/*0*/ instance: kotlin.Any, /*1*/ property: kotlin.PropertyMetadata): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int @kotlin.Deprecated(message = "message") public final fun member(): kotlin.Unit - public final fun set(/*0*/ instance: kotlin.Any, /*1*/ property: kotlin.PropertyMetadata, /*2*/ value: kotlin.Int): kotlin.Unit + public final fun setValue(/*0*/ instance: kotlin.Any, /*1*/ property: kotlin.PropertyMetadata, /*2*/ value: kotlin.Int): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/deprecated/propertyUsage.kt b/compiler/testData/diagnostics/tests/deprecated/propertyUsage.kt index 36d8b3eea08..9b4ae13983f 100644 --- a/compiler/testData/diagnostics/tests/deprecated/propertyUsage.kt +++ b/compiler/testData/diagnostics/tests/deprecated/propertyUsage.kt @@ -2,10 +2,10 @@ class Delegate() { @Deprecated("text") - fun get(instance: Any, property: PropertyMetadata) : Int = 1 + fun getValue(instance: Any, property: PropertyMetadata) : Int = 1 @Deprecated("text") - fun set(instance: Any, property: PropertyMetadata, value: Int) {} + fun setValue(instance: Any, property: PropertyMetadata, value: Int) {} } class PropertyHolder { diff --git a/compiler/testData/diagnostics/tests/deprecated/propertyUsage.txt b/compiler/testData/diagnostics/tests/deprecated/propertyUsage.txt index 9ccc5879a82..eb62b2a76f1 100644 --- a/compiler/testData/diagnostics/tests/deprecated/propertyUsage.txt +++ b/compiler/testData/diagnostics/tests/deprecated/propertyUsage.txt @@ -7,9 +7,9 @@ public fun PropertyHolder.extFunction(): kotlin.Unit public final class Delegate { public constructor Delegate() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - @kotlin.Deprecated(message = "text") public final fun get(/*0*/ instance: kotlin.Any, /*1*/ property: kotlin.PropertyMetadata): kotlin.Int + @kotlin.Deprecated(message = "text") public final fun getValue(/*0*/ instance: kotlin.Any, /*1*/ property: kotlin.PropertyMetadata): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - @kotlin.Deprecated(message = "text") public final fun set(/*0*/ instance: kotlin.Any, /*1*/ property: kotlin.PropertyMetadata, /*2*/ value: kotlin.Int): kotlin.Unit + @kotlin.Deprecated(message = "text") public final fun setValue(/*0*/ instance: kotlin.Any, /*1*/ property: kotlin.PropertyMetadata, /*2*/ value: kotlin.Int): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/duplicateJvmSignature/specialNames/propertyMetadataCache.kt b/compiler/testData/diagnostics/tests/duplicateJvmSignature/specialNames/propertyMetadataCache.kt index 8c33a0a3f77..3c59d79c286 100644 --- a/compiler/testData/diagnostics/tests/duplicateJvmSignature/specialNames/propertyMetadataCache.kt +++ b/compiler/testData/diagnostics/tests/duplicateJvmSignature/specialNames/propertyMetadataCache.kt @@ -1,6 +1,6 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -fun Any.get(x: Any?, y: Any): Any = null!! +fun Any.getValue(x: Any?, y: Any): Any = null!! class C { val x by 1 diff --git a/compiler/testData/diagnostics/tests/duplicateJvmSignature/specialNames/propertyMetadataCache.txt b/compiler/testData/diagnostics/tests/duplicateJvmSignature/specialNames/propertyMetadataCache.txt index 685dfacd191..f5c5672e87b 100644 --- a/compiler/testData/diagnostics/tests/duplicateJvmSignature/specialNames/propertyMetadataCache.txt +++ b/compiler/testData/diagnostics/tests/duplicateJvmSignature/specialNames/propertyMetadataCache.txt @@ -2,7 +2,7 @@ package public val `$propertyMetadata`: kotlin.Array public val x: kotlin.Any -public fun kotlin.Any.get(/*0*/ x: kotlin.Any?, /*1*/ y: kotlin.Any): kotlin.Any +public fun kotlin.Any.getValue(/*0*/ x: kotlin.Any?, /*1*/ y: kotlin.Any): kotlin.Any public final class C { public constructor C() diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt3496.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt3496.kt index 9468733e750..c6099f4c48f 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt3496.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt3496.kt @@ -5,5 +5,5 @@ class B { fun x (y: B>) { val z: S = y[""] // does not work with [], but works with .get() } - operator fun get(s : String): S = throw Exception() + operator fun get(s : String): S = throw Exception() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt3496_2.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt3496_2.kt index 1fc2f31cf73..cbd0892f7f6 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt3496_2.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt3496_2.kt @@ -8,4 +8,4 @@ class F { val z: ArrayList = y["", w] } } -operator fun Any.get(s: String, w: ArrayList): ArrayList = throw Exception() \ No newline at end of file +operator fun Any.get(s: String, w: ArrayList): ArrayList = throw Exception() \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/substitutions/delegationAndInference.kt b/compiler/testData/diagnostics/tests/inference/substitutions/delegationAndInference.kt index d0cad0fb02a..abb18baea76 100644 --- a/compiler/testData/diagnostics/tests/inference/substitutions/delegationAndInference.kt +++ b/compiler/testData/diagnostics/tests/inference/substitutions/delegationAndInference.kt @@ -5,8 +5,8 @@ class A(val map: MutableMap) { var a: String by map.withDefault1 { "foo" } } -fun MutableMap.get(thisRef: Any?, property: PropertyMetadata): G = throw Exception() +fun MutableMap.getValue(thisRef: Any?, property: PropertyMetadata): G = throw Exception() -fun MutableMap.set(thisRef: Any?, property: PropertyMetadata, value: S) {} +fun MutableMap.setValue(thisRef: Any?, property: PropertyMetadata, value: S) {} fun MutableMap.withDefault1(default: (key: K) -> V): MutableMap = this \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/substitutions/delegationAndInference.txt b/compiler/testData/diagnostics/tests/inference/substitutions/delegationAndInference.txt index 79409cec098..c96337fbeda 100644 --- a/compiler/testData/diagnostics/tests/inference/substitutions/delegationAndInference.txt +++ b/compiler/testData/diagnostics/tests/inference/substitutions/delegationAndInference.txt @@ -1,7 +1,7 @@ package -public fun kotlin.MutableMap.get(/*0*/ thisRef: kotlin.Any?, /*1*/ property: kotlin.PropertyMetadata): G -public fun kotlin.MutableMap.set(/*0*/ thisRef: kotlin.Any?, /*1*/ property: kotlin.PropertyMetadata, /*2*/ value: S): kotlin.Unit +public fun kotlin.MutableMap.getValue(/*0*/ thisRef: kotlin.Any?, /*1*/ property: kotlin.PropertyMetadata): G +public fun kotlin.MutableMap.setValue(/*0*/ thisRef: kotlin.Any?, /*1*/ property: kotlin.PropertyMetadata, /*2*/ value: S): kotlin.Unit public fun kotlin.MutableMap.withDefault1(/*0*/ default: (K) -> V): kotlin.MutableMap public final class A { diff --git a/compiler/testData/diagnostics/tests/modifiers/const/applicability.kt b/compiler/testData/diagnostics/tests/modifiers/const/applicability.kt index 0a8d9a08759..a5d271cd593 100644 --- a/compiler/testData/diagnostics/tests/modifiers/const/applicability.kt +++ b/compiler/testData/diagnostics/tests/modifiers/const/applicability.kt @@ -69,7 +69,7 @@ const val nonConstInitializer = foo() // ------------------ class Delegate { - fun get(thisRef: Any?, prop: PropertyMetadata): Int = 1 + fun getValue(thisRef: Any?, prop: PropertyMetadata): Int = 1 - fun set(thisRef: Any?, prop: PropertyMetadata, value: Int) = Unit + fun setValue(thisRef: Any?, prop: PropertyMetadata, value: Int) = Unit } diff --git a/compiler/testData/diagnostics/tests/modifiers/const/applicability.txt b/compiler/testData/diagnostics/tests/modifiers/const/applicability.txt index 81fe9e2c6c7..7bfe6236a5e 100644 --- a/compiler/testData/diagnostics/tests/modifiers/const/applicability.txt +++ b/compiler/testData/diagnostics/tests/modifiers/const/applicability.txt @@ -58,9 +58,9 @@ public object D : C { public final class Delegate { public constructor Delegate() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.PropertyMetadata): kotlin.Int + public final fun getValue(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.PropertyMetadata): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun set(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.PropertyMetadata, /*2*/ value: kotlin.Int): kotlin.Unit + public final fun setValue(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.PropertyMetadata, /*2*/ value: kotlin.Int): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/delegatedProperties.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/delegatedProperties.kt index 129ee20826e..4120f26d029 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/delegatedProperties.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/delegatedProperties.kt @@ -5,8 +5,8 @@ import org.jetbrains.annotations.*; public class J { public interface DP { - String get(Object a, Object b); - String set(Object a, Object b, Object c); + String getValue(Object a, Object b); + String setValue(Object a, Object b, Object c); } @NotNull diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/delegatedProperties.txt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/delegatedProperties.txt index b65523c68d5..99a0f92048b 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/delegatedProperties.txt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/delegatedProperties.txt @@ -12,9 +12,9 @@ public open class J { public interface DP { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public abstract operator fun get(/*0*/ a: kotlin.Any!, /*1*/ b: kotlin.Any!): kotlin.String! + public abstract fun getValue(/*0*/ a: kotlin.Any!, /*1*/ b: kotlin.Any!): kotlin.String! public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public abstract operator fun set(/*0*/ a: kotlin.Any!, /*1*/ b: kotlin.Any!, /*2*/ c: kotlin.Any!): kotlin.String! + public abstract fun setValue(/*0*/ a: kotlin.Any!, /*1*/ b: kotlin.Any!, /*2*/ c: kotlin.Any!): kotlin.String! public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/regressions/Jet169.kt b/compiler/testData/diagnostics/tests/regressions/Jet169.kt index eaf1494d564..ba56f72b947 100644 --- a/compiler/testData/diagnostics/tests/regressions/Jet169.kt +++ b/compiler/testData/diagnostics/tests/regressions/Jet169.kt @@ -1,8 +1,8 @@ -fun set(key : String, value : String) { +fun set(key : String, value : String) { val a : String? = "" when (a) { "" -> a.get(0) is String, is Any -> a.compareTo("") else -> a.toString() } -} +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/regressions/kt235.kt b/compiler/testData/diagnostics/tests/regressions/kt235.kt index 836961e4f95..5d793fa5859 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt235.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt235.kt @@ -5,27 +5,27 @@ package kt235 fun main(args: Array) { val array = MyArray() val f: () -> String = { - array[2] = 23 //error: Type mismatch: inferred type is Int (!!!) but String was expected + array[2] = 23 //error: Type mismatch: inferred type is Int (!!!) but String was expected } val g: () -> String = { - var x = 1 - x += 2 //no error, but it should be here + var x = 1 + x += 2 //no error, but it should be here } val h: () -> String = { - var x = 1 - x = 2 //the same + var x = 1 + x = 2 //the same } val array1 = MyArray1() val i: () -> String = { - array1[2] = 23 + array1[2] = 23 } val fi: () -> String = { - array[2] = 23 + array[2] = 23 } val gi: () -> String = { - var x = 1 - x += 21 + var x = 1 + x += 21 } var m: MyNumber = MyNumber() @@ -35,13 +35,13 @@ fun main(args: Array) { } class MyArray() { - operator fun get(i: Int): Int = 1 - operator fun set(i: Int, value: Int): Int = 1 + operator fun get(i: Int): Int = 1 + operator fun set(i: Int, value: Int): Int = 1 } class MyArray1() { - operator fun get(i: Int): Int = 1 - operator fun set(i: Int, value: Int) {} + operator fun get(i: Int): Int = 1 + operator fun set(i: Int, value: Int) {} } class MyNumber() { diff --git a/compiler/testData/diagnostics/tests/regressions/kt258.kt b/compiler/testData/diagnostics/tests/regressions/kt258.kt index 7ea51cec00d..cba69c3d509 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt258.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt258.kt @@ -7,4 +7,4 @@ fun test() { attributes["href"] = "1" // inference fails, but it shouldn't } -operator fun MutableMap.set(key : K, value : V) {}//= this.put(key, value) \ No newline at end of file +operator fun MutableMap.set(key : K, value : V) {}//= this.put(key, value) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/regressions/kt459.kt b/compiler/testData/diagnostics/tests/regressions/kt459.kt index c2b93e0e6a1..ece6110dbeb 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt459.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt459.kt @@ -5,4 +5,4 @@ fun test() { attributes["href"] = "1" // inference fails, but it shouldn't } -operator fun Map.set(key : K, value : V) {}//= this.put(key, value) \ No newline at end of file +operator fun Map.set(key : K, value : V) {}//= this.put(key, value) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/kt2865.kt b/compiler/testData/diagnostics/tests/smartCasts/kt2865.kt index cf7e8f8de06..64ef73cfc3f 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/kt2865.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/kt2865.kt @@ -1,4 +1,4 @@ -operator fun MutableMap.set(k: K, v: V) {} +operator fun MutableMap.set(k: K, v: V) {} fun foo(a: MutableMap, x: String?) { a[x!!] = x diff --git a/compiler/testData/diagnostics/tests/smartCasts/publicVals/delegate.kt b/compiler/testData/diagnostics/tests/smartCasts/publicVals/delegate.kt index ec06fed34e7..37d4717d985 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/publicVals/delegate.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/publicVals/delegate.kt @@ -1,5 +1,5 @@ class Delegate { - fun get(thisRef: Any?, prop: PropertyMetadata): String? { + fun getValue(thisRef: Any?, prop: PropertyMetadata): String? { return null } } diff --git a/compiler/testData/diagnostics/tests/smartCasts/publicVals/delegate.txt b/compiler/testData/diagnostics/tests/smartCasts/publicVals/delegate.txt index e45e30d2a37..a945a502e91 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/publicVals/delegate.txt +++ b/compiler/testData/diagnostics/tests/smartCasts/publicVals/delegate.txt @@ -3,7 +3,7 @@ package public final class Delegate { public constructor Delegate() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.PropertyMetadata): kotlin.String? + public final fun getValue(/*0*/ thisRef: kotlin.Any?, /*1*/ prop: kotlin.PropertyMetadata): kotlin.String? public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/variance/ValProperty.kt b/compiler/testData/diagnostics/tests/variance/ValProperty.kt index 206c78f1220..47b709decc2 100644 --- a/compiler/testData/diagnostics/tests/variance/ValProperty.kt +++ b/compiler/testData/diagnostics/tests/variance/ValProperty.kt @@ -3,8 +3,8 @@ interface Out interface Inv class Delegate { - fun get(t: Any, p: PropertyMetadata): T = null!! - fun set(t: Any, p: PropertyMetadata, value: T) {} + fun getValue(t: Any, p: PropertyMetadata): T = null!! + fun setValue(t: Any, p: PropertyMetadata, value: T) {} } fun getT(): T = null!! diff --git a/compiler/testData/diagnostics/tests/variance/ValProperty.txt b/compiler/testData/diagnostics/tests/variance/ValProperty.txt index a5c9f49dbd0..45acacc315b 100644 --- a/compiler/testData/diagnostics/tests/variance/ValProperty.txt +++ b/compiler/testData/diagnostics/tests/variance/ValProperty.txt @@ -5,9 +5,9 @@ public fun getT(): T public final class Delegate { public constructor Delegate() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ t: kotlin.Any, /*1*/ p: kotlin.PropertyMetadata): T + public final fun getValue(/*0*/ t: kotlin.Any, /*1*/ p: kotlin.PropertyMetadata): T public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun set(/*0*/ t: kotlin.Any, /*1*/ p: kotlin.PropertyMetadata, /*2*/ value: T): kotlin.Unit + public final fun setValue(/*0*/ t: kotlin.Any, /*1*/ p: kotlin.PropertyMetadata, /*2*/ value: T): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/variance/VarProperty.kt b/compiler/testData/diagnostics/tests/variance/VarProperty.kt index dedb3307d46..07e28f3bf6c 100644 --- a/compiler/testData/diagnostics/tests/variance/VarProperty.kt +++ b/compiler/testData/diagnostics/tests/variance/VarProperty.kt @@ -3,8 +3,8 @@ interface Out interface Inv class Delegate { - fun get(t: Any, p: PropertyMetadata): T = null!! - fun set(t: Any, p: PropertyMetadata, varue: T) {} + fun getValue(t: Any, p: PropertyMetadata): T = null!! + fun setValue(t: Any, p: PropertyMetadata, varue: T) {} } fun getT(): T = null!! diff --git a/compiler/testData/diagnostics/tests/variance/VarProperty.txt b/compiler/testData/diagnostics/tests/variance/VarProperty.txt index c9ae48d1a15..bdba5839367 100644 --- a/compiler/testData/diagnostics/tests/variance/VarProperty.txt +++ b/compiler/testData/diagnostics/tests/variance/VarProperty.txt @@ -5,9 +5,9 @@ public fun getT(): T public final class Delegate { public constructor Delegate() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ t: kotlin.Any, /*1*/ p: kotlin.PropertyMetadata): T + public final fun getValue(/*0*/ t: kotlin.Any, /*1*/ p: kotlin.PropertyMetadata): T public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun set(/*0*/ t: kotlin.Any, /*1*/ p: kotlin.PropertyMetadata, /*2*/ varue: T): kotlin.Unit + public final fun setValue(/*0*/ t: kotlin.Any, /*1*/ p: kotlin.PropertyMetadata, /*2*/ varue: T): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/conventions.dynamic.txt b/compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/conventions.dynamic.txt index 7024580a062..3e37e0b93c7 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/conventions.dynamic.txt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/conventions.dynamic.txt @@ -65,8 +65,8 @@ public final fun get(/*0*/ p0: dynamic): dynamic public final fun divAssign(/*0*/ p0: dynamic): dynamic public final fun get(/*0*/ p0: dynamic): dynamic public final fun modAssign(/*0*/ p0: dynamic): dynamic -public fun get(/*0*/ p0: dynamic, /*1*/ p1: dynamic): dynamic +public fun getValue(/*0*/ p0: dynamic, /*1*/ p1: dynamic): dynamic public fun propertyDelegated(/*0*/ p0: dynamic): dynamic -public fun get(/*0*/ p0: dynamic, /*1*/ p1: dynamic): dynamic -public fun set(/*0*/ p0: dynamic, /*1*/ p1: dynamic, /*2*/ p2: dynamic): dynamic +public fun getValue(/*0*/ p0: dynamic, /*1*/ p1: dynamic): dynamic +public fun setValue(/*0*/ p0: dynamic, /*1*/ p1: dynamic, /*2*/ p2: dynamic): dynamic public fun propertyDelegated(/*0*/ p0: dynamic): dynamic diff --git a/compiler/testData/diagnostics/testsWithStdLib/kt7585/delegate.kt b/compiler/testData/diagnostics/testsWithStdLib/kt7585/delegate.kt index be39490e5a2..1a8ab6b7ade 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/kt7585/delegate.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/kt7585/delegate.kt @@ -33,7 +33,7 @@ class Val { this.initializer = initializer; } - T get(Object instance, Object metadata) { + T getValue(Object instance, Object metadata) { return initializer.invoke(); } } diff --git a/compiler/testData/loadJava/compiledKotlin/annotations/classMembers/DelegatedProperty.kt b/compiler/testData/loadJava/compiledKotlin/annotations/classMembers/DelegatedProperty.kt index 03e3678ed82..6aa2858964b 100644 --- a/compiler/testData/loadJava/compiledKotlin/annotations/classMembers/DelegatedProperty.kt +++ b/compiler/testData/loadJava/compiledKotlin/annotations/classMembers/DelegatedProperty.kt @@ -4,6 +4,6 @@ annotation class Anno class Class { @Anno val x: Int by object { - fun get(thiz: Class, data: PropertyMetadata) = null!! + fun getValue(thiz: Class, data: PropertyMetadata) = null!! } } diff --git a/compiler/testData/loadJava/compiledKotlin/annotations/packageMembers/DelegatedProperty.kt b/compiler/testData/loadJava/compiledKotlin/annotations/packageMembers/DelegatedProperty.kt index cb10f5bc436..a5a05d6e10c 100644 --- a/compiler/testData/loadJava/compiledKotlin/annotations/packageMembers/DelegatedProperty.kt +++ b/compiler/testData/loadJava/compiledKotlin/annotations/packageMembers/DelegatedProperty.kt @@ -3,5 +3,5 @@ package test annotation class Anno @Anno val x: Int by object { - fun get(thiz: Any?, data: PropertyMetadata) = null!! + fun getValue(thiz: Any?, data: PropertyMetadata) = null!! } diff --git a/compiler/testData/loadJava/compiledKotlin/prop/VarWithDelegated.kt b/compiler/testData/loadJava/compiledKotlin/prop/VarWithDelegated.kt index 1cfd3a3f27c..b97e4deda45 100644 --- a/compiler/testData/loadJava/compiledKotlin/prop/VarWithDelegated.kt +++ b/compiler/testData/loadJava/compiledKotlin/prop/VarWithDelegated.kt @@ -6,6 +6,6 @@ class A { } class MyProperty { - fun get(t: T, p: PropertyMetadata): Int = 42 - fun set(t: T, p: PropertyMetadata, i: Int) {} + fun getValue(t: T, p: PropertyMetadata): Int = 42 + fun setValue(t: T, p: PropertyMetadata, i: Int) {} } \ No newline at end of file diff --git a/compiler/testData/loadJava/compiledKotlin/prop/VarWithDelegated.txt b/compiler/testData/loadJava/compiledKotlin/prop/VarWithDelegated.txt index 85b9f14b6b4..9eb6e5a03b4 100644 --- a/compiler/testData/loadJava/compiledKotlin/prop/VarWithDelegated.txt +++ b/compiler/testData/loadJava/compiledKotlin/prop/VarWithDelegated.txt @@ -9,6 +9,6 @@ public final class A { public final class MyProperty { /*primary*/ public constructor MyProperty() - public final fun get(/*0*/ t: T, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int - public final fun set(/*0*/ t: T, /*1*/ p: kotlin.PropertyMetadata, /*2*/ i: kotlin.Int): kotlin.Unit + public final fun getValue(/*0*/ t: T, /*1*/ p: kotlin.PropertyMetadata): kotlin.Int + public final fun setValue(/*0*/ t: T, /*1*/ p: kotlin.PropertyMetadata, /*2*/ i: kotlin.Int): kotlin.Unit } diff --git a/compiler/testData/writeFlags/delegatedProperty/visibility/privateSet.kt b/compiler/testData/writeFlags/delegatedProperty/visibility/privateSet.kt index 84455c64ee3..4551f608bca 100644 --- a/compiler/testData/writeFlags/delegatedProperty/visibility/privateSet.kt +++ b/compiler/testData/writeFlags/delegatedProperty/visibility/privateSet.kt @@ -4,11 +4,11 @@ class MyClass() { } class Delegate { - fun get(t: Any?, p: PropertyMetadata): Int { + fun getValue(t: Any?, p: PropertyMetadata): Int { return 1 } - fun set(t: Any?, p: PropertyMetadata, i: Int) {} + fun setValue(t: Any?, p: PropertyMetadata, i: Int) {} } // TESTED_OBJECT_KIND: function diff --git a/compiler/testData/writeFlags/property/classObject/class/delegatedProtectedVar.kt b/compiler/testData/writeFlags/property/classObject/class/delegatedProtectedVar.kt index 25210dc1442..b2e393fe2ba 100644 --- a/compiler/testData/writeFlags/property/classObject/class/delegatedProtectedVar.kt +++ b/compiler/testData/writeFlags/property/classObject/class/delegatedProtectedVar.kt @@ -1,9 +1,9 @@ class TestDelegate() { - fun get(thisRef: Any?, desc: PropertyMetadata): Int { + fun getValue(thisRef: Any?, desc: PropertyMetadata): Int { return 10 } - public open fun set(thisRef: Any?, desc: PropertyMetadata, svalue : Int) { + public open fun setValue(thisRef: Any?, desc: PropertyMetadata, svalue : Int) { } } diff --git a/compiler/testData/writeFlags/property/classObject/class/delegatedPublicVal.kt b/compiler/testData/writeFlags/property/classObject/class/delegatedPublicVal.kt index 72b879a91a7..481edb3aba6 100644 --- a/compiler/testData/writeFlags/property/classObject/class/delegatedPublicVal.kt +++ b/compiler/testData/writeFlags/property/classObject/class/delegatedPublicVal.kt @@ -1,5 +1,5 @@ class TestDelegate() { - fun get(thisRef: Any?, desc: PropertyMetadata): Int { + fun getValue(thisRef: Any?, desc: PropertyMetadata): Int { return 10 } } diff --git a/compiler/testData/writeFlags/property/classObject/rename/delegatedAndDelegated.kt b/compiler/testData/writeFlags/property/classObject/rename/delegatedAndDelegated.kt index 4229b8d5418..a00a3819737 100644 --- a/compiler/testData/writeFlags/property/classObject/rename/delegatedAndDelegated.kt +++ b/compiler/testData/writeFlags/property/classObject/rename/delegatedAndDelegated.kt @@ -1,14 +1,14 @@ public open class TestDelegate(private val initializer: () -> T) { private var value: T? = null - public open fun get(thisRef: Any?, desc: PropertyMetadata): T { + public open fun getValue(thisRef: Any?, desc: PropertyMetadata): T { if (value == null) { value = initializer() } return value!! } - public open fun set(thisRef: Any?, desc: PropertyMetadata, svalue : T) { + public open fun setValue(thisRef: Any?, desc: PropertyMetadata, svalue : T) { value = svalue } } diff --git a/compiler/testData/writeFlags/property/classObject/rename/delegatedAndProperty.kt b/compiler/testData/writeFlags/property/classObject/rename/delegatedAndProperty.kt index 4ee5c2cd433..b66f52720a1 100644 --- a/compiler/testData/writeFlags/property/classObject/rename/delegatedAndProperty.kt +++ b/compiler/testData/writeFlags/property/classObject/rename/delegatedAndProperty.kt @@ -1,14 +1,14 @@ public open class TestDelegate(private val initializer: () -> T) { private var value: T? = null - public open fun get(thisRef: Any?, desc: PropertyMetadata): T { + public open fun getValue(thisRef: Any?, desc: PropertyMetadata): T { if (value == null) { value = initializer() } return value!! } - public open fun set(thisRef: Any?, desc: PropertyMetadata, svalue : T) { + public open fun setValue(thisRef: Any?, desc: PropertyMetadata, svalue : T) { value = svalue } } diff --git a/compiler/testData/writeFlags/property/classObject/trait/delegatedProtectedVar.kt b/compiler/testData/writeFlags/property/classObject/trait/delegatedProtectedVar.kt index 9a73080c1ae..29be2974284 100644 --- a/compiler/testData/writeFlags/property/classObject/trait/delegatedProtectedVar.kt +++ b/compiler/testData/writeFlags/property/classObject/trait/delegatedProtectedVar.kt @@ -1,9 +1,9 @@ class TestDelegate() { - fun get(thisRef: Any?, desc: PropertyMetadata): Int { + fun getValue(thisRef: Any?, desc: PropertyMetadata): Int { return 10 } - public open fun set(thisRef: Any?, desc: PropertyMetadata, svalue : Int) { + public open fun setValue(thisRef: Any?, desc: PropertyMetadata, svalue : Int) { } } diff --git a/compiler/testData/writeFlags/property/classObject/trait/delegatedPublicVal.kt b/compiler/testData/writeFlags/property/classObject/trait/delegatedPublicVal.kt index 24d7b197abf..5e19c0bbb9f 100644 --- a/compiler/testData/writeFlags/property/classObject/trait/delegatedPublicVal.kt +++ b/compiler/testData/writeFlags/property/classObject/trait/delegatedPublicVal.kt @@ -1,5 +1,5 @@ class TestDelegate() { - fun get(thisRef: Any?, desc: PropertyMetadata): Int { + fun getValue(thisRef: Any?, desc: PropertyMetadata): Int { return 10 } } diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestGenerated.java index 616061e5b95..a749af0098d 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestGenerated.java @@ -181,6 +181,12 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest { doTest(fileName); } + @TestMetadata("DeprecatedGetSetPropertyDelegateConvention.kt") + public void testDeprecatedGetSetPropertyDelegateConvention() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/DeprecatedGetSetPropertyDelegateConvention.kt"); + doTest(fileName); + } + @TestMetadata("DiamondFunction.kt") public void testDiamondFunction() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/DiamondFunction.kt"); diff --git a/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaPackageFragment.kt b/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaPackageFragment.kt index 92780632491..f49fd5d1365 100644 --- a/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaPackageFragment.kt +++ b/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaPackageFragment.kt @@ -23,6 +23,7 @@ import org.jetbrains.kotlin.load.java.structure.JavaClass import org.jetbrains.kotlin.load.java.structure.JavaPackage import org.jetbrains.kotlin.load.kotlin.KotlinJvmBinarySourceElement import org.jetbrains.kotlin.load.kotlin.PackageClassUtils +import org.jetbrains.kotlin.storage.getValue import org.jetbrains.kotlin.storage.get class LazyJavaPackageFragment( diff --git a/core/descriptors/src/org/jetbrains/kotlin/builtins/ReflectionTypes.kt b/core/descriptors/src/org/jetbrains/kotlin/builtins/ReflectionTypes.kt index 5f70886408b..bbfd34113b5 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/builtins/ReflectionTypes.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/builtins/ReflectionTypes.kt @@ -42,7 +42,8 @@ public class ReflectionTypes(private val module: ModuleDescriptor) { } private object ClassLookup { - fun get(types: ReflectionTypes, property: PropertyMetadata): ClassDescriptor { + fun get(types: ReflectionTypes, property: PropertyMetadata) = getValue(types, property) + fun getValue(types: ReflectionTypes, property: PropertyMetadata): ClassDescriptor { return types.find(property.name.capitalize()) } } diff --git a/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/LazyPackageViewDescriptorImpl.kt b/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/LazyPackageViewDescriptorImpl.kt index 9d70597e7a7..e5ed542db6e 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/LazyPackageViewDescriptorImpl.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/LazyPackageViewDescriptorImpl.kt @@ -26,6 +26,7 @@ import org.jetbrains.kotlin.resolve.scopes.ChainedScope import org.jetbrains.kotlin.resolve.scopes.JetScope import org.jetbrains.kotlin.resolve.scopes.LazyScopeAdapter import org.jetbrains.kotlin.storage.StorageManager +import org.jetbrains.kotlin.storage.getValue import org.jetbrains.kotlin.storage.get import org.jetbrains.kotlin.types.TypeSubstitutor diff --git a/core/deserialization/src/org/jetbrains/kotlin/serialization/deserialization/DeserializedPackageFragment.kt b/core/deserialization/src/org/jetbrains/kotlin/serialization/deserialization/DeserializedPackageFragment.kt index 65cacf4637b..e1690258d51 100644 --- a/core/deserialization/src/org/jetbrains/kotlin/serialization/deserialization/DeserializedPackageFragment.kt +++ b/core/deserialization/src/org/jetbrains/kotlin/serialization/deserialization/DeserializedPackageFragment.kt @@ -24,6 +24,7 @@ import org.jetbrains.kotlin.serialization.ProtoBuf import org.jetbrains.kotlin.serialization.SerializedResourcePaths import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedPackageMemberScope import org.jetbrains.kotlin.storage.StorageManager +import org.jetbrains.kotlin.storage.getValue import org.jetbrains.kotlin.storage.get import java.io.InputStream import javax.inject.Inject diff --git a/core/deserialization/src/org/jetbrains/kotlin/serialization/deserialization/descriptors/DeserializedPackageMemberScope.kt b/core/deserialization/src/org/jetbrains/kotlin/serialization/deserialization/descriptors/DeserializedPackageMemberScope.kt index f9486b0f355..cdb453f33da 100644 --- a/core/deserialization/src/org/jetbrains/kotlin/serialization/deserialization/descriptors/DeserializedPackageMemberScope.kt +++ b/core/deserialization/src/org/jetbrains/kotlin/serialization/deserialization/descriptors/DeserializedPackageMemberScope.kt @@ -29,6 +29,7 @@ import org.jetbrains.kotlin.resolve.scopes.DescriptorKindFilter import org.jetbrains.kotlin.serialization.ProtoBuf import org.jetbrains.kotlin.serialization.deserialization.DeserializationComponents import org.jetbrains.kotlin.serialization.deserialization.NameResolver +import org.jetbrains.kotlin.storage.getValue import org.jetbrains.kotlin.storage.get import org.jetbrains.kotlin.utils.addIfNotNull diff --git a/core/util.runtime/src/org/jetbrains/kotlin/storage/storage.kt b/core/util.runtime/src/org/jetbrains/kotlin/storage/storage.kt index cc03af591c2..feb1fe60c1f 100644 --- a/core/util.runtime/src/org/jetbrains/kotlin/storage/storage.kt +++ b/core/util.runtime/src/org/jetbrains/kotlin/storage/storage.kt @@ -35,3 +35,7 @@ public interface NullableLazyValue : Function0 { public fun NotNullLazyValue.get(_this: Any?, p: PropertyMetadata): T = invoke() public fun NullableLazyValue.get(_this: Any?, p: PropertyMetadata): T? = invoke() + +public fun NotNullLazyValue.getValue(_this: Any?, p: PropertyMetadata): T = invoke() + +public fun NullableLazyValue.getValue(_this: Any?, p: PropertyMetadata): T? = invoke() diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/search/usagesSearch/conventions.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/search/usagesSearch/conventions.kt index 43810d28721..48ef09f8fd2 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/search/usagesSearch/conventions.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/search/usagesSearch/conventions.kt @@ -40,6 +40,8 @@ public val ALL_SEARCHABLE_OPERATIONS: ImmutableSet = ImmutableSet public val INDEXING_OPERATION_NAMES = setOf(OperatorNameConventions.GET, OperatorNameConventions.SET) +public val DELEGATE_ACCESSOR_NAMES = setOf(Name.identifier("getValue"), Name.identifier("setValue")) + public val IN_OPERATIONS_TO_SEARCH = setOf(JetTokens.IN_KEYWORD) public val COMPARISON_OPERATIONS_TO_SEARCH = setOf(JetTokens.LT, JetTokens.GT) @@ -51,7 +53,8 @@ public fun Name.getOperationSymbolsToSearch(): Set { OperatorNameConventions.IDENTITY_EQUALS -> return IDENTITY_EQUALS_OPERATIONS OperatorNameConventions.CONTAINS -> return IN_OPERATIONS_TO_SEARCH OperatorNameConventions.ITERATOR -> return IN_OPERATIONS_TO_SEARCH - in INDEXING_OPERATION_NAMES -> return setOf(JetTokens.LBRACKET, JetTokens.BY_KEYWORD) + in INDEXING_OPERATION_NAMES -> return setOf(JetTokens.LBRACKET) + in DELEGATE_ACCESSOR_NAMES -> return setOf(JetTokens.BY_KEYWORD) DelegatedPropertyResolver.PROPERTY_DELEGATED_FUNCTION_NAME -> return setOf(JetTokens.BY_KEYWORD) } diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/createCallable/CreatePropertyDelegateAccessorsActionFactory.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/createCallable/CreatePropertyDelegateAccessorsActionFactory.kt index 342989ce155..b3976bee822 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/createCallable/CreatePropertyDelegateAccessorsActionFactory.kt +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/createCallable/CreatePropertyDelegateAccessorsActionFactory.kt @@ -60,7 +60,7 @@ object CreatePropertyDelegateAccessorsActionFactory : CreateCallableMemberFromUs if (isApplicableForAccessor(propertyDescriptor.getter)) { val getterInfo = FunctionInfo( - name = "get", + name = "getValue", receiverTypeInfo = accessorReceiverType, returnTypeInfo = TypeInfo(propertyType, Variance.OUT_VARIANCE), parameterInfos = listOf(thisRefParam, metadataParam) @@ -71,7 +71,7 @@ object CreatePropertyDelegateAccessorsActionFactory : CreateCallableMemberFromUs if (propertyDescriptor.isVar && isApplicableForAccessor(propertyDescriptor.setter)) { val newValueParam = ParameterInfo(TypeInfo(propertyType, Variance.IN_VARIANCE)) val setterInfo = FunctionInfo( - name = "set", + name = "setValue", receiverTypeInfo = accessorReceiverType, returnTypeInfo = TypeInfo(builtIns.unitType, Variance.OUT_VARIANCE), parameterInfos = listOf(thisRefParam, metadataParam, newValueParam) diff --git a/idea/testData/checker/Variance.kt b/idea/testData/checker/Variance.kt index dab5c218c43..42f2903a26c 100644 --- a/idea/testData/checker/Variance.kt +++ b/idea/testData/checker/Variance.kt @@ -19,8 +19,8 @@ fun foo(c: Consumer, p: Producer, u: Usual) { //Arrays copy example class Array(val length : Int, val t : T) { - fun get(index : Int) : T { return t } - fun set(index : Int, value : T) { /* ... */ } + fun get(index : Int) : T { return t } + fun set(index : Int, value : T) { /* ... */ } } fun copy1(from : Array, to : Array) {} diff --git a/idea/testData/checker/infos/CapturedConstructorParameter.kt b/idea/testData/checker/infos/CapturedConstructorParameter.kt index b2f46824663..0b7d3a65051 100644 --- a/idea/testData/checker/infos/CapturedConstructorParameter.kt +++ b/idea/testData/checker/infos/CapturedConstructorParameter.kt @@ -5,7 +5,7 @@ class T1(t: Int): T class Delegate(d: Int) { - fun get(k: Any, m: PropertyMetadata) {} + fun getValue(k: Any, m: PropertyMetadata) {} } class A(y: Int, t: Int, d: Int): T by T1(t) { diff --git a/idea/testData/checker/regression/Jet169.kt b/idea/testData/checker/regression/Jet169.kt index 7787764d323..e38e1eb9a05 100644 --- a/idea/testData/checker/regression/Jet169.kt +++ b/idea/testData/checker/regression/Jet169.kt @@ -1,4 +1,4 @@ -fun set(key : String, value : String) { +fun set(key : String, value : String) { val a : String? = "" when (a) { "" -> a.get(0) diff --git a/idea/testData/copyPaste/imports/DelegatedProperty.expected.kt b/idea/testData/copyPaste/imports/DelegatedProperty.expected.kt index 0465b247c8b..f766bb6f321 100644 --- a/idea/testData/copyPaste/imports/DelegatedProperty.expected.kt +++ b/idea/testData/copyPaste/imports/DelegatedProperty.expected.kt @@ -1,8 +1,8 @@ package to import a.A -import a.get -import a.set +import a.getValue +import a.setValue class B { var v by A() diff --git a/idea/testData/copyPaste/imports/DelegatedProperty.expected.names b/idea/testData/copyPaste/imports/DelegatedProperty.expected.names index 9781ae0f479..bdbbd851683 100644 --- a/idea/testData/copyPaste/imports/DelegatedProperty.expected.names +++ b/idea/testData/copyPaste/imports/DelegatedProperty.expected.names @@ -1,3 +1,3 @@ a.A -a.get -a.set +a.getValue +a.setValue \ No newline at end of file diff --git a/idea/testData/copyPaste/imports/DelegatedProperty.kt b/idea/testData/copyPaste/imports/DelegatedProperty.kt index c0afed6f5d4..f611d855f6d 100644 --- a/idea/testData/copyPaste/imports/DelegatedProperty.kt +++ b/idea/testData/copyPaste/imports/DelegatedProperty.kt @@ -3,11 +3,11 @@ package a interface T -fun T.get(thisRef: B, desc: PropertyMetadata): Int { +fun T.getValue(thisRef: B, desc: PropertyMetadata): Int { return 3 } -fun T.set(thisRef: B, desc: PropertyMetadata, value: Int) { +fun T.setValue(thisRef: B, desc: PropertyMetadata, value: Int) { } class A(): T diff --git a/idea/testData/debugger/smartStepInto/delegatedPropertyGetter.kt b/idea/testData/debugger/smartStepInto/delegatedPropertyGetter.kt index 2eb161d5b31..5c569e4a3ff 100644 --- a/idea/testData/debugger/smartStepInto/delegatedPropertyGetter.kt +++ b/idea/testData/debugger/smartStepInto/delegatedPropertyGetter.kt @@ -5,7 +5,7 @@ fun foo() { val a by Delegate() class Delegate { - fun get(t: Any?, p: PropertyMetadata) = 1 + fun getValue(t: Any?, p: PropertyMetadata) = 1 } -// EXISTS: a.get(Any?\, PropertyMetadata) \ No newline at end of file +// EXISTS: a.getValue(Any?\, PropertyMetadata) \ No newline at end of file diff --git a/idea/testData/debugger/tinyApp/outs/delegatedPropertyInClass.out b/idea/testData/debugger/tinyApp/outs/delegatedPropertyInClass.out index 0e22ee3d2c7..404501fbefd 100644 --- a/idea/testData/debugger/tinyApp/outs/delegatedPropertyInClass.out +++ b/idea/testData/debugger/tinyApp/outs/delegatedPropertyInClass.out @@ -18,11 +18,11 @@ class A { } class MyDelegate { - fun get(t: Any?, p: PropertyMetadata): Int = 1 + fun getValue(t: Any?, p: PropertyMetadata): Int = 1 } class MyDelegateThrowsException { - fun get(t: Any?, p: PropertyMetadata): Int = throw IllegalStateException() + fun getValue(t: Any?, p: PropertyMetadata): Int = throw IllegalStateException() } // PRINT_FRAME diff --git a/idea/testData/debugger/tinyApp/outs/delegatedPropertyInClassWoRenderer.out b/idea/testData/debugger/tinyApp/outs/delegatedPropertyInClassWoRenderer.out index c22d404cae0..eea11862157 100644 --- a/idea/testData/debugger/tinyApp/outs/delegatedPropertyInClassWoRenderer.out +++ b/idea/testData/debugger/tinyApp/outs/delegatedPropertyInClassWoRenderer.out @@ -17,7 +17,7 @@ class A { } class MyDelegate { - fun get(t: Any?, p: PropertyMetadata): Int = 1 + fun getValue(t: Any?, p: PropertyMetadata): Int = 1 } // RENDER_DELEGATED_PROPERTIES: false diff --git a/idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/dependentOnFile.kt b/idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/dependentOnFile.kt index 50eea80ceed..8a7f16bf5c7 100644 --- a/idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/dependentOnFile.kt +++ b/idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/dependentOnFile.kt @@ -25,7 +25,7 @@ val Int.testExtVal: Int get() = 1 val testDelVal by Delegate() class Delegate { - fun get(a: Any?, b: PropertyMetadata) = 1 + fun getValue(a: Any?, b: PropertyMetadata) = 1 } // EXPRESSION: TestClass().testFun() diff --git a/idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/delegatedPropertyInClass.kt b/idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/delegatedPropertyInClass.kt index 21332e8857f..2392f75de7f 100644 --- a/idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/delegatedPropertyInClass.kt +++ b/idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/delegatedPropertyInClass.kt @@ -14,11 +14,11 @@ class A { } class MyDelegate { - fun get(t: Any?, p: PropertyMetadata): Int = 1 + fun getValue(t: Any?, p: PropertyMetadata): Int = 1 } class MyDelegateThrowsException { - fun get(t: Any?, p: PropertyMetadata): Int = throw IllegalStateException() + fun getValue(t: Any?, p: PropertyMetadata): Int = throw IllegalStateException() } // PRINT_FRAME \ No newline at end of file diff --git a/idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/delegatedPropertyInClassWoRenderer.kt b/idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/delegatedPropertyInClassWoRenderer.kt index 87af258f0af..f3c463425b8 100644 --- a/idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/delegatedPropertyInClassWoRenderer.kt +++ b/idea/testData/debugger/tinyApp/src/evaluate/singleBreakpoint/frame/delegatedPropertyInClassWoRenderer.kt @@ -13,7 +13,7 @@ class A { } class MyDelegate { - fun get(t: Any?, p: PropertyMetadata): Int = 1 + fun getValue(t: Any?, p: PropertyMetadata): Int = 1 } // RENDER_DELEGATED_PROPERTIES: false diff --git a/idea/testData/findUsages/kotlin/conventions/getAsPropertyDelegate.0.kt b/idea/testData/findUsages/kotlin/conventions/getAsPropertyDelegate.0.kt index 7658b5113fa..3cb2de1e66b 100644 --- a/idea/testData/findUsages/kotlin/conventions/getAsPropertyDelegate.0.kt +++ b/idea/testData/findUsages/kotlin/conventions/getAsPropertyDelegate.0.kt @@ -2,7 +2,7 @@ // OPTIONS: usages class Delegate() { - fun get(thisRef: Any?, propertyMetadata: PropertyMetadata): String = ":)" + fun getValue(thisRef: Any?, propertyMetadata: PropertyMetadata): String = ":)" } val p: String by Delegate() diff --git a/idea/testData/findUsages/kotlin/conventions/propertyDelegatedFunction.0.kt b/idea/testData/findUsages/kotlin/conventions/propertyDelegatedFunction.0.kt index bcc3c4cf974..cc2342c8719 100644 --- a/idea/testData/findUsages/kotlin/conventions/propertyDelegatedFunction.0.kt +++ b/idea/testData/findUsages/kotlin/conventions/propertyDelegatedFunction.0.kt @@ -2,8 +2,8 @@ // OPTIONS: usages class Delegate() { - fun get(thisRef: Any?, propertyMetadata: PropertyMetadata): String = ":)" - fun set(thisRef: Any?, propertyMetadata: PropertyMetadata, value: String) { + fun getValue(thisRef: Any?, propertyMetadata: PropertyMetadata): String = ":)" + fun setValue(thisRef: Any?, propertyMetadata: PropertyMetadata, value: String) { } fun propertyDelegated(propertyMetadata: PropertyMetadata) { diff --git a/idea/testData/findUsages/kotlin/conventions/setAsPropertyDelegate.0.kt b/idea/testData/findUsages/kotlin/conventions/setAsPropertyDelegate.0.kt index e99ec5194b9..eb15ea19806 100644 --- a/idea/testData/findUsages/kotlin/conventions/setAsPropertyDelegate.0.kt +++ b/idea/testData/findUsages/kotlin/conventions/setAsPropertyDelegate.0.kt @@ -2,8 +2,8 @@ // OPTIONS: usages class Delegate() { - fun get(thisRef: Any?, propertyMetadata: PropertyMetadata): String = ":)" - fun set(thisRef: Any?, propertyMetadata: PropertyMetadata, value: String) { + fun getValue(thisRef: Any?, propertyMetadata: PropertyMetadata): String = ":)" + fun setValue(thisRef: Any?, propertyMetadata: PropertyMetadata, value: String) { } } diff --git a/idea/testData/inspections/unusedReceiverParameter/delegatedProperty.kt b/idea/testData/inspections/unusedReceiverParameter/delegatedProperty.kt index fef31003424..5382407818e 100644 --- a/idea/testData/inspections/unusedReceiverParameter/delegatedProperty.kt +++ b/idea/testData/inspections/unusedReceiverParameter/delegatedProperty.kt @@ -1,5 +1,5 @@ class MyProperty { - fun get(thisRef: Any?, desc: PropertyMetadata) = ":)" + fun getValue(thisRef: Any?, desc: PropertyMetadata) = ":)" } val Any.ext by MyProperty() diff --git a/idea/testData/javaFacade/ea46019.kt b/idea/testData/javaFacade/ea46019.kt index 3ad65c81733..635691a7a5a 100644 --- a/idea/testData/javaFacade/ea46019.kt +++ b/idea/testData/javaFacade/ea46019.kt @@ -1,5 +1,5 @@ class SomeProp() { - fun get(t: Any, metadata: PropertyMetadataImpl) = 42 + fun getValue(t: Any, metadata: PropertyMetadataImpl) = 42 } class Some() { diff --git a/idea/testData/quickfix/createFromUsage/createClass/callExpression/callInMemberValDelegateRuntime.kt b/idea/testData/quickfix/createFromUsage/createClass/callExpression/callInMemberValDelegateRuntime.kt index 6c3d2967448..d3423195d9b 100644 --- a/idea/testData/quickfix/createFromUsage/createClass/callExpression/callInMemberValDelegateRuntime.kt +++ b/idea/testData/quickfix/createFromUsage/createClass/callExpression/callInMemberValDelegateRuntime.kt @@ -1,5 +1,4 @@ // "Create class 'Foo'" "true" -// ERROR: Class 'Foo' must be declared abstract or implement abstract member
public abstract fun get(thisRef: A<T>, property: kotlin.PropertyMetadata): B defined in kotlin.properties.ReadOnlyProperty open class B diff --git a/idea/testData/quickfix/createFromUsage/createClass/callExpression/callInMemberValDelegateRuntime.kt.after b/idea/testData/quickfix/createFromUsage/createClass/callExpression/callInMemberValDelegateRuntime.kt.after index 6e7cb7ad977..057481cfe5c 100644 --- a/idea/testData/quickfix/createFromUsage/createClass/callExpression/callInMemberValDelegateRuntime.kt.after +++ b/idea/testData/quickfix/createFromUsage/createClass/callExpression/callInMemberValDelegateRuntime.kt.after @@ -1,7 +1,6 @@ import kotlin.properties.ReadOnlyProperty // "Create class 'Foo'" "true" -// ERROR: Class 'Foo' must be declared abstract or implement abstract member
public abstract fun get(thisRef: A<T>, property: kotlin.PropertyMetadata): B defined in kotlin.properties.ReadOnlyProperty open class B diff --git a/idea/testData/quickfix/createFromUsage/createClass/callExpression/callWithJavaQualifierInMemberValDelegate.after.Dependency.java b/idea/testData/quickfix/createFromUsage/createClass/callExpression/callWithJavaQualifierInMemberValDelegate.after.Dependency.java index 6d2bfab3862..80b798de288 100644 --- a/idea/testData/quickfix/createFromUsage/createClass/callExpression/callWithJavaQualifierInMemberValDelegate.after.Dependency.java +++ b/idea/testData/quickfix/createFromUsage/createClass/callExpression/callWithJavaQualifierInMemberValDelegate.after.Dependency.java @@ -1,3 +1,5 @@ +import kotlin.Deprecated; +import kotlin.PropertyMetadata; import kotlin.properties.ReadOnlyProperty; import org.jetbrains.annotations.NotNull; @@ -6,5 +8,16 @@ class J { public static class Foo implements ReadOnlyProperty, B> { public Foo(T t, @NotNull String s) { } + + @NotNull + @Deprecated + public B get(@NotNull A thisRef, @NotNull PropertyMetadata property) { + return null; + } + + @NotNull + public B getValue(@NotNull A thisRef, @NotNull PropertyMetadata property) { + return null; + } } } \ No newline at end of file diff --git a/idea/testData/quickfix/createFromUsage/createFunction/delegateAccessors/val.kt b/idea/testData/quickfix/createFromUsage/createFunction/delegateAccessors/val.kt index 70b8871021e..94154830c5b 100644 --- a/idea/testData/quickfix/createFromUsage/createFunction/delegateAccessors/val.kt +++ b/idea/testData/quickfix/createFromUsage/createFunction/delegateAccessors/val.kt @@ -1,4 +1,4 @@ -// "Create member function 'get'" "true" +// "Create member function 'getValue'" "true" class F { } diff --git a/idea/testData/quickfix/createFromUsage/createFunction/delegateAccessors/val.kt.after b/idea/testData/quickfix/createFromUsage/createFunction/delegateAccessors/val.kt.after index 46745b9c59e..5beaafcd4e0 100644 --- a/idea/testData/quickfix/createFromUsage/createFunction/delegateAccessors/val.kt.after +++ b/idea/testData/quickfix/createFromUsage/createFunction/delegateAccessors/val.kt.after @@ -1,6 +1,6 @@ -// "Create member function 'get'" "true" +// "Create member function 'getValue'" "true" class F { - fun get(x: X, propertyMetadata: PropertyMetadata): Int { + fun getValue(x: X, propertyMetadata: PropertyMetadata): Int { throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates. } diff --git a/idea/testData/quickfix/createFromUsage/createFunction/delegateAccessors/var.kt b/idea/testData/quickfix/createFromUsage/createFunction/delegateAccessors/var.kt index 2acca7f06a8..964ff7116fa 100644 --- a/idea/testData/quickfix/createFromUsage/createFunction/delegateAccessors/var.kt +++ b/idea/testData/quickfix/createFromUsage/createFunction/delegateAccessors/var.kt @@ -1,4 +1,4 @@ -// "Create member function 'get', function 'set'" "true" +// "Create member function 'getValue', function 'set'" "true" class F { } diff --git a/idea/testData/quickfix/createFromUsage/createFunction/delegateAccessors/var.kt.after b/idea/testData/quickfix/createFromUsage/createFunction/delegateAccessors/var.kt.after index 8e664066cb0..9ad6d0ef495 100644 --- a/idea/testData/quickfix/createFromUsage/createFunction/delegateAccessors/var.kt.after +++ b/idea/testData/quickfix/createFromUsage/createFunction/delegateAccessors/var.kt.after @@ -1,10 +1,10 @@ -// "Create member function 'get', function 'set'" "true" +// "Create member function 'getValue', function 'setValue'" "true" class F { - fun get(x: X, propertyMetadata: PropertyMetadata): Int { + fun getValue(x: X, propertyMetadata: PropertyMetadata): Int { throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates. } - fun set(x: X, propertyMetadata: PropertyMetadata, i: Int) { + fun setValue(x: X, propertyMetadata: PropertyMetadata, i: Int) { throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates. } diff --git a/idea/testData/quickfix/createFromUsage/createFunction/delegateAccessors/varMissingGet.kt b/idea/testData/quickfix/createFromUsage/createFunction/delegateAccessors/varMissingGet.kt index 68e1f8305a2..0c677772264 100644 --- a/idea/testData/quickfix/createFromUsage/createFunction/delegateAccessors/varMissingGet.kt +++ b/idea/testData/quickfix/createFromUsage/createFunction/delegateAccessors/varMissingGet.kt @@ -1,6 +1,6 @@ -// "Create member function 'get'" "true" +// "Create member function 'getValue'" "true" class F { - fun set(x: X, propertyMetadata: PropertyMetadata, i: Int) { } + fun setValue(x: X, propertyMetadata: PropertyMetadata, i: Int) { } } class X { diff --git a/idea/testData/quickfix/createFromUsage/createFunction/delegateAccessors/varMissingGet.kt.after b/idea/testData/quickfix/createFromUsage/createFunction/delegateAccessors/varMissingGet.kt.after index 477ad22d25a..a8661a71626 100644 --- a/idea/testData/quickfix/createFromUsage/createFunction/delegateAccessors/varMissingGet.kt.after +++ b/idea/testData/quickfix/createFromUsage/createFunction/delegateAccessors/varMissingGet.kt.after @@ -1,8 +1,8 @@ -// "Create member function 'get'" "true" +// "Create member function 'getValue'" "true" class F { - fun set(x: X, propertyMetadata: PropertyMetadata, i: Int) { } + fun setValue(x: X, propertyMetadata: PropertyMetadata, i: Int) { } - fun get(x: X, propertyMetadata: PropertyMetadata): Int { + fun getValue(x: X, propertyMetadata: PropertyMetadata): Int { throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates. } } diff --git a/idea/testData/quickfix/createFromUsage/createFunction/delegateAccessors/varMissingSet.kt b/idea/testData/quickfix/createFromUsage/createFunction/delegateAccessors/varMissingSet.kt index 6d9dc820e90..8e62eaf3802 100644 --- a/idea/testData/quickfix/createFromUsage/createFunction/delegateAccessors/varMissingSet.kt +++ b/idea/testData/quickfix/createFromUsage/createFunction/delegateAccessors/varMissingSet.kt @@ -1,6 +1,6 @@ -// "Create member function 'set'" "true" +// "Create member function 'setValue'" "true" class F { - fun get(x: X, propertyMetadata: PropertyMetadata): Int = 1 + fun getValue(x: X, propertyMetadata: PropertyMetadata): Int = 1 } class X { diff --git a/idea/testData/quickfix/createFromUsage/createFunction/delegateAccessors/varMissingSet.kt.after b/idea/testData/quickfix/createFromUsage/createFunction/delegateAccessors/varMissingSet.kt.after index 7b3eaa3a09a..7d4020e6a45 100644 --- a/idea/testData/quickfix/createFromUsage/createFunction/delegateAccessors/varMissingSet.kt.after +++ b/idea/testData/quickfix/createFromUsage/createFunction/delegateAccessors/varMissingSet.kt.after @@ -1,4 +1,4 @@ -// "Create member function 'set'" "true" +// "Create member function 'setValue'" "true" class F { fun get(x: X, propertyMetadata: PropertyMetadata): Int = 1 diff --git a/idea/testData/resolve/referenceWithLib/delegatedPropertyWithTypeParameters.kt b/idea/testData/resolve/referenceWithLib/delegatedPropertyWithTypeParameters.kt index 3d71d239baf..60b5ebc1859 100644 --- a/idea/testData/resolve/referenceWithLib/delegatedPropertyWithTypeParameters.kt +++ b/idea/testData/resolve/referenceWithLib/delegatedPropertyWithTypeParameters.kt @@ -9,5 +9,5 @@ class B { } // MULTIRESOLVE -// REF: (for T in dependency).get(R,kotlin.PropertyMetadata) -// REF: (for T in dependency).set(R,kotlin.PropertyMetadata,kotlin.Int) +// REF: (for T in dependency).getValue(R,kotlin.PropertyMetadata) +// REF: (for T in dependency).setValue(R,kotlin.PropertyMetadata,kotlin.Int) diff --git a/idea/testData/resolve/referenceWithLib/delegatedPropertyWithTypeParametersSrc/delegatedPropertyWithTypeParametersDependency.kt b/idea/testData/resolve/referenceWithLib/delegatedPropertyWithTypeParametersSrc/delegatedPropertyWithTypeParametersDependency.kt index bf014f3d1f3..53a5a26a493 100644 --- a/idea/testData/resolve/referenceWithLib/delegatedPropertyWithTypeParametersSrc/delegatedPropertyWithTypeParametersDependency.kt +++ b/idea/testData/resolve/referenceWithLib/delegatedPropertyWithTypeParametersSrc/delegatedPropertyWithTypeParametersDependency.kt @@ -1,8 +1,8 @@ package dependency -public fun T.get(thisRef: R, desc: PropertyMetadata): Int { +public fun T.getValue(thisRef: R, desc: PropertyMetadata): Int { return 3 } -public fun T.set(thisRef: R, desc: PropertyMetadata, value: Int) { +public fun T.setValue(thisRef: R, desc: PropertyMetadata, value: Int) { } diff --git a/idea/testData/resolve/references/delegatedPropertyAccessors/inSource/getExtension.kt b/idea/testData/resolve/references/delegatedPropertyAccessors/inSource/getExtension.kt index 9ff570a7eb0..385b6b9c8a8 100644 --- a/idea/testData/resolve/references/delegatedPropertyAccessors/inSource/getExtension.kt +++ b/idea/testData/resolve/references/delegatedPropertyAccessors/inSource/getExtension.kt @@ -2,7 +2,7 @@ val x: Int by Foo() class Foo -fun Foo.get(_this: Any?, p: Any?): Int = 1 +fun Foo.getValue(_this: Any?, p: Any?): Int = 1 -// REF: (for Foo in ).get(Any?,Any?) +// REF: (for Foo in ).getValue(Any?,Any?) diff --git a/idea/testData/resolve/references/delegatedPropertyAccessors/inSource/getMember.kt b/idea/testData/resolve/references/delegatedPropertyAccessors/inSource/getMember.kt index b825581f234..bfcddb494f5 100644 --- a/idea/testData/resolve/references/delegatedPropertyAccessors/inSource/getMember.kt +++ b/idea/testData/resolve/references/delegatedPropertyAccessors/inSource/getMember.kt @@ -1,8 +1,8 @@ val x: Int by Foo() class Foo { - fun get(_this: Any?, p: Any?): Int = 1 + fun getValue(_this: Any?, p: Any?): Int = 1 } -// REF: (in Foo).get(Any?,Any?) +// REF: (in Foo).getValue(Any?,Any?) diff --git a/idea/testData/resolve/references/delegatedPropertyAccessors/inSource/getMultipleDeclarations.kt b/idea/testData/resolve/references/delegatedPropertyAccessors/inSource/getMultipleDeclarations.kt index 11a6cbff382..4e1c44b0fbc 100644 --- a/idea/testData/resolve/references/delegatedPropertyAccessors/inSource/getMultipleDeclarations.kt +++ b/idea/testData/resolve/references/delegatedPropertyAccessors/inSource/getMultipleDeclarations.kt @@ -1,20 +1,20 @@ var x : Int by Baz() interface Foo { - fun get(p1: Any?, p2: Any?): Int = 1 + fun getValue(p1: Any?, p2: Any?): Int = 1 } interface Bar { - fun get(p1: Any?, p2: Any?): Int + fun getValue(p1: Any?, p2: Any?): Int } interface Zoo { - fun set(p1: Any?, p2: Any?, p3: Any?) + fun setValue(p1: Any?, p2: Any?, p3: Any?) } class Baz: Foo, Bar, Zoo // MULTIRESOLVE -// REF: (in Bar).get(Any?,Any?) -// REF: (in Foo).get(Any?,Any?) -// REF: (in Zoo).set(Any?,Any?,Any?) +// REF: (in Bar).getValue(Any?,Any?) +// REF: (in Foo).getValue(Any?,Any?) +// REF: (in Zoo).setValue(Any?,Any?,Any?) diff --git a/idea/testData/resolve/references/delegatedPropertyAccessors/inSource/getOneFakeOverride.kt b/idea/testData/resolve/references/delegatedPropertyAccessors/inSource/getOneFakeOverride.kt index 7e2391d83ea..30c79f5cdf3 100644 --- a/idea/testData/resolve/references/delegatedPropertyAccessors/inSource/getOneFakeOverride.kt +++ b/idea/testData/resolve/references/delegatedPropertyAccessors/inSource/getOneFakeOverride.kt @@ -1,9 +1,9 @@ var x : Int by Baz() interface Foo { - fun get(p1: Any?, p2: Any?): Int = 1 + fun getValue(p1: Any?, p2: Any?): Int = 1 } class Baz: Foo -// REF: (in Foo).get(Any?,Any?) \ No newline at end of file +// REF: (in Foo).getValue(Any?,Any?) \ No newline at end of file diff --git a/idea/testData/resolve/references/delegatedPropertyAccessors/inSource/getSetPropertyDelegatedExtension.kt b/idea/testData/resolve/references/delegatedPropertyAccessors/inSource/getSetPropertyDelegatedExtension.kt index 135b7f5b5ea..ea59155c013 100644 --- a/idea/testData/resolve/references/delegatedPropertyAccessors/inSource/getSetPropertyDelegatedExtension.kt +++ b/idea/testData/resolve/references/delegatedPropertyAccessors/inSource/getSetPropertyDelegatedExtension.kt @@ -2,12 +2,12 @@ var x: Int by Foo() class Foo -fun Foo.get(_this: Any?, p: Any?): Int = 1 -fun Foo.set(_this: Any?, p: Any?, val: Any?) {} +fun Foo.getValue(_this: Any?, p: Any?): Int = 1 +fun Foo.setValue(_this: Any?, p: Any?, val: Any?) {} fun Foo.propertyDelegated(p: Any?) {} // MULTIRESOLVE -// REF: (for Foo in ).get(Any?,Any?) -// REF: (for Foo in ).set(Any?,Any?,Any?) +// REF: (for Foo in ).getValue(Any?,Any?) +// REF: (for Foo in ).setValue(Any?,Any?,Any?) // REF: (for Foo in ).propertyDelegated(Any?) diff --git a/idea/testData/resolve/references/delegatedPropertyAccessors/inSource/getSetPropertyDelegatedMember.kt b/idea/testData/resolve/references/delegatedPropertyAccessors/inSource/getSetPropertyDelegatedMember.kt index aec464d291c..a014579da5e 100644 --- a/idea/testData/resolve/references/delegatedPropertyAccessors/inSource/getSetPropertyDelegatedMember.kt +++ b/idea/testData/resolve/references/delegatedPropertyAccessors/inSource/getSetPropertyDelegatedMember.kt @@ -1,13 +1,13 @@ var x: Int by Foo() class Foo { - fun get(_this: Any?, p: Any?): Int = 1 - fun set(_this: Any?, p: Any?, val: Any?) {} + fun getValue(_this: Any?, p: Any?): Int = 1 + fun setValue(_this: Any?, p: Any?, val: Any?) {} fun propertyDelegated(p: Any?) } // MULTIRESOLVE -// REF: (in Foo).get(Any?,Any?) -// REF: (in Foo).set(Any?,Any?,Any?) +// REF: (in Foo).getValue(Any?,Any?) +// REF: (in Foo).setValue(Any?,Any?,Any?) // REF: (in Foo).propertyDelegated(Any?) diff --git a/idea/testData/resolve/references/delegatedPropertyAccessors/inStandardLibrary/lazy.kt b/idea/testData/resolve/references/delegatedPropertyAccessors/inStandardLibrary/lazy.kt index bbde85a0d9d..521e1b771cf 100644 --- a/idea/testData/resolve/references/delegatedPropertyAccessors/inStandardLibrary/lazy.kt +++ b/idea/testData/resolve/references/delegatedPropertyAccessors/inStandardLibrary/lazy.kt @@ -2,4 +2,4 @@ import kotlin.properties.Delegates val x: Int by Delegates.lazy {1} -// REF: (in kotlin.properties.ReadOnlyProperty).get(R,kotlin.PropertyMetadata) \ No newline at end of file +// REF: (in kotlin.properties.ReadOnlyProperty).getValue(R,kotlin.PropertyMetadata) \ No newline at end of file diff --git a/idea/testData/resolve/references/delegatedPropertyAccessors/inStandardLibrary/notNull.kt b/idea/testData/resolve/references/delegatedPropertyAccessors/inStandardLibrary/notNull.kt index e22e3c058de..05e54cff5f9 100644 --- a/idea/testData/resolve/references/delegatedPropertyAccessors/inStandardLibrary/notNull.kt +++ b/idea/testData/resolve/references/delegatedPropertyAccessors/inStandardLibrary/notNull.kt @@ -3,5 +3,5 @@ import kotlin.properties.Delegates var x: Int by Delegates.notNull() // MULTIRESOLVE -// REF: (in kotlin.properties.ReadWriteProperty).get(R,kotlin.PropertyMetadata) -// REF: (in kotlin.properties.ReadWriteProperty).set(R,kotlin.PropertyMetadata,T) \ No newline at end of file +// REF: (in kotlin.properties.ReadWriteProperty).getValue(R,kotlin.PropertyMetadata) +// REF: (in kotlin.properties.ReadWriteProperty).setValue(R,kotlin.PropertyMetadata,T) \ No newline at end of file diff --git a/jps-plugin/testData/incremental/lookupTracker/conventions/delegateProperty.kt b/jps-plugin/testData/incremental/lookupTracker/conventions/delegateProperty.kt index 073c7bfbcb7..b6595d9bbbb 100644 --- a/jps-plugin/testData/incremental/lookupTracker/conventions/delegateProperty.kt +++ b/jps-plugin/testData/incremental/lookupTracker/conventions/delegateProperty.kt @@ -18,11 +18,11 @@ package foo.bar } -/*p:foo.bar*/val x1 by /*p:foo.bar c:foo.bar.D1(get) c:foo.bar.D1(propertyDelegated) p:foo.bar(propertyDelegated)*/D1() -/*p:foo.bar*/var y1 by /*p:foo.bar c:foo.bar.D1(get) c:foo.bar.D1(set) p:foo.bar(set) c:foo.bar.D1(propertyDelegated) p:foo.bar(propertyDelegated)*/D1() +/*p:foo.bar*/val x1 by /*p:foo.bar c:foo.bar.D1(getValue) p:foo.bar(getValue) c:foo.bar.D1(get) c:foo.bar.D1(propertyDelegated) p:foo.bar(propertyDelegated)*/D1() +/*p:foo.bar*/var y1 by /*p:foo.bar c:foo.bar.D1(getValue) p:foo.bar(getValue) c:foo.bar.D1(get) c:foo.bar.D1(setValue) p:foo.bar(setValue) c:foo.bar.D1(set) p:foo.bar(set) c:foo.bar.D1(propertyDelegated) p:foo.bar(propertyDelegated)*/D1() -/*p:foo.bar*/val x2 by /*p:foo.bar c:foo.bar.D2(get) p:foo.bar(get) c:foo.bar.D2(propertyDelegated) p:foo.bar(propertyDelegated)*/D2() -/*p:foo.bar*/var y2 by /*p:foo.bar c:foo.bar.D2(get) p:foo.bar(get) c:foo.bar.D2(set) c:foo.bar.D2(propertyDelegated) p:foo.bar(propertyDelegated)*/D2() +/*p:foo.bar*/val x2 by /*p:foo.bar c:foo.bar.D2(getValue) p:foo.bar(getValue) c:foo.bar.D2(get) p:foo.bar(get) c:foo.bar.D2(propertyDelegated) p:foo.bar(propertyDelegated)*/D2() +/*p:foo.bar*/var y2 by /*p:foo.bar c:foo.bar.D2(getValue) p:foo.bar(getValue) c:foo.bar.D2(get) p:foo.bar(get) c:foo.bar.D2(setValue) p:foo.bar(setValue) c:foo.bar.D2(set) c:foo.bar.D2(propertyDelegated) p:foo.bar(propertyDelegated)*/D2() -/*p:foo.bar*/val x3 by /*p:foo.bar c:foo.bar.D3(get) p:foo.bar(get) c:foo.bar.D3(propertyDelegated)*/D3() -/*p:foo.bar*/var y3 by /*p:foo.bar c:foo.bar.D3(get) p:foo.bar(get) c:foo.bar.D3(set) c:foo.bar.D3(propertyDelegated)*/D3() +/*p:foo.bar*/val x3 by /*p:foo.bar c:foo.bar.D3(getValue) p:foo.bar(getValue) c:foo.bar.D3(get) p:foo.bar(get) c:foo.bar.D3(propertyDelegated)*/D3() +/*p:foo.bar*/var y3 by /*p:foo.bar c:foo.bar.D3(getValue) p:foo.bar(getValue) c:foo.bar.D3(get) p:foo.bar(get) c:foo.bar.D3(setValue) p:foo.bar(setValue) c:foo.bar.D3(set) c:foo.bar.D3(propertyDelegated)*/D3() diff --git a/jps-plugin/testData/incremental/pureKotlin/delegatedPropertyInlineExtensionAccessor/inlineGet.kt b/jps-plugin/testData/incremental/pureKotlin/delegatedPropertyInlineExtensionAccessor/inlineGet.kt index 405ef2eef20..1277c339dca 100644 --- a/jps-plugin/testData/incremental/pureKotlin/delegatedPropertyInlineExtensionAccessor/inlineGet.kt +++ b/jps-plugin/testData/incremental/pureKotlin/delegatedPropertyInlineExtensionAccessor/inlineGet.kt @@ -1,5 +1,5 @@ package inline -inline fun Inline.get(receiver: Any?, prop: PropertyMetadata): Int { +inline fun Inline.getValue(receiver: Any?, prop: PropertyMetadata): Int { return 0 } \ No newline at end of file diff --git a/jps-plugin/testData/incremental/pureKotlin/delegatedPropertyInlineExtensionAccessor/inlineGet.kt.new.1 b/jps-plugin/testData/incremental/pureKotlin/delegatedPropertyInlineExtensionAccessor/inlineGet.kt.new.1 index efc57e7afd9..3ed00a5f3b1 100644 --- a/jps-plugin/testData/incremental/pureKotlin/delegatedPropertyInlineExtensionAccessor/inlineGet.kt.new.1 +++ b/jps-plugin/testData/incremental/pureKotlin/delegatedPropertyInlineExtensionAccessor/inlineGet.kt.new.1 @@ -1,5 +1,5 @@ package inline -inline fun Inline.get(receiver: Any?, prop: PropertyMetadata): Int { +inline fun Inline.getValue(receiver: Any?, prop: PropertyMetadata): Int { return 1 } \ No newline at end of file diff --git a/jps-plugin/testData/incremental/pureKotlin/delegatedPropertyInlineExtensionAccessor/inlineSet.kt b/jps-plugin/testData/incremental/pureKotlin/delegatedPropertyInlineExtensionAccessor/inlineSet.kt index ffebce91d6a..0a9a76e7be4 100644 --- a/jps-plugin/testData/incremental/pureKotlin/delegatedPropertyInlineExtensionAccessor/inlineSet.kt +++ b/jps-plugin/testData/incremental/pureKotlin/delegatedPropertyInlineExtensionAccessor/inlineSet.kt @@ -1,5 +1,5 @@ package inline -inline fun Inline.set(receiver: Any?, prop: PropertyMetadata, value: Int) { +inline fun Inline.setValue(receiver: Any?, prop: PropertyMetadata, value: Int) { println(value) } \ No newline at end of file diff --git a/jps-plugin/testData/incremental/pureKotlin/delegatedPropertyInlineExtensionAccessor/inlineSet.kt.new.2 b/jps-plugin/testData/incremental/pureKotlin/delegatedPropertyInlineExtensionAccessor/inlineSet.kt.new.2 index 4eda0b9b94e..446a5ad574c 100644 --- a/jps-plugin/testData/incremental/pureKotlin/delegatedPropertyInlineExtensionAccessor/inlineSet.kt.new.2 +++ b/jps-plugin/testData/incremental/pureKotlin/delegatedPropertyInlineExtensionAccessor/inlineSet.kt.new.2 @@ -1,5 +1,5 @@ package inline -inline fun Inline.set(receiver: Any?, prop: PropertyMetadata, value: Int) { +inline fun Inline.setValue(receiver: Any?, prop: PropertyMetadata, value: Int) { println(value * 2) } \ No newline at end of file diff --git a/jps-plugin/testData/incremental/pureKotlin/delegatedPropertyInlineMethodAccessor/inline.kt b/jps-plugin/testData/incremental/pureKotlin/delegatedPropertyInlineMethodAccessor/inline.kt index 5840d17a8a3..470f1f47d05 100644 --- a/jps-plugin/testData/incremental/pureKotlin/delegatedPropertyInlineMethodAccessor/inline.kt +++ b/jps-plugin/testData/incremental/pureKotlin/delegatedPropertyInlineMethodAccessor/inline.kt @@ -1,11 +1,11 @@ package inline class Inline { - inline fun get(receiver: Any?, prop: PropertyMetadata): Int { + inline fun getValue(receiver: Any?, prop: PropertyMetadata): Int { return 0 } - inline fun set(receiver: Any?, prop: PropertyMetadata, value: Int) { + inline fun setValue(receiver: Any?, prop: PropertyMetadata, value: Int) { println(value) } } \ No newline at end of file diff --git a/jps-plugin/testData/incremental/pureKotlin/delegatedPropertyInlineMethodAccessor/inline.kt.new.1 b/jps-plugin/testData/incremental/pureKotlin/delegatedPropertyInlineMethodAccessor/inline.kt.new.1 index bb80da599b8..49af798d65d 100644 --- a/jps-plugin/testData/incremental/pureKotlin/delegatedPropertyInlineMethodAccessor/inline.kt.new.1 +++ b/jps-plugin/testData/incremental/pureKotlin/delegatedPropertyInlineMethodAccessor/inline.kt.new.1 @@ -1,11 +1,11 @@ package inline class Inline { - inline fun get(receiver: Any?, prop: PropertyMetadata): Int { + inline fun getValue(receiver: Any?, prop: PropertyMetadata): Int { return 1 } - inline fun set(receiver: Any?, prop: PropertyMetadata, value: Int) { + inline fun setValue(receiver: Any?, prop: PropertyMetadata, value: Int) { println(value) } } \ No newline at end of file diff --git a/jps-plugin/testData/incremental/pureKotlin/delegatedPropertyInlineMethodAccessor/inline.kt.new.2 b/jps-plugin/testData/incremental/pureKotlin/delegatedPropertyInlineMethodAccessor/inline.kt.new.2 index 17180968e7a..d0a03b3014f 100644 --- a/jps-plugin/testData/incremental/pureKotlin/delegatedPropertyInlineMethodAccessor/inline.kt.new.2 +++ b/jps-plugin/testData/incremental/pureKotlin/delegatedPropertyInlineMethodAccessor/inline.kt.new.2 @@ -1,11 +1,11 @@ package inline class Inline { - inline fun get(receiver: Any?, prop: PropertyMetadata): Int { + inline fun getValue(receiver: Any?, prop: PropertyMetadata): Int { return 1 } - inline fun set(receiver: Any?, prop: PropertyMetadata, value: Int) { + inline fun setValue(receiver: Any?, prop: PropertyMetadata, value: Int) { println(value * 2) } } \ No newline at end of file diff --git a/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/metadata/MetadataProperty.kt b/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/metadata/MetadataProperty.kt index f9b5f0a3120..e0ea8e7350a 100644 --- a/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/metadata/MetadataProperty.kt +++ b/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/metadata/MetadataProperty.kt @@ -17,12 +17,15 @@ package com.google.dart.compiler.backend.js.ast.metadata internal class MetadataProperty(val default: R) { - fun get(thisRef: T, desc: PropertyMetadata): R { + fun get(thisRef: T, desc: kotlin.PropertyMetadata) = getValue(thisRef, desc) + fun set(thisRef: T, desc: kotlin.PropertyMetadata, value: R) = setValue(thisRef, desc, value) + + fun getValue(thisRef: T, desc: PropertyMetadata): R { if (!thisRef.hasData(desc.name)) return default return thisRef.getData(desc.name) } - fun set(thisRef: T, desc: PropertyMetadata, value: R) { + fun setValue(thisRef: T, desc: PropertyMetadata, value: R) { thisRef.setData(desc.name, value) } } diff --git a/js/js.translator/testData/callableReference/property/cases/delegated.kt b/js/js.translator/testData/callableReference/property/cases/delegated.kt index 580027960ee..022a1df7878 100644 --- a/js/js.translator/testData/callableReference/property/cases/delegated.kt +++ b/js/js.translator/testData/callableReference/property/cases/delegated.kt @@ -2,7 +2,7 @@ package foo object NumberDecrypter { - fun get(instance: Any?, data: PropertyMetadata) = when (data.name) { + fun getValue(instance: Any?, data: PropertyMetadata) = when (data.name) { "four" -> 4 "two" -> 2 else -> throw Exception() diff --git a/js/js.translator/testData/callableReference/property/cases/delegatedMutable.kt b/js/js.translator/testData/callableReference/property/cases/delegatedMutable.kt index f8c963122ee..2377b2f49ba 100644 --- a/js/js.translator/testData/callableReference/property/cases/delegatedMutable.kt +++ b/js/js.translator/testData/callableReference/property/cases/delegatedMutable.kt @@ -4,11 +4,11 @@ package foo object Delegate { var value = "lol" - fun get(instance: Any?, data: PropertyMetadata): String { + fun getValue(instance: Any?, data: PropertyMetadata): String { return value } - fun set(instance: Any?, data: PropertyMetadata, newValue: String) { + fun setValue(instance: Any?, data: PropertyMetadata, newValue: String) { value = newValue } } diff --git a/js/js.translator/testData/delegateProperty/cases/delegateByExtensionProperty.kt b/js/js.translator/testData/delegateProperty/cases/delegateByExtensionProperty.kt index 3bbb06ab9b9..2617739320c 100644 --- a/js/js.translator/testData/delegateProperty/cases/delegateByExtensionProperty.kt +++ b/js/js.translator/testData/delegateProperty/cases/delegateByExtensionProperty.kt @@ -8,12 +8,12 @@ fun format(event: String, property: String, value: Int): String object LoggerDelegate { var log = "" - fun get(state: State, desc: PropertyMetadata): Int { + fun getValue(state: State, desc: PropertyMetadata): Int { log += format("get", desc.name, state.realValue) return state.realValue } - fun set(state: State, desc: PropertyMetadata, value: Int) { + fun setValue(state: State, desc: PropertyMetadata, value: Int) { log += format("set", desc.name, value) state.realValue = value } diff --git a/js/js.translator/testData/delegateProperty/cases/delegateByTopLevelFun.kt b/js/js.translator/testData/delegateProperty/cases/delegateByTopLevelFun.kt index 84ab3f7aa28..c1b0ae7abd9 100644 --- a/js/js.translator/testData/delegateProperty/cases/delegateByTopLevelFun.kt +++ b/js/js.translator/testData/delegateProperty/cases/delegateByTopLevelFun.kt @@ -2,8 +2,8 @@ package foo class Delegate { var inner = 1 - fun get(t: Any?, p: PropertyMetadata): Int = inner - fun set(t: Any?, p: PropertyMetadata, i: Int) { + fun getValue(t: Any?, p: PropertyMetadata): Int = inner + fun setValue(t: Any?, p: PropertyMetadata, i: Int) { inner = i } } diff --git a/js/js.translator/testData/delegateProperty/cases/delegateByTopLevelProperty.kt b/js/js.translator/testData/delegateProperty/cases/delegateByTopLevelProperty.kt index 32445b6a0db..1b1ab624dc2 100644 --- a/js/js.translator/testData/delegateProperty/cases/delegateByTopLevelProperty.kt +++ b/js/js.translator/testData/delegateProperty/cases/delegateByTopLevelProperty.kt @@ -2,8 +2,8 @@ package foo class Delegate { var inner = 1 - fun get(t: Any?, p: PropertyMetadata): Int = inner - fun set(t: Any?, p: PropertyMetadata, i: Int) { + fun getValue(t: Any?, p: PropertyMetadata): Int = inner + fun setValue(t: Any?, p: PropertyMetadata, i: Int) { inner = i } } diff --git a/js/js.translator/testData/delegateProperty/cases/delegateWithPropertyAccess.kt b/js/js.translator/testData/delegateProperty/cases/delegateWithPropertyAccess.kt index 32445b6a0db..1b1ab624dc2 100644 --- a/js/js.translator/testData/delegateProperty/cases/delegateWithPropertyAccess.kt +++ b/js/js.translator/testData/delegateProperty/cases/delegateWithPropertyAccess.kt @@ -2,8 +2,8 @@ package foo class Delegate { var inner = 1 - fun get(t: Any?, p: PropertyMetadata): Int = inner - fun set(t: Any?, p: PropertyMetadata, i: Int) { + fun getValue(t: Any?, p: PropertyMetadata): Int = inner + fun setValue(t: Any?, p: PropertyMetadata, i: Int) { inner = i } } diff --git a/js/js.translator/testData/delegateProperty/cases/getAsExtensionFun.kt b/js/js.translator/testData/delegateProperty/cases/getAsExtensionFun.kt index 27be81e3b06..efadd927492 100644 --- a/js/js.translator/testData/delegateProperty/cases/getAsExtensionFun.kt +++ b/js/js.translator/testData/delegateProperty/cases/getAsExtensionFun.kt @@ -3,7 +3,7 @@ package foo class Delegate { } -fun Delegate.get(t: Any?, p: PropertyMetadata): Int = 1 +fun Delegate.getValue(t: Any?, p: PropertyMetadata): Int = 1 class A { val prop: Int by Delegate() diff --git a/js/js.translator/testData/delegateProperty/cases/propertyMetadata.kt b/js/js.translator/testData/delegateProperty/cases/propertyMetadata.kt index 5ae43c8ad8b..a8ad362ea62 100644 --- a/js/js.translator/testData/delegateProperty/cases/propertyMetadata.kt +++ b/js/js.translator/testData/delegateProperty/cases/propertyMetadata.kt @@ -5,10 +5,10 @@ interface WithName { } class GetPropertyName() { - fun get(withName: WithName, property: PropertyMetadata): String { + fun getValue(withName: WithName, property: PropertyMetadata): String { return withName.name + ":" + property.name; } - fun set(withName: WithName, property: PropertyMetadata, value: String) { + fun setValue(withName: WithName, property: PropertyMetadata, value: String) { withName.name = value + ":" + property.name } } diff --git a/js/js.translator/testData/delegateProperty/cases/setAsExtensionFun.kt b/js/js.translator/testData/delegateProperty/cases/setAsExtensionFun.kt index c3421858206..5d4009c9959 100644 --- a/js/js.translator/testData/delegateProperty/cases/setAsExtensionFun.kt +++ b/js/js.translator/testData/delegateProperty/cases/setAsExtensionFun.kt @@ -2,10 +2,10 @@ package foo class Delegate { var inner = 1 - fun get(t: Any?, p: PropertyMetadata): Int = inner + fun getValue(t: Any?, p: PropertyMetadata): Int = inner } -fun Delegate.set(t: Any?, p: PropertyMetadata, i: Int) { +fun Delegate.setValue(t: Any?, p: PropertyMetadata, i: Int) { inner = i } diff --git a/js/js.translator/testData/delegateProperty/cases/simple.kt b/js/js.translator/testData/delegateProperty/cases/simple.kt index ce4982a2af6..b17646253dc 100644 --- a/js/js.translator/testData/delegateProperty/cases/simple.kt +++ b/js/js.translator/testData/delegateProperty/cases/simple.kt @@ -5,10 +5,10 @@ interface WithNumber { } class IncNumber(val inc: Int) { - fun get(withNumber: WithNumber, property: PropertyMetadata): Int { + fun getValue(withNumber: WithNumber, property: PropertyMetadata): Int { return withNumber.number + inc; } - fun set(withNumber: WithNumber, property: PropertyMetadata, value: Int) { + fun setValue(withNumber: WithNumber, property: PropertyMetadata, value: Int) { withNumber.number = value; } } diff --git a/js/js.translator/testData/delegateProperty/cases/topLevelVal.kt b/js/js.translator/testData/delegateProperty/cases/topLevelVal.kt index c234f1af8f3..aab1c8b213d 100644 --- a/js/js.translator/testData/delegateProperty/cases/topLevelVal.kt +++ b/js/js.translator/testData/delegateProperty/cases/topLevelVal.kt @@ -1,7 +1,7 @@ package foo class Delegate { - fun get(t: Any?, p: PropertyMetadata): Int = 1 + fun getValue(t: Any?, p: PropertyMetadata): Int = 1 } val prop: Int by Delegate() diff --git a/js/js.translator/testData/delegateProperty/cases/topLevelVar.kt b/js/js.translator/testData/delegateProperty/cases/topLevelVar.kt index c38bdd0706e..8b5af1611a6 100644 --- a/js/js.translator/testData/delegateProperty/cases/topLevelVar.kt +++ b/js/js.translator/testData/delegateProperty/cases/topLevelVar.kt @@ -2,8 +2,8 @@ package foo class Delegate { var inner = 1 - fun get(t: Any?, p: PropertyMetadata): Int = inner - fun set(t: Any?, p: PropertyMetadata, i: Int) { + fun getValue(t: Any?, p: PropertyMetadata): Int = inner + fun setValue(t: Any?, p: PropertyMetadata, i: Int) { inner = i } } diff --git a/js/js.translator/testData/delegateProperty/cases/withGenerics.kt b/js/js.translator/testData/delegateProperty/cases/withGenerics.kt index b55c221ed2f..4aec5485bc0 100644 --- a/js/js.translator/testData/delegateProperty/cases/withGenerics.kt +++ b/js/js.translator/testData/delegateProperty/cases/withGenerics.kt @@ -6,13 +6,13 @@ interface Getter { class Delegate(val getter: Getter) { var t: T? = null - fun get(obj: Any, property: PropertyMetadata): T { + fun getValue(obj: Any, property: PropertyMetadata): T { if (t != null) { return t!! } return getter.get() } - fun set(obj: Any, property: PropertyMetadata, value: T) { + fun setValue(obj: Any, property: PropertyMetadata, value: T) { t = value } } diff --git a/js/js.translator/testData/delegation/cases/delegationExtensionPropertyDelegated.kt b/js/js.translator/testData/delegation/cases/delegationExtensionPropertyDelegated.kt index b49157aa65d..b5710319340 100644 --- a/js/js.translator/testData/delegation/cases/delegationExtensionPropertyDelegated.kt +++ b/js/js.translator/testData/delegation/cases/delegationExtensionPropertyDelegated.kt @@ -7,9 +7,9 @@ interface Base { } class Delegate(val multiplier: Int) { - fun get(state: State, desc: PropertyMetadata): Int = multiplier * state.value + fun getValue(state: State, desc: PropertyMetadata): Int = multiplier * state.value - fun set(state: State, desc: PropertyMetadata, value: Int) { + fun setValue(state: State, desc: PropertyMetadata, value: Int) { state.value = value / multiplier } diff --git a/libraries/stdlib/src/kotlin/properties/Delegation.kt b/libraries/stdlib/src/kotlin/properties/Delegation.kt index 91eeab0c598..6e0dd3e0daa 100644 --- a/libraries/stdlib/src/kotlin/properties/Delegation.kt +++ b/libraries/stdlib/src/kotlin/properties/Delegation.kt @@ -115,11 +115,11 @@ public object Delegates { private class NotNullVar() : ReadWriteProperty { private var value: T? = null - public override fun get(thisRef: Any?, property: PropertyMetadata): T { + public override fun getValue(thisRef: Any?, property: PropertyMetadata): T { return value ?: throw IllegalStateException("Property ${property.name} should be initialized before get.") } - public override fun set(thisRef: Any?, property: PropertyMetadata, value: T) { + public override fun setValue(thisRef: Any?, property: PropertyMetadata, value: T) { this.value = value } } @@ -152,11 +152,11 @@ public abstract class ObservableProperty(initialValue: T) : ReadWriteProperty */ protected open fun afterChange (property: PropertyMetadata, oldValue: T, newValue: T): Unit {} - public override fun get(thisRef: Any?, property: PropertyMetadata): T { + public override fun getValue(thisRef: Any?, property: PropertyMetadata): T { return value } - public override fun set(thisRef: Any?, property: PropertyMetadata, value: T) { + public override fun setValue(thisRef: Any?, property: PropertyMetadata, value: T) { val oldValue = this.value if (!beforeChange(property, oldValue, value)) { return @@ -179,7 +179,7 @@ private fun unescape(value: Any?): Any? { private class LazyVal(private val initializer: () -> T) : ReadOnlyProperty { private var value: Any? = null - public override fun get(thisRef: Any?, property: PropertyMetadata): T { + public override fun getValue(thisRef: Any?, property: PropertyMetadata): T { if (value == null) { value = escape(initializer()) } @@ -191,7 +191,7 @@ private class BlockingLazyVal(lock: Any?, private val initializer: () -> T) : private val lock = lock ?: this @Volatile private var value: Any? = null - public override fun get(thisRef: Any?, property: PropertyMetadata): T { + public override fun getValue(thisRef: Any?, property: PropertyMetadata): T { val _v1 = value if (_v1 != null) { return unescape(_v1) as T @@ -239,7 +239,7 @@ public abstract class MapVal() : ReadOnlyProperty { throw NoSuchElementException("The value for property ${property.name} is missing in $ref.") } - public override fun get(thisRef: T, property: PropertyMetadata) : V { + public override fun getValue(thisRef: T, property: PropertyMetadata) : V { val map = map(thisRef) val key = key(property) return map.getOrElse(key, { default(thisRef, property) }) as V @@ -255,10 +255,16 @@ public abstract class MapVal() : ReadOnlyProperty { public abstract class MapVar() : MapVal(), ReadWriteProperty { protected abstract override fun map(ref: T): MutableMap - public override fun set(thisRef: T, property: PropertyMetadata, value: V) { + public override fun setValue(thisRef: T, property: PropertyMetadata, value: V) { val map = map(thisRef) map.put(key(property), value) } + + override fun get(thisRef: T, property: PropertyMetadata) = getValue(thisRef, property) + + override fun getValue(thisRef: T, property: PropertyMetadata): V { + return super.getValue(thisRef, property) + } } private val propertyNameSelector: (PropertyMetadata) -> String = {it.name} diff --git a/libraries/stdlib/src/kotlin/properties/Interfaces.kt b/libraries/stdlib/src/kotlin/properties/Interfaces.kt index 0e35b538484..518c8f220a9 100644 --- a/libraries/stdlib/src/kotlin/properties/Interfaces.kt +++ b/libraries/stdlib/src/kotlin/properties/Interfaces.kt @@ -17,7 +17,11 @@ public interface ReadOnlyProperty { * @param property the metadata for the property. * @return the property value. */ - public fun get(thisRef: R, property: PropertyMetadata): T + public fun getValue(thisRef: R, property: PropertyMetadata): T = get(thisRef, property) + + //TODO drop after bootstrap + @Deprecated("Use getValue() instead.", ReplaceWith("getValue(thisRef, property)")) + public fun get(thisRef: R, property: PropertyMetadata): T = getValue(thisRef, property) } /** @@ -36,7 +40,11 @@ public interface ReadWriteProperty { * @param property the metadata for the property. * @return the property value. */ - public fun get(thisRef: R, property: PropertyMetadata): T + public fun getValue(thisRef: R, property: PropertyMetadata): T = get(thisRef, property) + + //TODO drop after bootstrap + @Deprecated("Use getValue() instead.", ReplaceWith("getValue(thisRef, property)")) + public fun get(thisRef: R, property: PropertyMetadata): T = getValue(thisRef, property) /** * Sets the value of the property for the given object. @@ -44,5 +52,11 @@ public interface ReadWriteProperty { * @param property the metadata for the property. * @param value the value to set. */ - public fun set(thisRef: R, property: PropertyMetadata, value: T) + public fun setValue(thisRef: R, property: PropertyMetadata, value: T) { + set(thisRef, property, value) + } + + //TODO drop after bootstrap + @Deprecated("Use setValue() instead.", ReplaceWith("setValue(thisRef, property, value)")) + public fun set(thisRef: R, property: PropertyMetadata, value: T) = setValue(thisRef, property, value) } diff --git a/libraries/stdlib/src/kotlin/properties/MapAccessors.kt b/libraries/stdlib/src/kotlin/properties/MapAccessors.kt index 93f0568985e..591617cb847 100644 --- a/libraries/stdlib/src/kotlin/properties/MapAccessors.kt +++ b/libraries/stdlib/src/kotlin/properties/MapAccessors.kt @@ -11,6 +11,9 @@ package kotlin.properties * * @throws NoSuchElementException when the map doesn't contain value for the property name and doesn't provide an implicit default (see [withDefault]). */ +public fun Map.getValue(thisRef: Any?, property: PropertyMetadata): V = getOrImplicitDefault(property.name) as V + +@Deprecated("Use getValue() instead") public fun Map.get(thisRef: Any?, property: PropertyMetadata): V = getOrImplicitDefault(property.name) as V /** @@ -22,6 +25,10 @@ public fun Map.get(thisRef: Any?, property: PropertyMetadata): * @throws NoSuchElementException when the map doesn't contain value for the property name and doesn't provide an implicit default (see [withDefault]). */ @kotlin.jvm.JvmName("getVar") +public fun MutableMap.getValue(thisRef: Any?, property: PropertyMetadata): V = getOrImplicitDefault(property.name) as V + +@Deprecated("Use getValue() instead") +@kotlin.jvm.JvmName("getVarDeprecated") public fun MutableMap.get(thisRef: Any?, property: PropertyMetadata): V = getOrImplicitDefault(property.name) as V /** @@ -30,6 +37,11 @@ public fun MutableMap.get(thisRef: Any?, property: Property * @param property the metadata for the property, used to get the name of property and store the value associated with that name in the map. * @param value the value to set. */ +public fun MutableMap.setValue(thisRef: Any?, property: PropertyMetadata, value: V) { + this.put(property.name, value) +} + +@Deprecated("Use setValue() instead") public fun MutableMap.set(thisRef: Any?, property: PropertyMetadata, value: V) { this.put(property.name, value) } diff --git a/libraries/stdlib/src/kotlin/util/Lazy.kt b/libraries/stdlib/src/kotlin/util/Lazy.kt index d4fe98c1dbe..507c9702e83 100644 --- a/libraries/stdlib/src/kotlin/util/Lazy.kt +++ b/libraries/stdlib/src/kotlin/util/Lazy.kt @@ -74,6 +74,9 @@ public fun lazy(lock: Any?, initializer: () -> T): Lazy = SynchronizedLazy * This extension allows to use instances of Lazy for property delegation: * `val property: String by lazy { initializer }` */ +public fun Lazy.getValue(thisRef: Any?, property: PropertyMetadata): T = value + +@Deprecated("Use getValue() instead") public fun Lazy.get(thisRef: Any?, property: PropertyMetadata): T = value /**