Skip to content

Commit

Permalink
Actually fix the thing
Browse files Browse the repository at this point in the history
  • Loading branch information
Witixin1512 committed Apr 19, 2024
1 parent 956246d commit 6d768e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,15 @@ public static int calcAccess(Modifiers modifiers) {
}

public static void tagMethodParameters(JavaBytecodeContext context, JavaCompiledModule module, FunctionHeader header, boolean isStatic, List<TypeParameter> baseTypeTypeParameters) {
int index = isStatic ? 0 : 1;
int index = 0;

for (TypeParameter baseTypeTypeParameter : baseTypeTypeParameters) {
module.setTypeParameterInfo(baseTypeTypeParameter, new JavaTypeParameterInfo(index));
index++;
}

if (!isStatic) index++;

for (int i = 0; i < header.typeParameters.length; i++) {
TypeParameter parameter = header.typeParameters[i];
module.setTypeParameterInfo(parameter, new JavaTypeParameterInfo(index));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public Void visitMethod(MethodMember member) {

for (TypeParameter typeParameter : typeParameters) {
methodWriter.nameParameter(0, "typeOf" + typeParameter.name);
methodWriter.nameVariable(javaModule.getTypeParameterInfo(typeParameter).parameterIndex - 1, "typeOf" + typeParameter.name, methodStart, methodEnd, Type.getType(Class.class));
methodWriter.nameVariable(javaModule.getTypeParameterInfo(typeParameter).parameterIndex, "typeOf" + typeParameter.name, methodStart, methodEnd, Type.getType(Class.class));
}

methodWriter.nameVariable(typeParameters.size(), "expandedObj", methodStart, methodEnd, context.getType(expandedClass));
Expand Down

0 comments on commit 6d768e6

Please sign in to comment.