From 0417768321b9e714a0dafa506ff80ad53459424a Mon Sep 17 00:00:00 2001 From: xingzeng Date: Mon, 1 Sep 2025 11:39:36 +0800 Subject: [PATCH] Remove unboxed method for Built-In Type Classes Issue: https://gitee.com/openharmony/arkcompiler_runtime_core/issues/ICVOSZ Reason: The es2panda front-en emits toByte&co instead of unboxed in lowering. The public unboxed() method is slated for removal now that we don't have primitives at the language level. Meaning: Transfer from relying on primitive types to not relying on primitive types, with promise that in new language compiling framework it stiil can process type cast correctly. Signed-off-by: xingzeng --- static_core/plugins/ets/stdlib/std/core/Boolean.ets | 2 +- static_core/plugins/ets/stdlib/std/core/Byte.ets | 2 +- static_core/plugins/ets/stdlib/std/core/Char.ets | 2 +- static_core/plugins/ets/stdlib/std/core/Double.ets | 2 +- static_core/plugins/ets/stdlib/std/core/Float.ets | 2 +- static_core/plugins/ets/stdlib/std/core/Int.ets | 2 +- static_core/plugins/ets/stdlib/std/core/Long.ets | 2 +- static_core/plugins/ets/stdlib/std/core/Short.ets | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/static_core/plugins/ets/stdlib/std/core/Boolean.ets b/static_core/plugins/ets/stdlib/std/core/Boolean.ets index 97edf9ad6d..dfb446fde5 100644 --- a/static_core/plugins/ets/stdlib/std/core/Boolean.ets +++ b/static_core/plugins/ets/stdlib/std/core/Boolean.ets @@ -172,7 +172,7 @@ export final class Boolean extends Object implements Comparable { * * @returns primitive boolean value */ - public unboxed(): boolean { + unboxed(): boolean { return this.value; } diff --git a/static_core/plugins/ets/stdlib/std/core/Byte.ets b/static_core/plugins/ets/stdlib/std/core/Byte.ets index 04ae55f57a..5cc6fe3ee6 100644 --- a/static_core/plugins/ets/stdlib/std/core/Byte.ets +++ b/static_core/plugins/ets/stdlib/std/core/Byte.ets @@ -42,7 +42,7 @@ export final class Byte extends Integral implements Comparable { * * @returns value of this instance */ - public unboxed(): byte { + unboxed(): byte { return this.value; } diff --git a/static_core/plugins/ets/stdlib/std/core/Char.ets b/static_core/plugins/ets/stdlib/std/core/Char.ets index ebb4ea34b8..230978efe0 100644 --- a/static_core/plugins/ets/stdlib/std/core/Char.ets +++ b/static_core/plugins/ets/stdlib/std/core/Char.ets @@ -44,7 +44,7 @@ export final class Char extends Object implements Comparable { * * @returns the underlying primitive char. */ - public unboxed(): char { + unboxed(): char { return this.value; } diff --git a/static_core/plugins/ets/stdlib/std/core/Double.ets b/static_core/plugins/ets/stdlib/std/core/Double.ets index 25383d943d..a0e39e0840 100644 --- a/static_core/plugins/ets/stdlib/std/core/Double.ets +++ b/static_core/plugins/ets/stdlib/std/core/Double.ets @@ -88,7 +88,7 @@ export final class Double extends Floating implements Comparable { * @returns value of this instance * @tag arkts */ - public unboxed(): double { + unboxed(): double { return this.value; } diff --git a/static_core/plugins/ets/stdlib/std/core/Float.ets b/static_core/plugins/ets/stdlib/std/core/Float.ets index 4bb4106267..364533eef3 100644 --- a/static_core/plugins/ets/stdlib/std/core/Float.ets +++ b/static_core/plugins/ets/stdlib/std/core/Float.ets @@ -51,7 +51,7 @@ export final class Float extends Floating implements Comparable { * * @returns value of this instance */ - public unboxed(): float { + unboxed(): float { return this.value; } diff --git a/static_core/plugins/ets/stdlib/std/core/Int.ets b/static_core/plugins/ets/stdlib/std/core/Int.ets index f74a1d0d0e..f22cfde10c 100644 --- a/static_core/plugins/ets/stdlib/std/core/Int.ets +++ b/static_core/plugins/ets/stdlib/std/core/Int.ets @@ -42,7 +42,7 @@ export final class Int extends Integral implements Comparable { * * @returns value of this instance */ - public unboxed(): int { + unboxed(): int { return this.value; } diff --git a/static_core/plugins/ets/stdlib/std/core/Long.ets b/static_core/plugins/ets/stdlib/std/core/Long.ets index b197949eba..5da0f6ee16 100644 --- a/static_core/plugins/ets/stdlib/std/core/Long.ets +++ b/static_core/plugins/ets/stdlib/std/core/Long.ets @@ -42,7 +42,7 @@ export final class Long extends Integral implements Comparable { * * @returns value of this instance */ - public unboxed(): long { + unboxed(): long { return this.value; } diff --git a/static_core/plugins/ets/stdlib/std/core/Short.ets b/static_core/plugins/ets/stdlib/std/core/Short.ets index de9c39e52d..c02369039f 100644 --- a/static_core/plugins/ets/stdlib/std/core/Short.ets +++ b/static_core/plugins/ets/stdlib/std/core/Short.ets @@ -42,7 +42,7 @@ export final class Short extends Integral implements Comparable { * * @returns value of this instance */ - public unboxed(): short { + unboxed(): short { return this.value; } -- Gitee