From 8806d1462c6243de495406fb7b56529ceee34c06 Mon Sep 17 00:00:00 2001 From: Vic Nightfall Date: Sun, 27 Nov 2022 12:57:47 +0100 Subject: [PATCH] Fix FunNGenerator using the wrong string --- src/main/java/de/dhbwstuttgart/bytecode/FunNGenerator.java | 2 +- .../java/de/dhbwstuttgart/target/generate/ASTToTargetAST.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/dhbwstuttgart/bytecode/FunNGenerator.java b/src/main/java/de/dhbwstuttgart/bytecode/FunNGenerator.java index 68784071..82c46dec 100644 --- a/src/main/java/de/dhbwstuttgart/bytecode/FunNGenerator.java +++ b/src/main/java/de/dhbwstuttgart/bytecode/FunNGenerator.java @@ -31,7 +31,7 @@ public class FunNGenerator { private static String applyDescriptor(TargetType a) { return a.toDescriptor(); } private static String applySignature(TargetType a) { return a.toSignature(); } - private static String applyNameDescriptor(TargetType a){ return a instanceof TargetGenericType ? "LTPH;" : String.format("L%s;", applyDescriptor(a)); } + private static String applyNameDescriptor(TargetType a){ return a instanceof TargetGenericType ? "LTPH;" : String.format("L%s;", applySignature(a)); } public static byte[] generateSuperBytecode(int numberArguments) { StringBuilder superFunNClassSignature = new StringBuilder("<"); diff --git a/src/main/java/de/dhbwstuttgart/target/generate/ASTToTargetAST.java b/src/main/java/de/dhbwstuttgart/target/generate/ASTToTargetAST.java index 8d20b8f8..cfac47b8 100644 --- a/src/main/java/de/dhbwstuttgart/target/generate/ASTToTargetAST.java +++ b/src/main/java/de/dhbwstuttgart/target/generate/ASTToTargetAST.java @@ -675,6 +675,7 @@ public class ASTToTargetAST { var params = refType.getParaList().stream().map(ASTToTargetAST.this::convert).toList(); if (name.matches("Fun\\d+\\$\\$")) { // TODO This seems like a bad idea var className = FunNGenerator.getSpecializedClassName(FunNGenerator.getArguments(params), FunNGenerator.getReturnType(params)); + System.out.println(className); if (!usedFunNSuperTypes.contains(params.size())) { usedFunNSuperTypes.add(params.size()); var code = FunNGenerator.generateSuperBytecode(params.size() - 1);