Replace get() and set() to getValue() and setValue() (property delegates)
This commit is contained in:
-1
@@ -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
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -542,6 +542,7 @@ public interface Errors {
|
||||
DiagnosticFactory1<PsiElement, Collection<? extends ResolvedCall<?>>> ITERATOR_AMBIGUITY = DiagnosticFactory1.create(ERROR);
|
||||
|
||||
DiagnosticFactory2<JetExpression, String, JetType> DELEGATE_SPECIAL_FUNCTION_MISSING = DiagnosticFactory2.create(ERROR);
|
||||
DiagnosticFactory3<JetExpression, FunctionDescriptor, JetType, String> DELEGATE_RESOLVED_TO_DEPRECATED_CONVENTION = DiagnosticFactory3.create(WARNING);
|
||||
DiagnosticFactory2<JetExpression, String, Collection<? extends ResolvedCall<?>>> DELEGATE_SPECIAL_FUNCTION_AMBIGUITY = DiagnosticFactory2.create(ERROR);
|
||||
DiagnosticFactory2<JetExpression, String, Collection<? extends ResolvedCall<?>>> DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE = DiagnosticFactory2.create(ERROR);
|
||||
DiagnosticFactory3<JetExpression, String, JetType, JetType> DELEGATE_SPECIAL_FUNCTION_RETURN_TYPE_MISMATCH = DiagnosticFactory3.create(ERROR);
|
||||
|
||||
+1
@@ -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);
|
||||
|
||||
@@ -21,32 +21,41 @@ import com.intellij.openapi.util.Key
|
||||
import com.intellij.openapi.util.UserDataHolder
|
||||
import com.intellij.psi.PsiElement
|
||||
|
||||
public class UserDataProperty<in R: UserDataHolder, T : Any>(val key: Key<T>, val default: T? = null) : ReadWriteProperty<R, T?> {
|
||||
override fun get(thisRef: R, desc: kotlin.PropertyMetadata): T? {
|
||||
public class UserDataProperty<in R: UserDataHolder, T : Any>(val key: Key<T>, 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<in R: UserDataHolder, T : Any>(val key: Key<T>, val defaultValue: T) : ReadWriteProperty<R, T> {
|
||||
override fun get(thisRef: R, desc: kotlin.PropertyMetadata): T {
|
||||
public class NotNullableUserDataProperty<in R: UserDataHolder, T : Any>(val key: Key<T>, 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<in R: PsiElement, T : Any>(val key: Key<T>, val default: T? = null) : ReadWriteProperty<R, T?> {
|
||||
override fun get(thisRef: R, property: PropertyMetadata): T? {
|
||||
public class CopyableUserDataProperty<in R: PsiElement, T : Any>(val key: Key<T>, 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)
|
||||
}
|
||||
}
|
||||
@@ -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<FunctionDescriptor> 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<ValueParameterDescriptor> valueParameters = accessor.getValueParameters();
|
||||
trace.record(REFERENCE_TARGET, fakeArgument, valueParameters.get(0));
|
||||
@@ -265,8 +268,24 @@ public class DelegatedPropertyResolver {
|
||||
Pair<Call, OverloadResolutionResults<FunctionDescriptor>> resolutionResult =
|
||||
fakeCallResolver.makeAndResolveFakeCallInContext(receiver, context, arguments, functionName, delegateExpression);
|
||||
|
||||
OverloadResolutionResults<FunctionDescriptor> 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<Call, OverloadResolutionResults<FunctionDescriptor>> 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) {
|
||||
|
||||
+4
-4
@@ -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:
|
||||
<SINK> PREV:[<ERROR>, <END>]
|
||||
=====================
|
||||
== get ==
|
||||
fun get(_this: Nothing?, p: PropertyMetadata): Int = 0
|
||||
== getValue ==
|
||||
fun getValue(_this: Nothing?, p: PropertyMetadata): Int = 0
|
||||
---------------------
|
||||
L0:
|
||||
1 <START>
|
||||
@@ -62,4 +62,4 @@ error:
|
||||
<ERROR> PREV:[]
|
||||
sink:
|
||||
<SINK> PREV:[<ERROR>, <END>]
|
||||
=====================
|
||||
=====================
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
---------------------
|
||||
<v0>: {<: Nothing?} NEW: magic[FAKE_INITIALIZER](_this: Nothing?) -> <v0>
|
||||
<v1>: {<: PropertyMetadata} NEW: magic[FAKE_INITIALIZER](p: PropertyMetadata) -> <v1>
|
||||
|
||||
+1
-1
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -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 {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Delegate {
|
||||
fun get(t: Any?, p: PropertyMetadata): Int = 1
|
||||
fun getValue(t: Any?, p: PropertyMetadata): Int = 1
|
||||
}
|
||||
|
||||
class AImpl {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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 }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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()
|
||||
|
||||
+2
-2
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
+1
-1
@@ -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 {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class Delegate<T>(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 {
|
||||
|
||||
@@ -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()
|
||||
|
||||
+1
-1
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Delegate {
|
||||
fun get(t: Any?, p: PropertyMetadata): Int = 1
|
||||
fun getValue(t: Any?, p: PropertyMetadata): Int = 1
|
||||
}
|
||||
|
||||
class A {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Delegate {
|
||||
fun get(t: Any?, p: PropertyMetadata): Int = 1
|
||||
fun getValue(t: Any?, p: PropertyMetadata): Int = 1
|
||||
}
|
||||
|
||||
interface A {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class Delegate<T>(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 {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class Delegate<T>(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 }
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
+1
-1
@@ -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" }
|
||||
}
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -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 }
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -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 }
|
||||
}
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -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 }
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -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 }
|
||||
}
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -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 }
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -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 }
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -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 }
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -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" }
|
||||
|
||||
Vendored
+1
-1
@@ -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 }
|
||||
|
||||
+1
-1
@@ -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 }
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -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 }
|
||||
}
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -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++ }
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -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 }
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -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 }
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ val Int.foo: String by O
|
||||
object O {
|
||||
val metadatas = HashSet<PropertyMetadata>()
|
||||
|
||||
fun get(t: Any?, p: PropertyMetadata): String {
|
||||
fun getValue(t: Any?, p: PropertyMetadata): String {
|
||||
metadatas.add(p)
|
||||
return ""
|
||||
}
|
||||
|
||||
+6
-6
@@ -17,18 +17,18 @@ val metadatas = IdentityHashMap<PropertyMetadata, Unit>()
|
||||
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 {
|
||||
|
||||
@@ -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()
|
||||
|
||||
+2
-2
@@ -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()
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Delegate<T>(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<A> { t -> t.foo() }
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Delegate {
|
||||
fun get(t: Any?, p: PropertyMetadata): Int = 1
|
||||
fun getValue(t: Any?, p: PropertyMetadata): Int = 1
|
||||
}
|
||||
|
||||
class A {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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()
|
||||
|
||||
+2
-2
@@ -1,14 +1,14 @@
|
||||
public open class TestDelegate<T: Any>(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
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
class D {
|
||||
fun get(a: Any, p: PropertyMetadata) { }
|
||||
fun getValue(a: Any, p: PropertyMetadata) { }
|
||||
}
|
||||
|
||||
object P {
|
||||
|
||||
+2
-2
@@ -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<T: Comparable<T>> {
|
||||
|
||||
+2
-2
@@ -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<T>(){
|
||||
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()
|
||||
|
||||
+2
-2
@@ -2,11 +2,11 @@
|
||||
|
||||
var currentAccountId: Int? by SessionAccessor()
|
||||
class SessionAccessor<T> {
|
||||
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) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -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 {
|
||||
|
||||
+1
-1
@@ -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()
|
||||
|
||||
+2
-2
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ val <T> Value<T>.additionalText by DVal(Value<T>::text) //works
|
||||
val <T> Value<T>.additionalValue by DVal(Value<T>::value) //not work
|
||||
|
||||
class DVal<T, R, P: KProperty1<T, R>>(val kmember: P) {
|
||||
fun get(t: T, p: PropertyMetadata): R {
|
||||
fun getValue(t: T, p: PropertyMetadata): R {
|
||||
return kmember.get(t)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ class Project {
|
||||
}
|
||||
}
|
||||
|
||||
inline fun <reified T : Any> Project.get(t: Any?, p: PropertyMetadata): T = getInstance(javaClass<T>())
|
||||
inline fun <reified T : Any> Project.getValue(t: Any?, p: PropertyMetadata): T = getInstance(javaClass<T>())
|
||||
|
||||
val project = Project()
|
||||
val x1: Int by project
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
+51
@@ -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 <!DELEGATE_RESOLVED_TO_DEPRECATED_CONVENTION, DELEGATE_RESOLVED_TO_DEPRECATED_CONVENTION!>CustomDelegate()<!>
|
||||
val aval by <!DELEGATE_RESOLVED_TO_DEPRECATED_CONVENTION!>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) {}
|
||||
|
||||
}
|
||||
+59
@@ -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
|
||||
}
|
||||
+1
-1
@@ -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<T: Any, V: String?>(<!INAPPLICABLE_LATEINIT_MODIFIER_PRIMARY_CONSTRUCTOR_PARAMETER!>lateinit<!> var p2: String) {
|
||||
|
||||
+1
-1
@@ -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
|
||||
}
|
||||
|
||||
+4
-4
@@ -14,17 +14,17 @@ fun f(a: Int, b: Int, <!UNUSED_PARAMETER!>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(<!UNUSED_PARAMETER!>p<!>: Any) {
|
||||
}
|
||||
|
||||
fun set(p: Any) {
|
||||
fun set(<!UNUSED_PARAMETER!>p<!>: Any) {
|
||||
}
|
||||
|
||||
fun foo(s: String) {
|
||||
|
||||
@@ -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)
|
||||
|
||||
+3
-3
@@ -19,8 +19,8 @@ fun foo(c: Consumer<Int>, p: Producer<Int>, u: Usual<Int>) {
|
||||
|
||||
//Arrays copy example
|
||||
class Array<T>(val length : Int, val t : T) {
|
||||
fun get(index : Int) : T { return t }
|
||||
fun set(index : Int, value : T) { /* ... */ }
|
||||
fun get(<!UNUSED_PARAMETER!>index<!> : Int) : T { return t }
|
||||
fun set(<!UNUSED_PARAMETER!>index<!> : Int, <!UNUSED_PARAMETER!>value<!> : T) { /* ... */ }
|
||||
}
|
||||
|
||||
fun copy1(<!UNUSED_PARAMETER!>from<!> : Array<Any>, <!UNUSED_PARAMETER!>to<!> : Array<Any>) {}
|
||||
@@ -37,4 +37,4 @@ fun f(ints: Array<Int>, any: Array<Any>, numbers: Array<Number>) {
|
||||
copy2(ints, <!TYPE_MISMATCH!>numbers<!>)
|
||||
copy3<Int>(ints, numbers)
|
||||
copy4(ints, numbers) //ok
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -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
|
||||
}
|
||||
|
||||
<!INAPPLICABLE_TARGET_ON_PROPERTY, WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@field:Ann<!>
|
||||
|
||||
+1
-1
@@ -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
|
||||
}
|
||||
|
||||
+1
-1
@@ -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
|
||||
}
|
||||
|
||||
<!INAPPLICABLE_TARGET_ON_PROPERTY, WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@get:Ann<!>
|
||||
|
||||
+1
-1
@@ -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
|
||||
}
|
||||
|
||||
+1
-1
@@ -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
|
||||
}
|
||||
|
||||
<!INAPPLICABLE_TARGET_ON_PROPERTY, WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@property:Ann<!>
|
||||
|
||||
+1
-1
@@ -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
|
||||
}
|
||||
|
||||
+2
-2
@@ -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) {}
|
||||
}
|
||||
|
||||
<!INAPPLICABLE_TARGET_ON_PROPERTY, WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@set:Ann<!>
|
||||
|
||||
+2
-2
@@ -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
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -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) {}
|
||||
}
|
||||
|
||||
<!INAPPLICABLE_TARGET_ON_PROPERTY, WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@setparam:Ann<!>
|
||||
|
||||
+2
-2
@@ -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
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
+1
-1
@@ -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
|
||||
}
|
||||
|
||||
+1
-1
@@ -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
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -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
|
||||
}
|
||||
|
||||
+1
-1
@@ -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
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -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
|
||||
}
|
||||
|
||||
+1
-1
@@ -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
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -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
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ class B {
|
||||
}
|
||||
|
||||
class Delegate {
|
||||
fun get(t: Any?, p: PropertyMetadata): Int {
|
||||
fun getValue(t: Any?, p: PropertyMetadata): Int {
|
||||
return 1
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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) {}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ fun foo() {
|
||||
}
|
||||
|
||||
class Delegate {
|
||||
fun get(t: Any?, p: PropertyMetadata): Int {
|
||||
fun getValue(t: Any?, p: PropertyMetadata): Int {
|
||||
return 1
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -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
|
||||
}
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ fun foo() {
|
||||
}
|
||||
|
||||
class Delegate {
|
||||
fun get(t: Any?, p: PropertyMetadata): String {
|
||||
fun getValue(t: Any?, p: PropertyMetadata): String {
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -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
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user