Support new convention for local variables name mangling: '$receiver' -> '$this$<label>' (KT-26913)
This commit is contained in:
@@ -103,6 +103,8 @@ public class AsmUtil {
|
|||||||
|
|
||||||
public static final String LABELED_THIS_FIELD = THIS + "_";
|
public static final String LABELED_THIS_FIELD = THIS + "_";
|
||||||
|
|
||||||
|
public static final String LABELED_THIS_PARAMETER = "$" + THIS + "$";
|
||||||
|
|
||||||
public static final String CAPTURED_THIS_FIELD = "this$0";
|
public static final String CAPTURED_THIS_FIELD = "this$0";
|
||||||
|
|
||||||
public static final String RECEIVER_PARAMETER_NAME = "$receiver";
|
public static final String RECEIVER_PARAMETER_NAME = "$receiver";
|
||||||
@@ -141,13 +143,35 @@ public class AsmUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static String getLabeledThisNameForReceiver(
|
public static String getNameForCapturedReceiverField(
|
||||||
@NotNull CallableDescriptor descriptor,
|
@NotNull CallableDescriptor descriptor,
|
||||||
@NotNull BindingContext bindingContext,
|
@NotNull BindingContext bindingContext,
|
||||||
@NotNull LanguageVersionSettings languageVersionSettings
|
@NotNull LanguageVersionSettings languageVersionSettings
|
||||||
|
) {
|
||||||
|
return getLabeledThisNameForReceiver(
|
||||||
|
descriptor, bindingContext, languageVersionSettings, LABELED_THIS_FIELD, CAPTURED_RECEIVER_FIELD);
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
public static String getNameForReceiverParameter(
|
||||||
|
@NotNull CallableDescriptor descriptor,
|
||||||
|
@NotNull BindingContext bindingContext,
|
||||||
|
@NotNull LanguageVersionSettings languageVersionSettings
|
||||||
|
) {
|
||||||
|
return getLabeledThisNameForReceiver(
|
||||||
|
descriptor, bindingContext, languageVersionSettings, LABELED_THIS_PARAMETER, RECEIVER_PARAMETER_NAME);
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
private static String getLabeledThisNameForReceiver(
|
||||||
|
@NotNull CallableDescriptor descriptor,
|
||||||
|
@NotNull BindingContext bindingContext,
|
||||||
|
@NotNull LanguageVersionSettings languageVersionSettings,
|
||||||
|
@NotNull String prefix,
|
||||||
|
@NotNull String defaultName
|
||||||
) {
|
) {
|
||||||
if (!languageVersionSettings.supportsFeature(LanguageFeature.NewCapturedReceiverFieldNamingConvention)) {
|
if (!languageVersionSettings.supportsFeature(LanguageFeature.NewCapturedReceiverFieldNamingConvention)) {
|
||||||
return CAPTURED_RECEIVER_FIELD;
|
return defaultName;
|
||||||
}
|
}
|
||||||
|
|
||||||
Name callableName = null;
|
Name callableName = null;
|
||||||
@@ -155,7 +179,7 @@ public class AsmUtil {
|
|||||||
if (descriptor instanceof FunctionDescriptor) {
|
if (descriptor instanceof FunctionDescriptor) {
|
||||||
String labelName = bindingContext.get(CodegenBinding.CALL_LABEL_FOR_LAMBDA_ARGUMENT, (FunctionDescriptor) descriptor);
|
String labelName = bindingContext.get(CodegenBinding.CALL_LABEL_FOR_LAMBDA_ARGUMENT, (FunctionDescriptor) descriptor);
|
||||||
if (labelName != null) {
|
if (labelName != null) {
|
||||||
return getLabeledThisName(labelName, CAPTURED_RECEIVER_FIELD);
|
return getLabeledThisName(labelName, prefix, defaultName);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (descriptor instanceof VariableAccessorDescriptor) {
|
if (descriptor instanceof VariableAccessorDescriptor) {
|
||||||
@@ -169,23 +193,23 @@ public class AsmUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (callableName.isSpecial()) {
|
if (callableName.isSpecial()) {
|
||||||
return CAPTURED_RECEIVER_FIELD;
|
return defaultName;
|
||||||
}
|
}
|
||||||
|
|
||||||
return getLabeledThisName(callableName.asString(), CAPTURED_RECEIVER_FIELD);
|
return getLabeledThisName(callableName.asString(), prefix, defaultName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
private static String getLabeledThisName(@NotNull String callableName, @NotNull String defaultName) {
|
public static String getLabeledThisName(@NotNull String callableName, @NotNull String prefix, @NotNull String defaultName) {
|
||||||
if (!Name.isValidIdentifier(callableName)) {
|
if (!Name.isValidIdentifier(callableName)) {
|
||||||
return defaultName;
|
return defaultName;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!DalvikIdentifierUtils.isValidDalvikIdentifier(callableName)) {
|
if (!DalvikIdentifierUtils.isValidDalvikIdentifier(callableName)) {
|
||||||
return LABELED_THIS_FIELD + mangleLabel(callableName);
|
return prefix + mangleLabel(callableName);
|
||||||
}
|
}
|
||||||
|
|
||||||
return LABELED_THIS_FIELD + callableName;
|
return prefix + callableName;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String mangleLabel(String label) {
|
private static String mangleLabel(String label) {
|
||||||
@@ -925,7 +949,8 @@ public class AsmUtil {
|
|||||||
if (descriptor.isOperator()) {
|
if (descriptor.isOperator()) {
|
||||||
ReceiverParameterDescriptor receiverParameter = descriptor.getExtensionReceiverParameter();
|
ReceiverParameterDescriptor receiverParameter = descriptor.getExtensionReceiverParameter();
|
||||||
if (receiverParameter != null) {
|
if (receiverParameter != null) {
|
||||||
genParamAssertion(v, state.getTypeMapper(), frameMap, receiverParameter, CAPTURED_RECEIVER_FIELD, descriptor);
|
String name = getNameForReceiverParameter(descriptor, state.getBindingContext(), state.getLanguageVersionSettings());
|
||||||
|
genParamAssertion(v, state.getTypeMapper(), frameMap, receiverParameter, name, descriptor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@@ -933,7 +958,8 @@ public class AsmUtil {
|
|||||||
|
|
||||||
ReceiverParameterDescriptor receiverParameter = descriptor.getExtensionReceiverParameter();
|
ReceiverParameterDescriptor receiverParameter = descriptor.getExtensionReceiverParameter();
|
||||||
if (receiverParameter != null) {
|
if (receiverParameter != null) {
|
||||||
genParamAssertion(v, state.getTypeMapper(), frameMap, receiverParameter, CAPTURED_RECEIVER_FIELD, descriptor);
|
String name = getNameForReceiverParameter(descriptor, state.getBindingContext(), state.getLanguageVersionSettings());
|
||||||
|
genParamAssertion(v, state.getTypeMapper(), frameMap, receiverParameter, name, descriptor);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (ValueParameterDescriptor parameter : descriptor.getValueParameters()) {
|
for (ValueParameterDescriptor parameter : descriptor.getValueParameters()) {
|
||||||
|
|||||||
+2
-2
@@ -160,7 +160,7 @@ class DefaultParameterValueSubstitutor(val state: GenerationState) {
|
|||||||
|
|
||||||
if (!state.classBuilderMode.generateBodies) {
|
if (!state.classBuilderMode.generateBodies) {
|
||||||
FunctionCodegen.generateLocalVariablesForParameters(
|
FunctionCodegen.generateLocalVariablesForParameters(
|
||||||
mv, signature, null, Label(), Label(), remainingParameters, isStatic, typeMapper
|
mv, signature, functionDescriptor, null, Label(), Label(), remainingParameters, isStatic, typeMapper
|
||||||
)
|
)
|
||||||
mv.visitEnd()
|
mv.visitEnd()
|
||||||
return
|
return
|
||||||
@@ -245,7 +245,7 @@ class DefaultParameterValueSubstitutor(val state: GenerationState) {
|
|||||||
mv.visitLabel(methodEnd)
|
mv.visitLabel(methodEnd)
|
||||||
|
|
||||||
FunctionCodegen.generateLocalVariablesForParameters(
|
FunctionCodegen.generateLocalVariablesForParameters(
|
||||||
mv, signature, null, methodBegin, methodEnd, remainingParameters, isStatic, typeMapper
|
mv, signature, functionDescriptor, null, methodBegin, methodEnd, remainingParameters, isStatic, typeMapper
|
||||||
)
|
)
|
||||||
|
|
||||||
FunctionCodegen.endVisit(mv, null, methodElement)
|
FunctionCodegen.endVisit(mv, null, methodElement)
|
||||||
|
|||||||
@@ -784,7 +784,7 @@ public class FunctionCodegen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
generateLocalVariablesForParameters(mv,
|
generateLocalVariablesForParameters(mv,
|
||||||
jvmMethodSignature,
|
jvmMethodSignature, functionDescriptor,
|
||||||
thisType, methodBegin, methodEnd, functionDescriptor.getValueParameters(),
|
thisType, methodBegin, methodEnd, functionDescriptor.getValueParameters(),
|
||||||
destructuredParametersForSuspendLambda,
|
destructuredParametersForSuspendLambda,
|
||||||
AsmUtil.isStaticMethod(ownerKind, functionDescriptor), typeMapper, shiftForDestructuringVariables
|
AsmUtil.isStaticMethod(ownerKind, functionDescriptor), typeMapper, shiftForDestructuringVariables
|
||||||
@@ -794,6 +794,7 @@ public class FunctionCodegen {
|
|||||||
public static void generateLocalVariablesForParameters(
|
public static void generateLocalVariablesForParameters(
|
||||||
@NotNull MethodVisitor mv,
|
@NotNull MethodVisitor mv,
|
||||||
@NotNull JvmMethodSignature jvmMethodSignature,
|
@NotNull JvmMethodSignature jvmMethodSignature,
|
||||||
|
@NotNull FunctionDescriptor functionDescriptor,
|
||||||
@Nullable Type thisType,
|
@Nullable Type thisType,
|
||||||
@NotNull Label methodBegin,
|
@NotNull Label methodBegin,
|
||||||
@NotNull Label methodEnd,
|
@NotNull Label methodEnd,
|
||||||
@@ -802,13 +803,15 @@ public class FunctionCodegen {
|
|||||||
KotlinTypeMapper typeMapper
|
KotlinTypeMapper typeMapper
|
||||||
) {
|
) {
|
||||||
generateLocalVariablesForParameters(
|
generateLocalVariablesForParameters(
|
||||||
mv, jvmMethodSignature, thisType, methodBegin, methodEnd, valueParameters, Collections.emptyList(), isStatic, typeMapper,
|
mv, jvmMethodSignature, functionDescriptor,
|
||||||
|
thisType, methodBegin, methodEnd, valueParameters, Collections.emptyList(), isStatic, typeMapper,
|
||||||
0);
|
0);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void generateLocalVariablesForParameters(
|
private static void generateLocalVariablesForParameters(
|
||||||
@NotNull MethodVisitor mv,
|
@NotNull MethodVisitor mv,
|
||||||
@NotNull JvmMethodSignature jvmMethodSignature,
|
@NotNull JvmMethodSignature jvmMethodSignature,
|
||||||
|
@NotNull FunctionDescriptor functionDescriptor,
|
||||||
@Nullable Type thisType,
|
@Nullable Type thisType,
|
||||||
@NotNull Label methodBegin,
|
@NotNull Label methodBegin,
|
||||||
@NotNull Label methodEnd,
|
@NotNull Label methodEnd,
|
||||||
@@ -847,6 +850,10 @@ public class FunctionCodegen {
|
|||||||
? computeParameterName(i, parameter)
|
? computeParameterName(i, parameter)
|
||||||
: nameForDestructuredParameter;
|
: nameForDestructuredParameter;
|
||||||
}
|
}
|
||||||
|
else if (kind == JvmMethodParameterKind.RECEIVER) {
|
||||||
|
parameterName = AsmUtil.getNameForReceiverParameter(
|
||||||
|
functionDescriptor, typeMapper.getBindingContext(), typeMapper.getLanguageVersionSettings());
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
String lowercaseKind = kind.name().toLowerCase();
|
String lowercaseKind = kind.name().toLowerCase();
|
||||||
parameterName = needIndexForVar(kind)
|
parameterName = needIndexForVar(kind)
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ public final class MutableClosure implements CalculatedClosure {
|
|||||||
return AsmUtil.CAPTURED_RECEIVER_FIELD;
|
return AsmUtil.CAPTURED_RECEIVER_FIELD;
|
||||||
}
|
}
|
||||||
|
|
||||||
String labeledThis = AsmUtil.getLabeledThisNameForReceiver(
|
String labeledThis = AsmUtil.getNameForCapturedReceiverField(
|
||||||
enclosingFunWithReceiverDescriptor, bindingContext, languageVersionSettings);
|
enclosingFunWithReceiverDescriptor, bindingContext, languageVersionSettings);
|
||||||
|
|
||||||
return AsmUtil.getCapturedFieldName(labeledThis);
|
return AsmUtil.getCapturedFieldName(labeledThis);
|
||||||
|
|||||||
@@ -46,7 +46,9 @@ internal fun generateParameterNames(
|
|||||||
isEnumName = !isEnumName
|
isEnumName = !isEnumName
|
||||||
if (!isEnumName) "\$enum\$name" else "\$enum\$ordinal"
|
if (!isEnumName) "\$enum\$name" else "\$enum\$ordinal"
|
||||||
}
|
}
|
||||||
JvmMethodParameterKind.RECEIVER -> AsmUtil.RECEIVER_PARAMETER_NAME
|
JvmMethodParameterKind.RECEIVER -> {
|
||||||
|
AsmUtil.getNameForReceiverParameter(functionDescriptor, state.bindingContext, state.languageVersionSettings)
|
||||||
|
}
|
||||||
JvmMethodParameterKind.OUTER -> AsmUtil.CAPTURED_THIS_FIELD
|
JvmMethodParameterKind.OUTER -> AsmUtil.CAPTURED_THIS_FIELD
|
||||||
JvmMethodParameterKind.VALUE -> iterator.next().name.asString()
|
JvmMethodParameterKind.VALUE -> iterator.next().name.asString()
|
||||||
|
|
||||||
|
|||||||
@@ -217,6 +217,10 @@ public class KotlinTypeMapper {
|
|||||||
return jvmTarget;
|
return jvmTarget;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public LanguageVersionSettings getLanguageVersionSettings() {
|
||||||
|
return languageVersionSettings;
|
||||||
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public Type mapOwner(@NotNull DeclarationDescriptor descriptor) {
|
public Type mapOwner(@NotNull DeclarationDescriptor descriptor) {
|
||||||
return mapOwner(descriptor, true);
|
return mapOwner(descriptor, true);
|
||||||
|
|||||||
@@ -5,21 +5,21 @@ public final class DeepInlineKt : java/lang/Object {
|
|||||||
1 $i$f$block: I
|
1 $i$f$block: I
|
||||||
}
|
}
|
||||||
|
|
||||||
public final static void foo(java.lang.String $receiver, int $i$a$-block-DeepInlineKt$foo$1$1$1) {
|
public final static void foo(java.lang.String $this$block, int $i$a$-block-DeepInlineKt$foo$1$1$1) {
|
||||||
Local variables:
|
Local variables:
|
||||||
14 $receiver: J
|
14 $this$block: J
|
||||||
16 $i$a$-block-DeepInlineKt$foo$1$1$1: I
|
16 $i$a$-block-DeepInlineKt$foo$1$1$1: I
|
||||||
13 $i$f$block: I
|
13 $i$f$block: I
|
||||||
12 z: Z
|
12 z: Z
|
||||||
9 $receiver: J
|
9 $this$block: J
|
||||||
11 $i$a$-block-DeepInlineKt$foo$1$1: I
|
11 $i$a$-block-DeepInlineKt$foo$1$1: I
|
||||||
8 $i$f$block: I
|
8 $i$f$block: I
|
||||||
7 y: Z
|
7 y: Z
|
||||||
4 $receiver: J
|
4 $this$block: J
|
||||||
6 $i$a$-block-DeepInlineKt$foo$1: I
|
6 $i$a$-block-DeepInlineKt$foo$1: I
|
||||||
3 $i$f$block: I
|
3 $i$f$block: I
|
||||||
2 x: Z
|
2 x: Z
|
||||||
0 $receiver: Ljava/lang/String;
|
0 $this$foo: Ljava/lang/String;
|
||||||
1 count: I
|
1 count: I
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-5
@@ -5,21 +5,21 @@ public final class DeepInlineWithLabelsKt : java/lang/Object {
|
|||||||
1 $i$f$block: I
|
1 $i$f$block: I
|
||||||
}
|
}
|
||||||
|
|
||||||
public final static void foo(java.lang.String $receiver, int $i$a$-block-DeepInlineWithLabelsKt$foo$1$1$1) {
|
public final static void foo(java.lang.String $this$b3, int $i$a$-block-DeepInlineWithLabelsKt$foo$1$1$1) {
|
||||||
Local variables:
|
Local variables:
|
||||||
14 $receiver: J
|
14 $this$b3: J
|
||||||
16 $i$a$-block-DeepInlineWithLabelsKt$foo$1$1$1: I
|
16 $i$a$-block-DeepInlineWithLabelsKt$foo$1$1$1: I
|
||||||
13 $i$f$block: I
|
13 $i$f$block: I
|
||||||
12 z: Z
|
12 z: Z
|
||||||
9 $receiver: J
|
9 $this$b2: J
|
||||||
11 $i$a$-block-DeepInlineWithLabelsKt$foo$1$1: I
|
11 $i$a$-block-DeepInlineWithLabelsKt$foo$1$1: I
|
||||||
8 $i$f$block: I
|
8 $i$f$block: I
|
||||||
7 y: Z
|
7 y: Z
|
||||||
4 $receiver: J
|
4 $this$b1: J
|
||||||
6 $i$a$-block-DeepInlineWithLabelsKt$foo$1: I
|
6 $i$a$-block-DeepInlineWithLabelsKt$foo$1: I
|
||||||
3 $i$f$block: I
|
3 $i$f$block: I
|
||||||
2 x: Z
|
2 x: Z
|
||||||
0 $receiver: Ljava/lang/String;
|
0 $this$foo: Ljava/lang/String;
|
||||||
1 count: I
|
1 count: I
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-6
@@ -9,10 +9,10 @@ final class DeepNoinlineWithLabels_afterKt$foo$1$1$1 : kotlin/jvm/internal/Lambd
|
|||||||
|
|
||||||
public java.lang.Object invoke(java.lang.Object p0)
|
public java.lang.Object invoke(java.lang.Object p0)
|
||||||
|
|
||||||
public final void invoke(long $receiver) {
|
public final void invoke(long $this$b3) {
|
||||||
Local variables:
|
Local variables:
|
||||||
0 this: LDeepNoinlineWithLabels_afterKt$foo$1$1$1;
|
0 this: LDeepNoinlineWithLabels_afterKt$foo$1$1$1;
|
||||||
1 $receiver: J
|
1 $this$b3: J
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ final class DeepNoinlineWithLabels_afterKt$foo$1$1 : kotlin/jvm/internal/Lambda,
|
|||||||
Local variables:
|
Local variables:
|
||||||
3 z: Z
|
3 z: Z
|
||||||
0 this: LDeepNoinlineWithLabels_afterKt$foo$1$1;
|
0 this: LDeepNoinlineWithLabels_afterKt$foo$1$1;
|
||||||
1 $receiver: J
|
1 $this$b2: J
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ final class DeepNoinlineWithLabels_afterKt$foo$1 : kotlin/jvm/internal/Lambda, k
|
|||||||
Local variables:
|
Local variables:
|
||||||
3 y: Z
|
3 y: Z
|
||||||
0 this: LDeepNoinlineWithLabels_afterKt$foo$1;
|
0 this: LDeepNoinlineWithLabels_afterKt$foo$1;
|
||||||
1 $receiver: J
|
1 $this$b1: J
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,10 +60,10 @@ public final class DeepNoinlineWithLabels_afterKt : java/lang/Object {
|
|||||||
0 block: Lkotlin/jvm/functions/Function1;
|
0 block: Lkotlin/jvm/functions/Function1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final static void foo(java.lang.String x, int $receiver) {
|
public final static void foo(java.lang.String x, int $this$foo) {
|
||||||
Local variables:
|
Local variables:
|
||||||
2 x: Z
|
2 x: Z
|
||||||
0 $receiver: Ljava/lang/String;
|
0 $this$foo: Ljava/lang/String;
|
||||||
1 count: I
|
1 count: I
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ final class DeepNoinline_afterKt$foo$1$1$1 : kotlin/jvm/internal/Lambda, kotlin/
|
|||||||
|
|
||||||
public java.lang.Object invoke(java.lang.Object p0)
|
public java.lang.Object invoke(java.lang.Object p0)
|
||||||
|
|
||||||
public final void invoke(long $receiver) {
|
public final void invoke(long $this$block) {
|
||||||
Local variables:
|
Local variables:
|
||||||
0 this: LDeepNoinline_afterKt$foo$1$1$1;
|
0 this: LDeepNoinline_afterKt$foo$1$1$1;
|
||||||
1 $receiver: J
|
1 $this$block: J
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@ final class DeepNoinline_afterKt$foo$1$1 : kotlin/jvm/internal/Lambda, kotlin/jv
|
|||||||
Local variables:
|
Local variables:
|
||||||
3 z: Z
|
3 z: Z
|
||||||
0 this: LDeepNoinline_afterKt$foo$1$1;
|
0 this: LDeepNoinline_afterKt$foo$1$1;
|
||||||
1 $receiver: J
|
1 $this$block: J
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ final class DeepNoinline_afterKt$foo$1 : kotlin/jvm/internal/Lambda, kotlin/jvm/
|
|||||||
Local variables:
|
Local variables:
|
||||||
3 y: Z
|
3 y: Z
|
||||||
0 this: LDeepNoinline_afterKt$foo$1;
|
0 this: LDeepNoinline_afterKt$foo$1;
|
||||||
1 $receiver: J
|
1 $this$block: J
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,10 +56,10 @@ public final class DeepNoinline_afterKt : java/lang/Object {
|
|||||||
0 block: Lkotlin/jvm/functions/Function1;
|
0 block: Lkotlin/jvm/functions/Function1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final static void foo(java.lang.String x, int $receiver) {
|
public final static void foo(java.lang.String x, int $this$foo) {
|
||||||
Local variables:
|
Local variables:
|
||||||
2 x: Z
|
2 x: Z
|
||||||
0 $receiver: Ljava/lang/String;
|
0 $this$foo: Ljava/lang/String;
|
||||||
1 count: I
|
1 count: I
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,13 +5,13 @@ public final class InlineReceiversKt : java/lang/Object {
|
|||||||
1 $i$f$block: I
|
1 $i$f$block: I
|
||||||
}
|
}
|
||||||
|
|
||||||
public final static void foo(java.lang.String $receiver, int $i$a$-block-InlineReceiversKt$foo$1) {
|
public final static void foo(java.lang.String $this$block, int $i$a$-block-InlineReceiversKt$foo$1) {
|
||||||
Local variables:
|
Local variables:
|
||||||
4 $receiver: J
|
4 $this$block: J
|
||||||
6 $i$a$-block-InlineReceiversKt$foo$1: I
|
6 $i$a$-block-InlineReceiversKt$foo$1: I
|
||||||
3 $i$f$block: I
|
3 $i$f$block: I
|
||||||
2 x: Z
|
2 x: Z
|
||||||
0 $receiver: Ljava/lang/String;
|
0 $this$foo: Ljava/lang/String;
|
||||||
1 count: I
|
1 count: I
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-4
@@ -9,10 +9,10 @@ final class NonInlineReceivers_afterKt$foo$1 : kotlin/jvm/internal/Lambda, kotli
|
|||||||
|
|
||||||
public java.lang.Object invoke(java.lang.Object p0)
|
public java.lang.Object invoke(java.lang.Object p0)
|
||||||
|
|
||||||
public final void invoke(long $receiver) {
|
public final void invoke(long $this$block) {
|
||||||
Local variables:
|
Local variables:
|
||||||
0 this: LNonInlineReceivers_afterKt$foo$1;
|
0 this: LNonInlineReceivers_afterKt$foo$1;
|
||||||
1 $receiver: J
|
1 $this$block: J
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -22,10 +22,10 @@ public final class NonInlineReceivers_afterKt : java/lang/Object {
|
|||||||
0 block: Lkotlin/jvm/functions/Function1;
|
0 block: Lkotlin/jvm/functions/Function1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final static void foo(java.lang.String x, int $receiver) {
|
public final static void foo(java.lang.String x, int $this$foo) {
|
||||||
Local variables:
|
Local variables:
|
||||||
2 x: Z
|
2 x: Z
|
||||||
0 $receiver: Ljava/lang/String;
|
0 $this$foo: Ljava/lang/String;
|
||||||
1 count: I
|
1 count: I
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
public final class SimpleKt : java/lang/Object {
|
public final class SimpleKt : java/lang/Object {
|
||||||
public final static void foo(java.lang.String $receiver, int a)
|
public final static void foo(java.lang.String $this$foo, int a)
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -28,7 +28,7 @@ fun A.foo() {
|
|||||||
// EXPRESSION: myFun()
|
// EXPRESSION: myFun()
|
||||||
// RESULT: 1: I
|
// RESULT: 1: I
|
||||||
frame = foo:14, FrameExtensionFunKt {frameExtensionFun}
|
frame = foo:14, FrameExtensionFunKt {frameExtensionFun}
|
||||||
local = $receiver: frameExtensionFun.A = {frameExtensionFun.A@uniqueID} (sp = null)
|
local = $this$foo: frameExtensionFun.A = {frameExtensionFun.A@uniqueID} (sp = null)
|
||||||
field = prop: int = 1 (sp = frameExtensionFun.kt, 8)
|
field = prop: int = 1 (sp = frameExtensionFun.kt, 8)
|
||||||
Disconnected from the target VM
|
Disconnected from the target VM
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ public final class AnnotationsTest {
|
|||||||
@Anno(value = "top-level-fun")
|
@Anno(value = "top-level-fun")
|
||||||
public static final void topLevelFun(@org.jetbrains.annotations.NotNull()
|
public static final void topLevelFun(@org.jetbrains.annotations.NotNull()
|
||||||
@Anno(value = "top-level-fun-receiver")
|
@Anno(value = "top-level-fun-receiver")
|
||||||
java.lang.String $receiver) {
|
java.lang.String $this$topLevelFun) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Anno(value = "top-level-val")
|
@Anno(value = "top-level-val")
|
||||||
@@ -35,7 +35,7 @@ public final class AnnotationsTest {
|
|||||||
|
|
||||||
@org.jetbrains.annotations.NotNull()
|
@org.jetbrains.annotations.NotNull()
|
||||||
public static final java.lang.String getTopLevelVal(@Anno(value = "top-level-val-receiver")
|
public static final java.lang.String getTopLevelVal(@Anno(value = "top-level-val-receiver")
|
||||||
int $receiver) {
|
int $this$topLevelVal) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ public final class LibKt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static final int func(@org.jetbrains.annotations.NotNull()
|
public static final int func(@org.jetbrains.annotations.NotNull()
|
||||||
java.lang.String $receiver) {
|
java.lang.String $this$func) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ public abstract class NullableBundleProperty<EE extends java.lang.Object> implem
|
|||||||
private final java.lang.String key = null;
|
private final java.lang.String key = null;
|
||||||
|
|
||||||
private final java.lang.String toKey(@org.jetbrains.annotations.NotNull()
|
private final java.lang.String toKey(@org.jetbrains.annotations.NotNull()
|
||||||
kotlin.reflect.KProperty<?> $receiver) {
|
kotlin.reflect.KProperty<?> $this$toKey) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -304,7 +304,7 @@ public final class Test<G extends java.lang.Object> {
|
|||||||
|
|
||||||
@org.jetbrains.annotations.Nullable()
|
@org.jetbrains.annotations.Nullable()
|
||||||
public final <T extends java.lang.Object>java.lang.Class<java.lang.Enum<?>> f5(@org.jetbrains.annotations.NotNull()
|
public final <T extends java.lang.Object>java.lang.Class<java.lang.Enum<?>> f5(@org.jetbrains.annotations.NotNull()
|
||||||
MyType<T> $receiver) {
|
MyType<T> $this$f5) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public final class TopLevelKt {
|
|||||||
|
|
||||||
public static final void extensionFunction(@org.jetbrains.annotations.NotNull()
|
public static final void extensionFunction(@org.jetbrains.annotations.NotNull()
|
||||||
@Anno(value = "rec")
|
@Anno(value = "rec")
|
||||||
java.lang.String $receiver, @org.jetbrains.annotations.NotNull()
|
java.lang.String $this$extensionFunction, @org.jetbrains.annotations.NotNull()
|
||||||
@Anno(value = "1")
|
@Anno(value = "1")
|
||||||
java.lang.String a, @org.jetbrains.annotations.NotNull()
|
java.lang.String a, @org.jetbrains.annotations.NotNull()
|
||||||
@Anno(value = "2")
|
@Anno(value = "2")
|
||||||
@@ -59,13 +59,13 @@ public final class TopLevelKt {
|
|||||||
@org.jetbrains.annotations.NotNull()
|
@org.jetbrains.annotations.NotNull()
|
||||||
public static final <T extends java.lang.Object>java.lang.String getExtensionProperty(@org.jetbrains.annotations.NotNull()
|
public static final <T extends java.lang.Object>java.lang.String getExtensionProperty(@org.jetbrains.annotations.NotNull()
|
||||||
@Anno(value = "propRec")
|
@Anno(value = "propRec")
|
||||||
T $receiver) {
|
T $this$extensionProperty) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final <T extends java.lang.Object>void setExtensionProperty(@org.jetbrains.annotations.NotNull()
|
public static final <T extends java.lang.Object>void setExtensionProperty(@org.jetbrains.annotations.NotNull()
|
||||||
@Anno(value = "propRec")
|
@Anno(value = "propRec")
|
||||||
T $receiver, @org.jetbrains.annotations.NotNull()
|
T $this$extensionProperty, @org.jetbrains.annotations.NotNull()
|
||||||
@Anno(value = "setparam")
|
@Anno(value = "setparam")
|
||||||
java.lang.String setParamName) {
|
java.lang.String setParamName) {
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -15,7 +15,7 @@ UFile (package = )
|
|||||||
ULiteralExpression (value = "aaa")
|
ULiteralExpression (value = "aaa")
|
||||||
UBlockExpression
|
UBlockExpression
|
||||||
UAnnotationMethod (name = withReceiver)
|
UAnnotationMethod (name = withReceiver)
|
||||||
UParameter (name = $receiver)
|
UParameter (name = $this$withReceiver)
|
||||||
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
|
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
|
||||||
UParameter (name = a)
|
UParameter (name = a)
|
||||||
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
|
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
|
||||||
@@ -147,7 +147,7 @@ UFile (package = )
|
|||||||
UAnnotationMethod (name = ParametersDisorderKt$objectLiteral$1)
|
UAnnotationMethod (name = ParametersDisorderKt$objectLiteral$1)
|
||||||
UClass (name = A)
|
UClass (name = A)
|
||||||
UAnnotationMethod (name = with2Receivers)
|
UAnnotationMethod (name = with2Receivers)
|
||||||
UParameter (name = $receiver)
|
UParameter (name = $this$with2Receivers)
|
||||||
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
|
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
|
||||||
UParameter (name = a)
|
UParameter (name = a)
|
||||||
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
|
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ public final class ParametersDisorderKt {
|
|||||||
}
|
}
|
||||||
public static final fun withDefault(@org.jetbrains.annotations.NotNull c: int, @org.jetbrains.annotations.NotNull d: java.lang.String) : void {
|
public static final fun withDefault(@org.jetbrains.annotations.NotNull c: int, @org.jetbrains.annotations.NotNull d: java.lang.String) : void {
|
||||||
}
|
}
|
||||||
public static final fun withReceiver(@org.jetbrains.annotations.NotNull $receiver: java.lang.String, @org.jetbrains.annotations.NotNull a: int, @org.jetbrains.annotations.NotNull b: float) : void {
|
public static final fun withReceiver(@org.jetbrains.annotations.NotNull $this$withReceiver: java.lang.String, @org.jetbrains.annotations.NotNull a: int, @org.jetbrains.annotations.NotNull b: float) : void {
|
||||||
}
|
}
|
||||||
public static final fun call() : void {
|
public static final fun call() : void {
|
||||||
global(2.2, 2)
|
global(2.2, 2)
|
||||||
@@ -26,7 +26,7 @@ public final class ParametersDisorderKt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final class A {
|
public final class A {
|
||||||
public final fun with2Receivers(@org.jetbrains.annotations.NotNull $receiver: java.lang.String, @org.jetbrains.annotations.NotNull a: int, @org.jetbrains.annotations.NotNull b: float) : void {
|
public final fun with2Receivers(@org.jetbrains.annotations.NotNull $this$with2Receivers: java.lang.String, @org.jetbrains.annotations.NotNull a: int, @org.jetbrains.annotations.NotNull b: float) : void {
|
||||||
}
|
}
|
||||||
public fun A() = UastEmptyExpression
|
public fun A() = UastEmptyExpression
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
UFile (package = )
|
UFile (package = )
|
||||||
UClass (name = ReceiverFunKt)
|
UClass (name = ReceiverFunKt)
|
||||||
UAnnotationMethod (name = foo)
|
UAnnotationMethod (name = foo)
|
||||||
UParameter (name = $receiver)
|
UParameter (name = $this$foo)
|
||||||
UAnnotation (fqName = MyReceiverAnnotation)
|
UAnnotation (fqName = MyReceiverAnnotation)
|
||||||
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
|
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
|
||||||
UBlockExpression
|
UBlockExpression
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
public final class ReceiverFunKt {
|
public final class ReceiverFunKt {
|
||||||
public static final fun foo(@MyReceiverAnnotation @org.jetbrains.annotations.NotNull $receiver: java.lang.String) : int {
|
public static final fun foo(@MyReceiverAnnotation @org.jetbrains.annotations.NotNull $this$foo: java.lang.String) : int {
|
||||||
return this.length
|
return this.length
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user