From 9cf94397e07b138ae73c693bc3c9184da3ecc573 Mon Sep 17 00:00:00 2001 From: Wonseo-C <1202won@gmail.com> Date: Fri, 29 Jul 2022 14:55:16 +0900 Subject: [PATCH 1/2] Change the part of getting paramType --- .../src/org/lflang/generator/ts/TSParameterPreambleGenerator.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.lflang/src/org/lflang/generator/ts/TSParameterPreambleGenerator.kt b/org.lflang/src/org/lflang/generator/ts/TSParameterPreambleGenerator.kt index 02380fa9fd..5b1e032331 100644 --- a/org.lflang/src/org/lflang/generator/ts/TSParameterPreambleGenerator.kt +++ b/org.lflang/src/org/lflang/generator/ts/TSParameterPreambleGenerator.kt @@ -126,7 +126,7 @@ class TSParameterPreambleGenerator( var customArgType: String? = null var customTypeLabel: String? = null - val paramType = getTargetType(parameter) + val paramType = parameter.type.id if (paramType == "string") { mainParameters.add(parameter) customArgType = "String"; From 61580150ea2a72d451c29f0f764c440785505a4f Mon Sep 17 00:00:00 2001 From: Wonseo-C <1202won@gmail.com> Date: Tue, 9 Aug 2022 09:49:29 +0900 Subject: [PATCH 2/2] Change getTragetType function --- org.lflang/src/org/lflang/generator/TargetTypes.java | 2 +- .../src/org/lflang/generator/ts/TSParameterPreambleGenerator.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/org.lflang/src/org/lflang/generator/TargetTypes.java b/org.lflang/src/org/lflang/generator/TargetTypes.java index c667d45a20..8e72c2a3f0 100644 --- a/org.lflang/src/org/lflang/generator/TargetTypes.java +++ b/org.lflang/src/org/lflang/generator/TargetTypes.java @@ -163,7 +163,7 @@ default String getTargetType(InferredType type) { } else if (type.isVariableSizeList) { return getTargetVariableSizeListType(type.baseType()); } - return type.toText(); + return type.toOriginalText(); } /** diff --git a/org.lflang/src/org/lflang/generator/ts/TSParameterPreambleGenerator.kt b/org.lflang/src/org/lflang/generator/ts/TSParameterPreambleGenerator.kt index 5b1e032331..02380fa9fd 100644 --- a/org.lflang/src/org/lflang/generator/ts/TSParameterPreambleGenerator.kt +++ b/org.lflang/src/org/lflang/generator/ts/TSParameterPreambleGenerator.kt @@ -126,7 +126,7 @@ class TSParameterPreambleGenerator( var customArgType: String? = null var customTypeLabel: String? = null - val paramType = parameter.type.id + val paramType = getTargetType(parameter) if (paramType == "string") { mainParameters.add(parameter) customArgType = "String";