Minor, combine ENUM_NAME and ENUM_ORDINAL parameter kinds
This commit is contained in:
@@ -391,7 +391,9 @@ public class FunctionCodegen extends ParentCodegenAware {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static boolean needIndexForVar(JvmMethodParameterKind kind) {
|
private static boolean needIndexForVar(JvmMethodParameterKind kind) {
|
||||||
return kind == JvmMethodParameterKind.CAPTURED_LOCAL_VARIABLE || kind == JvmMethodParameterKind.SUPER_OF_ANONYMOUS_CALL_PARAM;
|
return kind == JvmMethodParameterKind.CAPTURED_LOCAL_VARIABLE ||
|
||||||
|
kind == JvmMethodParameterKind.ENUM_NAME_OR_ORDINAL ||
|
||||||
|
kind == JvmMethodParameterKind.SUPER_OF_ANONYMOUS_CALL_PARAM;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void endVisit(MethodVisitor mv, @Nullable String description, @Nullable PsiElement method) {
|
public static void endVisit(MethodVisitor mv, @Nullable String description, @Nullable PsiElement method) {
|
||||||
|
|||||||
@@ -756,8 +756,8 @@ public class JetTypeMapper {
|
|||||||
|
|
||||||
ClassDescriptor containingDeclaration = descriptor.getContainingDeclaration();
|
ClassDescriptor containingDeclaration = descriptor.getContainingDeclaration();
|
||||||
if (containingDeclaration.getKind() == ClassKind.ENUM_CLASS || containingDeclaration.getKind() == ClassKind.ENUM_ENTRY) {
|
if (containingDeclaration.getKind() == ClassKind.ENUM_CLASS || containingDeclaration.getKind() == ClassKind.ENUM_ENTRY) {
|
||||||
writeParameter(sw, JvmMethodParameterKind.ENUM_NAME, KotlinBuiltIns.getInstance().getStringType());
|
writeParameter(sw, JvmMethodParameterKind.ENUM_NAME_OR_ORDINAL, KotlinBuiltIns.getInstance().getStringType());
|
||||||
writeParameter(sw, JvmMethodParameterKind.ENUM_ORDINAL, KotlinBuiltIns.getInstance().getIntType());
|
writeParameter(sw, JvmMethodParameterKind.ENUM_NAME_OR_ORDINAL, KotlinBuiltIns.getInstance().getIntType());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (closure == null) return;
|
if (closure == null) return;
|
||||||
|
|||||||
+2
-7
@@ -16,21 +16,16 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.lang.resolve.java.jvmSignature;
|
package org.jetbrains.jet.lang.resolve.java.jvmSignature;
|
||||||
|
|
||||||
import java.util.EnumSet;
|
|
||||||
|
|
||||||
public enum JvmMethodParameterKind {
|
public enum JvmMethodParameterKind {
|
||||||
VALUE,
|
VALUE,
|
||||||
THIS,
|
THIS,
|
||||||
OUTER,
|
OUTER,
|
||||||
RECEIVER,
|
RECEIVER,
|
||||||
CAPTURED_LOCAL_VARIABLE,
|
CAPTURED_LOCAL_VARIABLE,
|
||||||
ENUM_NAME,
|
ENUM_NAME_OR_ORDINAL,
|
||||||
ENUM_ORDINAL,
|
|
||||||
SUPER_OF_ANONYMOUS_CALL_PARAM;
|
SUPER_OF_ANONYMOUS_CALL_PARAM;
|
||||||
|
|
||||||
private static final EnumSet<JvmMethodParameterKind> SKIPPED_IN_GENERIC_SIGNATURE = EnumSet.of(OUTER, ENUM_NAME, ENUM_ORDINAL);
|
|
||||||
|
|
||||||
public boolean isSkippedInGenericSignature() {
|
public boolean isSkippedInGenericSignature() {
|
||||||
return SKIPPED_IN_GENERIC_SIGNATURE.contains(this);
|
return this == OUTER || this == ENUM_NAME_OR_ORDINAL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user