From 8e483245f59a7ac44bde8cfcd07dde98e90f5aaa Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Fri, 2 Aug 2024 14:36:33 +0200 Subject: [PATCH] wasm: fix generation of constructor invocation --- .../generate/common/methods/BaseWasmGenerationVisitor.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/core/src/main/java/org/teavm/backend/wasm/generate/common/methods/BaseWasmGenerationVisitor.java b/core/src/main/java/org/teavm/backend/wasm/generate/common/methods/BaseWasmGenerationVisitor.java index e1236af8e..4c3f94b0b 100644 --- a/core/src/main/java/org/teavm/backend/wasm/generate/common/methods/BaseWasmGenerationVisitor.java +++ b/core/src/main/java/org/teavm/backend/wasm/generate/common/methods/BaseWasmGenerationVisitor.java @@ -878,9 +878,7 @@ public abstract class BaseWasmGenerationVisitor implements StatementVisitor, Exp var call = new WasmCall(function); call.getArguments().add(new WasmGetLocal(tmp)); var arguments = expr.getArguments(); - acceptWithType(arguments.get(0), ValueType.object(expr.getMethod().getClassName())); - call.getArguments().add(result); - for (int i = 1; i < arguments.size(); i++) { + for (int i = 0; i < arguments.size(); i++) { var argument = arguments.get(i); acceptWithType(argument, expr.getMethod().parameterType(i)); call.getArguments().add(result);