From 683ef885178da2bebb81dbbff38d07a38b2aa191 Mon Sep 17 00:00:00 2001 From: qiu_yu_jia Date: Thu, 31 Jul 2025 09:05:34 +0800 Subject: [PATCH 1/2] modify Array get and set index to int Issue: https://gitee.com/openharmony/arkcompiler_runtime_core/issues/IC3V0S Signed-off-by: qiu_yu_jia --- ets2panda/scripts/arkui.properties | 2 +- ets2panda/test/ast/parser/ets/nonIntegralIndex.ets | 2 +- ets2panda/test/runtime/ets/string_literals_inference.ets | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ets2panda/scripts/arkui.properties b/ets2panda/scripts/arkui.properties index 596d66d775..2b465df5ff 100644 --- a/ets2panda/scripts/arkui.properties +++ b/ets2panda/scripts/arkui.properties @@ -1,3 +1,3 @@ ARKUI_DEV_REPO=https://gitee.com/rri_opensource/koala_projects.git -ARKUI_DEV_BRANCH=panda_rev_9-array-length-int +ARKUI_DEV_BRANCH=panda_rev_9-array_number2int ARKUI_DEST=koala-sig diff --git a/ets2panda/test/ast/parser/ets/nonIntegralIndex.ets b/ets2panda/test/ast/parser/ets/nonIntegralIndex.ets index 99ae69249a..51b76e0ed8 100644 --- a/ets2panda/test/ast/parser/ets/nonIntegralIndex.ets +++ b/ets2panda/test/ast/parser/ets/nonIntegralIndex.ets @@ -15,6 +15,6 @@ export class Test { private static fn(u: double[], i: double): void { - u[/* @@ label */i] = 0.0 + u[/* @@ label */i.toInt()] = 0.0 } } diff --git a/ets2panda/test/runtime/ets/string_literals_inference.ets b/ets2panda/test/runtime/ets/string_literals_inference.ets index f8b10dfc06..57dcfa61f3 100644 --- a/ets2panda/test/runtime/ets/string_literals_inference.ets +++ b/ets2panda/test/runtime/ets/string_literals_inference.ets @@ -22,7 +22,7 @@ function id(v: Object): T { return v as T } -function getColor(colors: Array<"default"|"invisible"|number>, id: number) { +function getColor(colors: Array<"default"|"invisible"|number>, id: int) { return colors[id] } -- Gitee From c62097be623139c5a61548358fc9170997dcd285 Mon Sep 17 00:00:00 2001 From: qiu_yu_jia Date: Sat, 2 Aug 2025 14:58:59 +0800 Subject: [PATCH 2/2] change Array index from number to int Issue: https://gitee.com/openharmony/arkcompiler_runtime_core/issues/ICMU61 Signed-off-by: qiu_yu_jia --- ets2panda/scripts/arkui.properties | 2 +- ets2panda/test/ast/compiler/ets/generic_callback.ets | 8 ++++---- ets2panda/test/ast/parser/ets/update_funcscope_error.ets | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ets2panda/scripts/arkui.properties b/ets2panda/scripts/arkui.properties index 2b465df5ff..174c7b5117 100644 --- a/ets2panda/scripts/arkui.properties +++ b/ets2panda/scripts/arkui.properties @@ -1,3 +1,3 @@ ARKUI_DEV_REPO=https://gitee.com/rri_opensource/koala_projects.git -ARKUI_DEV_BRANCH=panda_rev_9-array_number2int +ARKUI_DEV_BRANCH=panda_rev_9-array_index2int ARKUI_DEST=koala-sig diff --git a/ets2panda/test/ast/compiler/ets/generic_callback.ets b/ets2panda/test/ast/compiler/ets/generic_callback.ets index 92c4b7ad7e..6e6c2919d4 100644 --- a/ets2panda/test/ast/compiler/ets/generic_callback.ets +++ b/ets2panda/test/ast/compiler/ets/generic_callback.ets @@ -22,7 +22,7 @@ let x = [1, 2, 3].map(identity)[0]; /* @@? 19:9 Error TypeError: Indexed access is not supported for such expression type. */ /* @@? 19:9 Error TypeError: No matching call signature for map((a: A) => A) */ /* @@? 19:9 Error TypeError: Indexed access is not supported for such expression type. */ -/* @@? 19:23 Error TypeError: Type '(a: A) => A' is not compatible with type '(value: Int, index: Double, array: Array) => A' at index 1 */ -/* @@? 19:23 Error TypeError: Type '(a: A) => A' is not compatible with type '(value: Int, index: Double, array: ReadonlyArray) => A' at index 1 */ -/* @@? 19:23 Error TypeError: Type '(a: A) => A' is not compatible with type '(value: Int, index: Double, array: Array) => A' at index 1 */ -/* @@? 19:23 Error TypeError: Type '(a: A) => A' is not compatible with type '(value: Int, index: Double, array: ReadonlyArray) => A' at index 1 */ +/* @@? 19:23 Error TypeError: Type '(a: A) => A' is not compatible with type '(value: Int, index: Int, array: Array) => A' at index 1 */ +/* @@? 19:23 Error TypeError: Type '(a: A) => A' is not compatible with type '(value: Int, index: Int, array: ReadonlyArray) => A' at index 1 */ +/* @@? 19:23 Error TypeError: Type '(a: A) => A' is not compatible with type '(value: Int, index: Int, array: Array) => A' at index 1 */ +/* @@? 19:23 Error TypeError: Type '(a: A) => A' is not compatible with type '(value: Int, index: Int, array: ReadonlyArray) => A' at index 1 */ diff --git a/ets2panda/test/ast/parser/ets/update_funcscope_error.ets b/ets2panda/test/ast/parser/ets/update_funcscope_error.ets index 7ca3f8b98c..40a9c76e16 100644 --- a/ets2panda/test/ast/parser/ets/update_funcscope_error.ets +++ b/ets2panda/test/ast/parser/ets/update_funcscope_error.ets @@ -36,7 +36,7 @@ export const updateIfChanged = (t: Record) => { /* @@? 21:19 Error TypeError: Unresolved reference u */ /* @@? 21:19 Error TypeError: Indexed access is not supported for such expression type. */ -/* @@? 24:7 Error TypeError: Type '(v: Record) => Boolean' is not compatible with type '(previousValue: Boolean, currentValue: Boolean, index: Double, array: FixedArray) => Boolean' at index 2 */ +/* @@? 24:7 Error TypeError: Type '(v: Record) => Boolean' is not compatible with type '(previousValue: Boolean, currentValue: Boolean, index: Int, array: FixedArray) => Boolean' at index 2 */ /* @@? 27:11 Error TypeError: Invalid record property */ /* @@? 28:11 Error SyntaxError: Unexpected token. */ /* @@? 28:12 Error SyntaxError: Unexpected token. */ -- Gitee