From 1c8af707cc6e15f2d10da2f3025743c1ad1bfa83 Mon Sep 17 00:00:00 2001 From: fridis Date: Fri, 22 Sep 2023 15:38:32 +0200 Subject: [PATCH] JVM: Add support for call target type being unit (Java's void), fix #1902 The code to filter out unit type values was present for the arguments already, we need this as well for the target that is passed as a first argument and that may be unit type as well. --- src/dev/flang/be/jvm/Types.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/dev/flang/be/jvm/Types.java b/src/dev/flang/be/jvm/Types.java index 05a4b6d04..e3443a59c 100644 --- a/src/dev/flang/be/jvm/Types.java +++ b/src/dev/flang/be/jvm/Types.java @@ -533,7 +533,11 @@ String descriptor(boolean explicitOuter, int cl, boolean pre) { var or = _fuir.clazzOuterRef(cl); var ot = _fuir.clazzResultClazz(or); - as.append(resultType(ot).descriptor()); + var at = resultType(ot); + if (at != PrimitiveType.type_void) + { + as.append(at.descriptor()); + } } for (var ai = 0; ai < _fuir.clazzArgCount(cl); ai++) {