From 4843289646a394a046422e0dab5a3301a016c721 Mon Sep 17 00:00:00 2001 From: kindlich Date: Fri, 19 Apr 2024 23:02:04 +0200 Subject: [PATCH] Fix methodDescriptor for generic expansion methods in generic expansions --- .../java/org/openzen/zenscript/javashared/JavaContext.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/JavaShared/src/main/java/org/openzen/zenscript/javashared/JavaContext.java b/JavaShared/src/main/java/org/openzen/zenscript/javashared/JavaContext.java index fdbe5e75d..72702c922 100644 --- a/JavaShared/src/main/java/org/openzen/zenscript/javashared/JavaContext.java +++ b/JavaShared/src/main/java/org/openzen/zenscript/javashared/JavaContext.java @@ -584,16 +584,15 @@ public JavaSynthesizedClass getRange(RangeTypeID type) { */ public String getMethodDescriptor(FunctionHeader header, boolean isEnumConstructor, String expandedType) { StringBuilder descBuilder = new StringBuilder("("); + if (expandedType != null) + descBuilder.append(expandedType); + for (int i = 0; i < header.getNumberOfTypeParameters(); i++) descBuilder.append("Ljava/lang/Class;"); if (isEnumConstructor) descBuilder.append("Ljava/lang/String;I"); - //TODO: Put this earlier? We'd need to agree on one... - if (expandedType != null) - descBuilder.append(expandedType); - for (FunctionParameter parameter : header.parameters) { descBuilder.append(getDescriptor(parameter.type)); }