diff --git a/static_core/plugins/ets/runtime/types/ets_typeapi_create.cpp b/static_core/plugins/ets/runtime/types/ets_typeapi_create.cpp index 703a38239a66f08ba0797528a4ff84be25c5bb12..fc8debd89451e35ee2730a3dfe962b38f5137d64 100644 --- a/static_core/plugins/ets/runtime/types/ets_typeapi_create.cpp +++ b/static_core/plugins/ets/runtime/types/ets_typeapi_create.cpp @@ -229,7 +229,29 @@ const std::pair &TypeCreatorCtx::DeclarePrimitive(cons ctor.GetFn().metadata->SetAttribute(typeapi_create_consts::ATTR_CTOR); ctor.Create(); - PandasmMethodCreator unboxed {objectTypeName + ".unboxed", this}; + std::string rawTypeName {}; + if (primTypeName == "u1") { + rawTypeName = "Boolean"; + } else if (primTypeName == "i8") { + rawTypeName = "Byte"; + } else if (primTypeName == "i16") { + rawTypeName = "Short"; + } else if (primTypeName == "i32") { + rawTypeName = "Int"; + } else if (primTypeName == "i64") { + rawTypeName = "Long"; + } else if (primTypeName == "u16") { + rawTypeName = "Char"; + } else if (primTypeName == "void") { + rawTypeName = "Void"; + } else if (primTypeName == "f32") { + rawTypeName = "Float"; + } else if (primTypeName == "f64") { + rawTypeName = "Double"; + } else { + UNREACHABLE(); + } + PandasmMethodCreator unboxed {objectTypeName + ".to" + rawTypeName, this}; unboxed.AddParameter(objectType); unboxed.AddResult(primType); unboxed.GetFn().metadata->SetAttribute(typeapi_create_consts::ATTR_EXTERNAL); diff --git a/static_core/plugins/ets/sdk/native/api/Util.cpp b/static_core/plugins/ets/sdk/native/api/Util.cpp index 57b9c2cdc04b36b42bae9877d672889c6c1be96a..7287f65bd3479b820e4bae455fd539584d7f58f9 100644 --- a/static_core/plugins/ets/sdk/native/api/Util.cpp +++ b/static_core/plugins/ets/sdk/native/api/Util.cpp @@ -215,7 +215,7 @@ void ThrowBusinessError(ani_env *env, int code, const std::string &message) aniType UnboxTo##typeName(ani_env *env, ani_object value) \ { \ aniType result {}; \ - ANI_FATAL_IF_ERROR(env->Object_CallMethodByName_##typeName(value, "unboxed", ":" signature, &result)); \ + ANI_FATAL_IF_ERROR(env->Object_CallMethodByName_##typeName(value, "to##typeName", ":" signature, &result)); \ /* CC-OFFNXT(G.PRE.05) function defination, no effects */ \ return result; \ } diff --git a/static_core/plugins/ets/stdlib/escompat/Array.ets b/static_core/plugins/ets/stdlib/escompat/Array.ets index 75e87d56f45604de407420204858e10b28a78cc7..8cf11633431f9103d1c31327721c78bf88e04289 100644 --- a/static_core/plugins/ets/stdlib/escompat/Array.ets +++ b/static_core/plugins/ets/stdlib/escompat/Array.ets @@ -365,7 +365,7 @@ export class Array implements ReadonlyArray, Iterable { for (let i = fi; i < len; i++) { const tmp = this.$_get_unsafe(i) if (tmp instanceof Number) { - if (unboxedVal == tmp.unboxed()) { + if (unboxedVal == tmp) { return true } } @@ -375,12 +375,12 @@ export class Array implements ReadonlyArray, Iterable { } private searchFloat(val: Float, fi: int, len: int): boolean { - const unboxedVal: float = val.unboxed() + const unboxedVal: float = val if (isNaN(unboxedVal)) { for (let i = fi; i < len; i++) { const tmp = this.$_get_unsafe(i) if (tmp instanceof Float) { - if (isNaN(tmp.unboxed())) { + if (isNaN(tmp)) { return true } } @@ -389,7 +389,7 @@ export class Array implements ReadonlyArray, Iterable { for (let i = fi; i < len; i++) { const tmp = this.$_get_unsafe(i) if (tmp instanceof Float) { - if (unboxedVal == tmp.unboxed()) { + if (unboxedVal == tmp) { return true } } @@ -399,7 +399,7 @@ export class Array implements ReadonlyArray, Iterable { } private searchLong(val: Long, fi: int, len: int): boolean { - const unboxedVal: long = val.unboxed() + const unboxedVal: long = val for (let i = fi; i < len; i++) { const tmp = this.$_get_unsafe(i) if (tmp instanceof Long) { @@ -412,7 +412,7 @@ export class Array implements ReadonlyArray, Iterable { } private searchInt(val: Int, fi: int, len: int): boolean { - const unboxedVal: int = val.unboxed() + const unboxedVal: int = val for (let i = fi; i < len; i++) { const tmp = this.$_get_unsafe(i) if (tmp instanceof Int) { diff --git a/static_core/plugins/ets/stdlib/escompat/json.ets b/static_core/plugins/ets/stdlib/escompat/json.ets index b1b37e04791a292cb3608699940ea606ea6e2664..0702826e24557e3172ef5bbd9176781466c9e5fe 100644 --- a/static_core/plugins/ets/stdlib/escompat/json.ets +++ b/static_core/plugins/ets/stdlib/escompat/json.ets @@ -1192,28 +1192,28 @@ class JSONWriter { private writeValueTypeWrapper(obj: Any): boolean { if (obj instanceof Boolean) { - this.buffer.append(JSON.stringify(obj.unboxed())) + this.buffer.append(JSON.stringify(obj.toBoolean())) return true } else if (obj instanceof Byte) { - this.buffer.append(JSON.stringify(obj.unboxed())) + this.buffer.append(JSON.stringify(obj.toByte())) return true } else if (obj instanceof Char) { - this.buffer.append(JSON.stringify(obj.unboxed())) + this.buffer.append(JSON.stringify(obj.toChar())) return true } else if (obj instanceof Short) { - this.buffer.append(JSON.stringify(obj.unboxed())) + this.buffer.append(JSON.stringify(obj.toShort())) return true } else if (obj instanceof Int) { - this.buffer.append(JSON.stringify(obj.unboxed())) + this.buffer.append(JSON.stringify(obj.toInt())) return true } else if (obj instanceof Long) { - this.buffer.append(JSON.stringify(obj.unboxed())) + this.buffer.append(JSON.stringify(obj.toLong())) return true } else if (obj instanceof Float) { - this.buffer.append(JSON.stringify(obj.unboxed())) + this.buffer.append(JSON.stringify(obj.toFloat())) return true } else if (obj instanceof Double) { - this.buffer.append(JSON.stringify(obj.unboxed())) + this.buffer.append(JSON.stringify(obj.toDouble())) return true } else if (obj instanceof BigInt) { this.buffer.append(JSON.stringify(obj)) diff --git a/static_core/plugins/ets/stdlib/std/core/Boolean.ets b/static_core/plugins/ets/stdlib/std/core/Boolean.ets index 97edf9ad6d5eccd8841f434ccc07bb9629bb88bd..56ca0a3df901280556e90e584fe0131d1484611f 100644 --- a/static_core/plugins/ets/stdlib/std/core/Boolean.ets +++ b/static_core/plugins/ets/stdlib/std/core/Boolean.ets @@ -121,21 +121,21 @@ export final class Boolean extends Object implements Comparable { if (value == null || value == undefined) { this.value = false; } else if (value instanceof Boolean) { - this.value = value.unboxed(); + this.value = value; } else if (value instanceof Number) { - this.value = (value.unboxed() != 0 && !isNaN(value.unboxed())); + this.value = (value != 0 && !isNaN(value)); } else if (value instanceof Char) { - this.value = value.unboxed() != c'\u0000'; + this.value = value != c'\u0000'; } else if (value instanceof Float) { - this.value = (value.unboxed() != 0.0 && !isNaN(value.unboxed())); + this.value = (value != 0.0 && !isNaN(value)); } else if (value instanceof Long) { - this.value = value.unboxed() != 0; + this.value = value != 0; } else if (value instanceof Int) { - this.value = value.unboxed() != 0; + this.value = value != 0; } else if (value instanceof Byte) { - this.value = value.unboxed() != 0; + this.value = value != 0; } else if (value instanceof Short) { - this.value = value.unboxed() != 0; + this.value = value != 0; } else if (value instanceof String) { this.value = value != ''; } else if (value instanceof Object) { @@ -167,15 +167,6 @@ export final class Boolean extends Object implements Comparable { return new Boolean(value).valueOf(); } - /** - * Returns the value of this instance as a primitive - * - * @returns primitive boolean value - */ - public unboxed(): boolean { - return this.value; - } - /** * Static instance that represents true boolean value */ @@ -312,7 +303,7 @@ export final class Boolean extends Object implements Comparable { * @returns value as a result of logical `and` */ public and(other: Boolean): Boolean { - return Boolean.valueOf(this.value && other.unboxed()) + return Boolean.valueOf(this.value && other) } /** @@ -323,7 +314,7 @@ export final class Boolean extends Object implements Comparable { * @returns value as a result of logical `or` */ public or(other: Boolean): Boolean { - return Boolean.valueOf(this.value || other.unboxed()) + return Boolean.valueOf(this.value || other) } /** @@ -334,6 +325,6 @@ export final class Boolean extends Object implements Comparable { * @returns value as a result of `xor` */ public xor(other: Boolean): Boolean { - return Boolean.valueOf(this.value ^ other.unboxed()) + return Boolean.valueOf(this.value ^ other) } } diff --git a/static_core/plugins/ets/stdlib/std/core/Byte.ets b/static_core/plugins/ets/stdlib/std/core/Byte.ets index 04ae55f57a316ce3528fd703ab880d033a6d1e30..f72f677ae5378c89be717297eb41d709995a1398 100644 --- a/static_core/plugins/ets/stdlib/std/core/Byte.ets +++ b/static_core/plugins/ets/stdlib/std/core/Byte.ets @@ -37,15 +37,6 @@ export final class Byte extends Integral implements Comparable { this.value = value; } - /** - * Returns value of this instance as a primitive - * - * @returns value of this instance - */ - public unboxed(): byte { - return this.value; - } - /** * Returns boxed representation of the primitive * diff --git a/static_core/plugins/ets/stdlib/std/core/Char.ets b/static_core/plugins/ets/stdlib/std/core/Char.ets index ebb4ea34b87f8ff3b4e21574cd85c5835d51c514..66c2b030519b8b3d2de25c9d52c86f816cc51016 100644 --- a/static_core/plugins/ets/stdlib/std/core/Char.ets +++ b/static_core/plugins/ets/stdlib/std/core/Char.ets @@ -39,15 +39,6 @@ export final class Char extends Object implements Comparable { this.value = value; } - /** - * unboxed() returns an underlying primitive char. - * - * @returns the underlying primitive char. - */ - public unboxed(): char { - return this.value; - } - /** * valueOf(char) creates a Char object from a primitive char. * This method is preferred over {@link } since this method can use a cached Char object, @@ -104,7 +95,7 @@ export final class Char extends Object implements Comparable { * @returns comparison result of the underlying chars. */ public static compare(lhs: Char, rhs: Char): boolean { - return (lhs.unboxed() == rhs.unboxed()); + return (lhs == rhs); } /** diff --git a/static_core/plugins/ets/stdlib/std/core/Double.ets b/static_core/plugins/ets/stdlib/std/core/Double.ets index 25383d943d3b2f35aa1220eb1cc4b24fb6dbbae1..b3458dda8551dc7722d1948ba62d18e975f4415b 100644 --- a/static_core/plugins/ets/stdlib/std/core/Double.ets +++ b/static_core/plugins/ets/stdlib/std/core/Double.ets @@ -82,16 +82,6 @@ export final class Double extends Floating implements Comparable { return new Double(NaN); } - /** - * Returns value of this instance as a primitive - * - * @returns value of this instance - * @tag arkts - */ - public unboxed(): double { - return this.value; - } - /** * Returns boxed representation of the primitive * diff --git a/static_core/plugins/ets/stdlib/std/core/Float.ets b/static_core/plugins/ets/stdlib/std/core/Float.ets index 4bb41062674f2f10441ea2dec1cc1ef47d9e7983..f86bf9491c1c86c26a1e92f4256055884a1b77ae 100644 --- a/static_core/plugins/ets/stdlib/std/core/Float.ets +++ b/static_core/plugins/ets/stdlib/std/core/Float.ets @@ -46,15 +46,6 @@ export final class Float extends Floating implements Comparable { this.value = Double.toFloat(value); } - /** - * Returns value of this instance as a primitive - * - * @returns value of this instance - */ - public unboxed(): float { - return this.value; - } - /** * Returns boxed representation of the primitive * @@ -312,7 +303,7 @@ export final class Float extends Floating implements Comparable { * @returns result of the comparison */ public override compareTo(other: Float): int { - return (this.value - other.unboxed()).toInt(); + return (this.value - other).toInt(); } /** diff --git a/static_core/plugins/ets/stdlib/std/core/Int.ets b/static_core/plugins/ets/stdlib/std/core/Int.ets index f74a1d0d0e59224fa780e45226f2feded84f92fd..454b6c5ccdc7325e721c5fa47a3f05b119f29b03 100644 --- a/static_core/plugins/ets/stdlib/std/core/Int.ets +++ b/static_core/plugins/ets/stdlib/std/core/Int.ets @@ -37,15 +37,6 @@ export final class Int extends Integral implements Comparable { this.value = value; } - /** - * Returns value of this instance as a primitive - * - * @returns value of this instance - */ - public unboxed(): int { - return this.value; - } - /** * Returns boxed representation of the primitive * @@ -283,10 +274,10 @@ export final class Int extends Integral implements Comparable { * @returns result of the comparison */ public override compareTo(other: Int): int { - if (this.value < other.unboxed()) { + if (this.value < other) { return -1; } - if (this.value == other.unboxed()) { + if (this.value == other) { return 0; } return 1; diff --git a/static_core/plugins/ets/stdlib/std/core/Long.ets b/static_core/plugins/ets/stdlib/std/core/Long.ets index b197949eba06047917af646c64bae7101971f3e8..ab2e29bc12d045731445c9523fc1f279ae211fde 100644 --- a/static_core/plugins/ets/stdlib/std/core/Long.ets +++ b/static_core/plugins/ets/stdlib/std/core/Long.ets @@ -37,15 +37,6 @@ export final class Long extends Integral implements Comparable { this.value = value; } - /** - * Returns value of this instance as a primitive - * - * @returns value of this instance - */ - public unboxed(): long { - return this.value; - } - /** * Returns boxed representation of the primitive * @@ -283,10 +274,10 @@ export final class Long extends Integral implements Comparable { * @returns result of the comparison */ public override compareTo(other: Long): int { - if (this.value < other.unboxed()) { + if (this.value < other) { return -1; } - if (this.value == other.unboxed()) { + if (this.value == other) { return 0; } return 1; diff --git a/static_core/plugins/ets/stdlib/std/core/Proxy.ets b/static_core/plugins/ets/stdlib/std/core/Proxy.ets index 10bb69dbdaef9bfce6657caef006e17ce4af2d07..8323af9a5823e27186604760601b4bd94a418e57 100644 --- a/static_core/plugins/ets/stdlib/std/core/Proxy.ets +++ b/static_core/plugins/ets/stdlib/std/core/Proxy.ets @@ -820,7 +820,7 @@ abstract class ArrayProxy extends Array { override get length(): int { const length = this.handlerGet(this.target, this.handler, ArrayProxy.LENGTH_PROP_NAME) if (length instanceof Int) { - return length.unboxed() + return length } throw new TypeError("unexpected Array.length value type: " + Type.of(length)) diff --git a/static_core/plugins/ets/stdlib/std/core/ReadonlyArrayProxy.ets b/static_core/plugins/ets/stdlib/std/core/ReadonlyArrayProxy.ets index c01a42719433ec253e60208fd193d350e1d4a9a0..11b8ccdb41602346725d69cbd499b4a1b8fa240c 100644 --- a/static_core/plugins/ets/stdlib/std/core/ReadonlyArrayProxy.ets +++ b/static_core/plugins/ets/stdlib/std/core/ReadonlyArrayProxy.ets @@ -153,7 +153,7 @@ class ReadonlyArrayProxy implements ReadonlyArray { get length(): int { const length = this.handler.get(this.target, "length") if (length instanceof Int) { - return length.unboxed() + return length } throw new TypeError("unexpected ReadonlyArray.length value type: " + Type.of(length)) diff --git a/static_core/plugins/ets/stdlib/std/core/Runtime.ets b/static_core/plugins/ets/stdlib/std/core/Runtime.ets index 63bcf5fcdba12731beb1b48932feee873cd09048..ac4fe32d48a798bba205f640fa3c90ab8e5bfb31 100644 --- a/static_core/plugins/ets/stdlib/std/core/Runtime.ets +++ b/static_core/plugins/ets/stdlib/std/core/Runtime.ets @@ -83,8 +83,8 @@ export final class Runtime { } private static sameFloatValue(f1: Float, f2: Float): boolean { - const f1val = f1.unboxed() - const f2val = f2.unboxed() + const f1val = f1 + const f2val = f2 if (f1val == 0 || f2val == 0) { return Float.bitCastToInt(f1val) == Float.bitCastToInt(f2val) diff --git a/static_core/plugins/ets/stdlib/std/core/Short.ets b/static_core/plugins/ets/stdlib/std/core/Short.ets index de9c39e52de0e172cf3eb62a4e3964bb75f30b60..4a06d59d8dd81c986114f289b606afad5b528b3e 100644 --- a/static_core/plugins/ets/stdlib/std/core/Short.ets +++ b/static_core/plugins/ets/stdlib/std/core/Short.ets @@ -37,15 +37,6 @@ export final class Short extends Integral implements Comparable { this.value = value; } - /** - * Returns value of this instance as a primitive - * - * @returns value of this instance - */ - public unboxed(): short { - return this.value; - } - /** * Returns boxed representation of the primitive * diff --git a/static_core/plugins/ets/stdlib/std/core/String.ets b/static_core/plugins/ets/stdlib/std/core/String.ets index 34827095ade18e33ac8b1c0ef27c327772c0128b..32ef73021be0775970033cd2e38a41aa1e80b4f1 100644 --- a/static_core/plugins/ets/stdlib/std/core/String.ets +++ b/static_core/plugins/ets/stdlib/std/core/String.ets @@ -1580,7 +1580,7 @@ export final class String extends Object implements Comparable, Iterable let result = '' let arrayMatchPositions = matchPositions.toArray() for (let i = 0; i < arrayMatchPositions.length; ++i) { - let p = arrayMatchPositions[i].unboxed() + let p = arrayMatchPositions[i] let preserved = this.substring(endOfLastMatch, p) let replacement = String.getSubstitution(searchValue, this, p, new String[0], undefined, replaceValue) result = result + preserved + replacement @@ -1632,7 +1632,7 @@ export final class String extends Object implements Comparable, Iterable let result = '' let arrayMatchPositions = matchPositions.toArray() for (let i = 0; i < arrayMatchPositions.length; ++i) { - let p = arrayMatchPositions[i].unboxed() + let p = arrayMatchPositions[i] let preserved = this.substring(endOfLastMatch, p) let args = new containers.UndefinableObjectArray(2) args.pushBack(Double.valueOf(p)) diff --git a/static_core/plugins/ets/stdlib/std/core/Void.ets b/static_core/plugins/ets/stdlib/std/core/Void.ets index 8957f7e61476e79d69816c54325405b7fd2cf897..b74849f180d3bc6df208f1fc1e48b8bc4da7c914 100644 --- a/static_core/plugins/ets/stdlib/std/core/Void.ets +++ b/static_core/plugins/ets/stdlib/std/core/Void.ets @@ -18,6 +18,4 @@ package std.core; export final class Void { static readonly void_instance = new Void(); private constructor() { } - - public unboxed(): void {} } diff --git a/static_core/plugins/ets/templates/stdlib/Array_escompat.erb b/static_core/plugins/ets/templates/stdlib/Array_escompat.erb index 2afd21bed82ef2c7660b77041dc9d7562e20550c..7569c44b7f54dafe73b661c19fd87840df29e4ba 100644 --- a/static_core/plugins/ets/templates/stdlib/Array_escompat.erb +++ b/static_core/plugins/ets/templates/stdlib/Array_escompat.erb @@ -344,7 +344,7 @@ export class Array implements ReadonlyArray, Iterable { for (let i = fi; i < len; i++) { const tmp = this.$_get_unsafe(i) if (tmp instanceof Number) { - if (unboxedVal == tmp.unboxed()) { + if (unboxedVal == tmp) { return true } } @@ -354,12 +354,12 @@ export class Array implements ReadonlyArray, Iterable { } private searchFloat(val: Float, fi: int, len: int): boolean { - const unboxedVal: float = val.unboxed() + const unboxedVal: float = val if (isNaN(unboxedVal)) { for (let i = fi; i < len; i++) { const tmp = this.$_get_unsafe(i) if (tmp instanceof Float) { - if (isNaN(tmp.unboxed())) { + if (isNaN(tmp)) { return true } } @@ -368,7 +368,7 @@ export class Array implements ReadonlyArray, Iterable { for (let i = fi; i < len; i++) { const tmp = this.$_get_unsafe(i) if (tmp instanceof Float) { - if (unboxedVal == tmp.unboxed()) { + if (unboxedVal == tmp) { return true } } @@ -378,7 +378,7 @@ export class Array implements ReadonlyArray, Iterable { } private searchLong(val: Long, fi: int, len: int): boolean { - const unboxedVal: long = val.unboxed() + const unboxedVal: long = val for (let i = fi; i < len; i++) { const tmp = this.$_get_unsafe(i) if (tmp instanceof Long) { @@ -391,7 +391,7 @@ export class Array implements ReadonlyArray, Iterable { } private searchInt(val: Int, fi: int, len: int): boolean { - const unboxedVal: int = val.unboxed() + const unboxedVal: int = val for (let i = fi; i < len; i++) { const tmp = this.$_get_unsafe(i) if (tmp instanceof Int) { diff --git a/static_core/plugins/ets/tests/ani/tests/any_ops/any_set_property_test.cpp b/static_core/plugins/ets/tests/ani/tests/any_ops/any_set_property_test.cpp index 188a1c438b47e8cb2100d7a206f11cf5463dbe02..bc4c407ad7379800e1123d47970d759053232bd1 100644 --- a/static_core/plugins/ets/tests/ani/tests/any_ops/any_set_property_test.cpp +++ b/static_core/plugins/ets/tests/ani/tests/any_ops/any_set_property_test.cpp @@ -92,7 +92,7 @@ TEST_F(AnySetPropertyTest, AnySetByIndex_Valid) ani_ref result {}; ASSERT_EQ(env_->Any_GetByIndex(arrayRef, 0U, &result), ANI_OK); ani_int intResult = 0; - ASSERT_EQ(env_->Object_CallMethodByName_Int(static_cast(result), "unboxed", nullptr, &intResult), + ASSERT_EQ(env_->Object_CallMethodByName_Int(static_cast(result), "toInt", nullptr, &intResult), ANI_OK); ASSERT_EQ(intResult, intValue); } diff --git a/static_core/plugins/ets/tests/ani/tests/array_ops/array_gtest_helper.h b/static_core/plugins/ets/tests/ani/tests/array_ops/array_gtest_helper.h index b42657272728a3b4bde0b7ad81b9944b24b985b2..48cf8d3e8d7380102f4bf96f4f62b86d0b971729 100644 --- a/static_core/plugins/ets/tests/ani/tests/array_ops/array_gtest_helper.h +++ b/static_core/plugins/ets/tests/ani/tests/array_ops/array_gtest_helper.h @@ -32,8 +32,8 @@ public: env_->Class_FindMethod(intClass, "", "i:", &intCtor); ASSERT(booleanCtor != nullptr); ASSERT(intCtor != nullptr); - env_->Class_FindMethod(booleanClass, "unboxed", ":z", &booleanUnbox); - env_->Class_FindMethod(intClass, "unboxed", ":i", &intUnbox); + env_->Class_FindMethod(booleanClass, "toBoolean", ":z", &booleanUnbox); + env_->Class_FindMethod(intClass, "toInt", ":i", &intUnbox); ASSERT(booleanUnbox != nullptr); ASSERT(intUnbox != nullptr); } diff --git a/static_core/plugins/ets/tests/ani/tests/tuple_ops/tuplevalue_getitem_ref_test.cpp b/static_core/plugins/ets/tests/ani/tests/tuple_ops/tuplevalue_getitem_ref_test.cpp index 73afed6a06c69f7f97e5c90233be6de74f15ccbe..b831b87101a72b6e1936c5088588e46edaa9c914 100644 --- a/static_core/plugins/ets/tests/ani/tests/tuple_ops/tuplevalue_getitem_ref_test.cpp +++ b/static_core/plugins/ets/tests/ani/tests/tuple_ops/tuplevalue_getitem_ref_test.cpp @@ -57,7 +57,7 @@ protected: ASSERT_EQ(env_->FindClass("std.core.Double", &doubleClass), ANI_OK); ASSERT(doubleClass != nullptr); ani_method doubleUnbox; - env_->Class_FindMethod(doubleClass, "unboxed", ":d", &doubleUnbox); + env_->Class_FindMethod(doubleClass, "toDouble", ":d", &doubleUnbox); ASSERT(doubleClass != nullptr); ani_ref result {}; @@ -149,7 +149,7 @@ TEST_F(TupleValueGetItemRefTest, tupleValueGetItemIntCompositeScene) ASSERT_EQ(env_->FindClass("std.core.Double", &doubleClass), ANI_OK); ASSERT(doubleClass != nullptr); ani_method doubleUnbox; - env_->Class_FindMethod(doubleClass, "unboxed", ":d", &doubleUnbox); + env_->Class_FindMethod(doubleClass, "toDouble", ":d", &doubleUnbox); ASSERT(doubleClass != nullptr); ASSERT_EQ(env_->TupleValue_GetItem_Ref(tuple, 1U, &result), ANI_OK); diff --git a/static_core/plugins/ets/tests/checked/escape_analysis_casted.ets b/static_core/plugins/ets/tests/checked/escape_analysis_casted.ets index 2fbb3bba1a8d612bedf42c68552795451059d644..d58fa0dafa154008bcce1cb0a37b5156e831fbf8 100644 --- a/static_core/plugins/ets/tests/checked/escape_analysis_casted.ets +++ b/static_core/plugins/ets/tests/checked/escape_analysis_casted.ets @@ -46,7 +46,7 @@ class A { let s: byte = -128 as byte; function main_char(): int { - let c: char = new A(s).fld.unboxed(); + let c: char = new A(s).fld.toChar(); if (c != c'\uFF80') { return 1; } @@ -90,7 +90,7 @@ class B { let b: int = (1 << 17) + (1 << 8) + 1; function main_long(): int { - let c: char = new B(b).fld.unboxed(); + let c: char = new B(b).fld.toChar(); if (c != c'\u0001') { return 1; } diff --git a/static_core/plugins/ets/tests/ets-templates/03.types/16.literal_types/custom_literal_type.params.yaml b/static_core/plugins/ets/tests/ets-templates/03.types/16.literal_types/custom_literal_type.params.yaml index 1a2784da1c99d925c2eff82c4231744db1aba539..15fd106c7463992edf914a37516a78a987970315 100644 --- a/static_core/plugins/ets/tests/ets-templates/03.types/16.literal_types/custom_literal_type.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/03.types/16.literal_types/custom_literal_type.params.yaml @@ -32,7 +32,7 @@ cases: a = "another str" arktest.assertEQ( a, "another str" ) a = new Number(3) - arktest.assertEQ( a.unboxed(), 3 ) + arktest.assertEQ( a.toDouble(), 3 ) a = "str" arktest.assertEQ( a, "str" ) a = true @@ -49,7 +49,7 @@ cases: a = "another str" arktest.assertEQ( a, "another str" ) a = new Number(3) - arktest.assertEQ( a.unboxed(), 3 ) + arktest.assertEQ( a.toDouble(), 3 ) a = "str" arktest.assertEQ( a, "str" ) a = true diff --git a/static_core/plugins/ets/tests/ets-templates/03.types/17.array_types/object.params.yaml b/static_core/plugins/ets/tests/ets-templates/03.types/17.array_types/object.params.yaml index 53412c81f9ff947ec37776d9171b812a38e63a8d..1fe25a3d79f6be2d4f248d358e14b12504d7f4ef 100644 --- a/static_core/plugins/ets/tests/ets-templates/03.types/17.array_types/object.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/03.types/17.array_types/object.params.yaml @@ -29,7 +29,7 @@ cases: assert: '[0] == Color.Red' # reference types - - { type: 'Byte[]', vals: '[new Byte(127 as byte), new Byte(2 as byte), new Byte(1 as byte)]', assert: '[0].unboxed() == 127' } + - { type: 'Byte[]', vals: '[new Byte(127 as byte), new Byte(2 as byte), new Byte(1 as byte)]', assert: '[0].toByte() == 127' } - { type: 'Error[]', vals: '[new Error("A"), new Error("B"), new Error("C")]', assert: '[0].message == "A"' } - { type: 'string[][]', vals: 'new string[2][2]; arr[1][1] = "ABC"', assert: '[1][1] == "ABC"' } - decl: |- diff --git a/static_core/plugins/ets/tests/ets-templates/03.types/17.array_types/types.params.yaml b/static_core/plugins/ets/tests/ets-templates/03.types/17.array_types/types.params.yaml index 279ce94325fb0d6bdef9758ac6c8d95a590245cf..ab84c9ff6a784585709eeb395baf1ffe760be787 100644 --- a/static_core/plugins/ets/tests/ets-templates/03.types/17.array_types/types.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/03.types/17.array_types/types.params.yaml @@ -30,7 +30,7 @@ cases: assert: 'arr[0] == Color.Green' # reference types - - { type: 'Byte[]', vals: '[new Byte((127).toByte()), new Byte((2).toByte()), new Byte((1).toByte())]', val: new Byte((42).toByte()), assert: 'arr[0].unboxed() == 42' } + - { type: 'Byte[]', vals: '[new Byte((127).toByte()), new Byte((2).toByte()), new Byte((1).toByte())]', val: new Byte((42).toByte()), assert: 'arr[0].toByte() == 42' } - { type: 'Error[]', vals: '[new Error("A"), new Error("B"), new Error("C")]', val: new Error("D"), assert: 'arr[0].message == "D"' } # type aliases @@ -39,7 +39,7 @@ cases: type: A[] vals: 'new A[2]' val: 'new Boolean(true)' - assert: 'arr[0] instanceof Boolean && (arr[0] as Boolean).unboxed()' + assert: 'arr[0] instanceof Boolean && (arr[0] as Boolean).toBoolean()' - decl: |- type A = (Object|null)[] diff --git a/static_core/plugins/ets/tests/ets-templates/03.types/21.nullish_types/array_nullable_types.params.yaml b/static_core/plugins/ets/tests/ets-templates/03.types/21.nullish_types/array_nullable_types.params.yaml index 30045f8d75efd31fafc388dc639861ce75b8dcf9..3bc26bc3187bf48c7bff4db15f181692a79dcd44 100644 --- a/static_core/plugins/ets/tests/ets-templates/03.types/21.nullish_types/array_nullable_types.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/03.types/21.nullish_types/array_nullable_types.params.yaml @@ -40,7 +40,7 @@ nullables: type: 'Z[]' vals: '[undefined]' val: 'new Int(66)' - assert: 'x[0]!.unboxed() == 66' + assert: 'x[0]!.toInt() == 66' - decl: |- type Z = (Int | null)[] @@ -61,4 +61,4 @@ nullables: type: 'Z' vals: '[undefined]' val: 'new Int(66)' - assert: 'x[0]!.unboxed() == 66' + assert: 'x[0]!.toInt() == 66' diff --git a/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/assn_var/assn-var.ets b/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/assn_var/assn-var.ets index 02293176ffb3d8a0981bea404c03a230051e269b..f2e3cd65dcf85530190c450cda5b729ec52470c3 100644 --- a/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/assn_var/assn-var.ets +++ b/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/assn_var/assn-var.ets @@ -26,7 +26,7 @@ function main(): int { {%- for t in c['values'] %} let s{{loop.index}}: {{c.from_type}} = {{t.expr|safe}} d{{loop.index}} = s{{loop.index}} - if (d{{loop.index}}.unboxed() != {{t.val}}) { + if (d{{loop.index}} != {{t.val}}) { return 1 } {%- endfor %} diff --git a/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/call_cons/call-cons-nan.ets b/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/call_cons/call-cons-nan.ets index 7c774728c305ad06bde6e0e4f66d62f34c168400..8775af8bc217aa0cd10cfd338ecd894d44f7c84d 100644 --- a/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/call_cons/call-cons-nan.ets +++ b/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/call_cons/call-cons-nan.ets @@ -27,7 +27,7 @@ class A { function main(): int { {%- for t in c['values'] %} let s{{loop.index}}: {{c.from_type}} = {{t.expr|safe}} - if (! {{c.to_type}}.isNaN(new A(s{{loop.index}}).f.unboxed())) { + if (! {{c.to_type}}.isNaN(new A(s{{loop.index}}).f)) { return 1 } {%- endfor %} diff --git a/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/call_cons/call-cons.ets b/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/call_cons/call-cons.ets index 2f7fc8ce75d9b8ffe512fd67931839d4f2008c95..cf3de2e1f5cedb77fdc6ff771fb3568b632fd35b 100644 --- a/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/call_cons/call-cons.ets +++ b/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/call_cons/call-cons.ets @@ -27,7 +27,7 @@ class A { function main(): int { {%- for t in c['values'] %} let s{{loop.index}}: {{c.from_type}} = {{t.expr|safe}} - if (new A(s{{loop.index}}).f.unboxed() != {{t.val}}) { + if (new A(s{{loop.index}}).f != {{t.val}}) { return 1 } {%- endfor %} diff --git a/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/call_func/call-func-nan.ets b/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/call_func/call-func-nan.ets index 6d135605310bdf419c6b1a95585371ff213c4739..f8c17ed8503b8e17fac3d68f02f06bb404d48cf7 100644 --- a/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/call_func/call-func-nan.ets +++ b/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/call_func/call-func-nan.ets @@ -24,7 +24,7 @@ function foo(p: {{c.to_type}}): {{c.to_type}} { return p } function main(): int { {%- for t in c['values'] %} let s{{loop.index}}: {{c.from_type}} = {{t.expr|safe}} - if (! {{c.to_type}}.isNaN(foo(s{{loop.index}}).unboxed())) { + if (! {{c.to_type}}.isNaN(foo(s{{loop.index}}))) { return 1 } {%- endfor %} diff --git a/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/call_func/call-func.ets b/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/call_func/call-func.ets index c3cc3e149db69a9f8278b733a745e7a4f985e169..e192b82704a582a3e3e35093a874a534b5aef943 100644 --- a/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/call_func/call-func.ets +++ b/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/call_func/call-func.ets @@ -24,7 +24,7 @@ function foo(p: {{c.to_type}}): {{c.to_type}} { return p } function main(): int { {%- for t in c['values'] %} let s{{loop.index}}: {{c.from_type}} = {{t.expr|safe}} - if (foo(s{{loop.index}}).unboxed() != {{t.val}}) { + if (foo(s{{loop.index}}) != {{t.val}}) { return 1 } {%- endfor %} diff --git a/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/call_lmbd/call-lmbd-nan.ets b/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/call_lmbd/call-lmbd-nan.ets index f67a03c0c7fe0969c21d5ad08911430c86e37419..5bf1ca3f5c54f62d7f812aeb1c640c64062d82f0 100644 --- a/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/call_lmbd/call-lmbd-nan.ets +++ b/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/call_lmbd/call-lmbd-nan.ets @@ -22,7 +22,7 @@ params: NaN conversion from {{c.from_type}} to {{c.to_type}} function main(): int { {%- for t in c['values'] %} let s{{loop.index}}: {{c.from_type}} = {{t.expr|safe}} - if (! {{c.to_type}}.isNaN(((p: {{c.to_type}}): {{c.to_type}} => { return p })(s{{loop.index}}).unboxed())) { + if (! {{c.to_type}}.isNaN(((p: {{c.to_type}}): {{c.to_type}} => { return p })(s{{loop.index}}))) { return 1 } {%- endfor %} diff --git a/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/call_lmbd/call-lmbd.ets b/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/call_lmbd/call-lmbd.ets index 804c8e0affc9be2f422a3164bb3ac18e115bd55a..6ea6f761e0a137b0bb8436980b43a675e3c5f9e6 100644 --- a/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/call_lmbd/call-lmbd.ets +++ b/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/call_lmbd/call-lmbd.ets @@ -22,7 +22,7 @@ params: from {{c.from_type}} to {{c.to_type}} function main(): int { {%- for t in c['values'] %} let s{{loop.index}}: {{c.from_type}} = {{t.expr|safe}} - if (((p: {{c.to_type}}): {{c.to_type}} => { return p })(s{{loop.index}}).unboxed() != {{t.val}}) { + if (((p: {{c.to_type}}): {{c.to_type}} => { return p })(s{{loop.index}}) != {{t.val}}) { return 1 } {%- endfor %} diff --git a/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/call_meth/call-meth-nan.ets b/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/call_meth/call-meth-nan.ets index 0236c2750ac8226d38acaa3d8f9dd9f033690b1e..9d775dbb43e274db11d04e2242f8abe9ffcb3fe6 100644 --- a/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/call_meth/call-meth-nan.ets +++ b/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/call_meth/call-meth-nan.ets @@ -27,7 +27,7 @@ function main(): int { let a: A = new A() {%- for t in c['values'] %} let s{{loop.index}}: {{c.from_type}} = {{t.expr|safe}} - if (! {{c.to_type}}.isNaN(a.meth(s{{loop.index}}).unboxed())) { + if (! {{c.to_type}}.isNaN(a.meth(s{{loop.index}}))) { return 1 } {%- endfor %} diff --git a/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/call_meth/call-meth.ets b/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/call_meth/call-meth.ets index be95b54ba7d0b9753bd72c940936a3248c45cc8d..0b8e1b769f3467579981258e2833b3beae49ae22 100644 --- a/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/call_meth/call-meth.ets +++ b/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/call_meth/call-meth.ets @@ -27,7 +27,7 @@ function main(): int { let a: A = new A() {%- for t in c['values'] %} let s{{loop.index}}: {{c.from_type}} = {{t.expr|safe}} - if (a.meth(s{{loop.index}}).unboxed() != {{t.val}}) { + if (a.meth(s{{loop.index}}) != {{t.val}}) { return 1 } {%- endfor %} diff --git a/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/comp_arr/comp-arr-nan.ets b/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/comp_arr/comp-arr-nan.ets index 9739e7a334cae776b3752f5228ec113a199e74ca..c3fa16327951e5dcccc89de2ebc8d56be70e04f6 100644 --- a/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/comp_arr/comp-arr-nan.ets +++ b/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/comp_arr/comp-arr-nan.ets @@ -27,7 +27,7 @@ function main(): int { let d{{loop.index}}: {{c.to_type}}[] = [s{{loop.index}}, s{{loop.index}}] d{{loop.index}} = [] d{{loop.index}} = [s{{loop.index}}] - if (! {{c.to_type}}.isNaN(d{{loop.index}}[0].unboxed())) { + if (! {{c.to_type}}.isNaN(d{{loop.index}}[0])) { return 1 } {%- endfor %} diff --git a/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/comp_arr/comp-arr.ets b/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/comp_arr/comp-arr.ets index deb2d8d1951a516dab2567982846eb755497bf43..a4ff54f3deeff76246ed4cae60a10c8ab090f556 100644 --- a/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/comp_arr/comp-arr.ets +++ b/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/comp_arr/comp-arr.ets @@ -27,7 +27,7 @@ function main(): int { let d{{loop.index}}: {{c.to_type}}[] = [s{{loop.index}}, s{{loop.index}}] d{{loop.index}} = [] d{{loop.index}} = [s{{loop.index}}] - if (d{{loop.index}}[0].unboxed() != {{t.val}}) { + if (d{{loop.index}}[0] != {{t.val}}) { return 1 } {%- endfor %} diff --git a/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/comp_obj/comp-clss-nan.ets b/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/comp_obj/comp-clss-nan.ets index b789859c0c01b996974ff3d2c199a08eb8c6def1..b9687fb414753c22bcf4002fc2b02ab22ed774e3 100644 --- a/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/comp_obj/comp-clss-nan.ets +++ b/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/comp_obj/comp-clss-nan.ets @@ -26,7 +26,7 @@ let s{{loop.index}}: {{c.from_type}} = {{t.expr|safe}}; function main(): int { {%- for t in c['values'] %} let d{{loop.index}}: A{{loop.index}} = { fld: s{{loop.index}} } - if (! {{c.to_type}}.isNaN(d{{loop.index}}.fld.unboxed())) { + if (! {{c.to_type}}.isNaN(d{{loop.index}}.fld)) { return 1 } {%- endfor %} diff --git a/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/comp_obj/comp-clss.ets b/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/comp_obj/comp-clss.ets index 0d89d12e5a7ae83248f5873806160638608b5e99..65c4e08a8fa2b6a4ad9d6674ad3759ebf64bd952 100644 --- a/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/comp_obj/comp-clss.ets +++ b/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/comp_obj/comp-clss.ets @@ -26,7 +26,7 @@ let s{{loop.index}}: {{c.from_type}} = {{t.expr|safe}}; function main(): int { {%- for t in c['values'] %} let d{{loop.index}}: A{{loop.index}} = { fld: s{{loop.index}} } - if (d{{loop.index}}.fld.unboxed() != {{t.val}}) { + if (d{{loop.index}}.fld != {{t.val}}) { return 1 } {%- endfor %} diff --git a/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/comp_obj/comp-intf-nan.ets b/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/comp_obj/comp-intf-nan.ets index 4c2d8405e17472d9744fe703361d17a7c0cd9bb1..b40507a467dff7080caecb4775ff0d1de3f57c03 100644 --- a/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/comp_obj/comp-intf-nan.ets +++ b/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/comp_obj/comp-intf-nan.ets @@ -26,7 +26,7 @@ let s{{loop.index}}: {{c.from_type}} = {{t.expr|safe}}; function main(): int { {%- for t in c['values'] %} let d{{loop.index}}: J{{loop.index}} = { fld: s{{loop.index}} } - if (! {{c.to_type}}.isNaN(d{{loop.index}}.fld.unboxed())) { + if (! {{c.to_type}}.isNaN(d{{loop.index}}.fld)) { return 1 } {%- endfor %} diff --git a/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/comp_obj/comp-intf.ets b/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/comp_obj/comp-intf.ets index 3bd64f4cd962c62b7c94acfb3180cb8b9ea0a317..2e271b8e70c4c42c2deb61c43ec0446a4601f975 100644 --- a/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/comp_obj/comp-intf.ets +++ b/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/comp_obj/comp-intf.ets @@ -26,7 +26,7 @@ let s{{loop.index}}: {{c.from_type}} = {{t.expr|safe}}; function main(): int { {%- for t in c['values'] %} let d{{loop.index}}: J{{loop.index}} = { fld: s{{loop.index}} } - if (d{{loop.index}}.fld.unboxed() != {{t.val}}) { + if (d{{loop.index}}.fld != {{t.val}}) { return 1 } {%- endfor %} diff --git a/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/decl_const/decl-const-nan.ets b/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/decl_const/decl-const-nan.ets index 1020699164dacd9379c898b50a0242506ea24bb3..98968a9d417c61cec1ace097ec8f50c4ae1f9843 100644 --- a/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/decl_const/decl-const-nan.ets +++ b/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/decl_const/decl-const-nan.ets @@ -23,7 +23,7 @@ function main(): int { {%- for t in c['values'] %} let s{{loop.index}}: {{c.from_type}} = {{t.expr|safe}} const d{{loop.index}}: {{c.to_type}} = s{{loop.index}} - if (! {{c.to_type}}.isNaN(d{{loop.index}}.unboxed())) { + if (! {{c.to_type}}.isNaN(d{{loop.index}})) { return 1 } {%- endfor %} diff --git a/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/decl_const/decl-const.ets b/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/decl_const/decl-const.ets index cae66a4f655c3838817e7c8b4ba9c3cddcb8b9df..3373c05cae98ecde059a50f0e9b091726baf7e67 100644 --- a/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/decl_const/decl-const.ets +++ b/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/decl_const/decl-const.ets @@ -23,7 +23,7 @@ function main(): int { {%- for t in c['values'] %} let s{{loop.index}}: {{c.from_type}} = {{t.expr|safe}} const d{{loop.index}}: {{c.to_type}} = s{{loop.index}} - if (d{{loop.index}}.unboxed() != {{t.val}}) { + if (d{{loop.index}} != {{t.val}}) { return 1 } {%- endfor %} diff --git a/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/decl_field/decl-field-nan.ets b/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/decl_field/decl-field-nan.ets index cb2ac512b6a0447110b38e1a445f336ec0a185d3..e615efeace4a1b3e121b167663ed5e2d925f44f3 100644 --- a/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/decl_field/decl-field-nan.ets +++ b/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/decl_field/decl-field-nan.ets @@ -29,7 +29,7 @@ class A{{loop.index}} { function main(): int { {%- for t in c['values'] %} let a{{loop.index}}: A{{loop.index}} = new A{{loop.index}}() - if (! {{c.to_type}}.isNaN(a{{loop.index}}.d.unboxed())) { + if (! {{c.to_type}}.isNaN(a{{loop.index}}.d)) { return 1 } {%- endfor %} diff --git a/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/decl_field/decl-field.ets b/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/decl_field/decl-field.ets index e09cec8e7ca7a607da4c58da3bbcf91e61fa8d6d..47c3c04fa5076f9ff78e2e3e8f80aa3085304d32 100644 --- a/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/decl_field/decl-field.ets +++ b/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/decl_field/decl-field.ets @@ -29,7 +29,7 @@ class A{{loop.index}} { function main(): int { {%- for t in c['values'] %} let a{{loop.index}}: A{{loop.index}} = new A{{loop.index}}() - if (a{{loop.index}}.d.unboxed() != {{t.val}}) { + if (a{{loop.index}}.d != {{t.val}}) { return 1 } {%- endfor %} diff --git a/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/decl_var/decl-var.ets b/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/decl_var/decl-var.ets index 5b21318981e2e55b0190f1880c260bfd02526664..589ec8a1062fb54045acf628513cd96ef7192334 100644 --- a/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/decl_var/decl-var.ets +++ b/static_core/plugins/ets/tests/ets-templates/03.types/alias_conversion/decl_var/decl-var.ets @@ -23,7 +23,7 @@ function main(): int { {%- for t in c['values'] %} let s{{loop.index}}: {{c.from_type}} = {{t.expr|safe}} let d{{loop.index}}: {{c.to_type}} = s{{loop.index}} - if (d{{loop.index}}.unboxed() != {{t.val}}) { + if (d{{loop.index}} != {{t.val}}) { return 1 } {%- endfor %} diff --git a/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/04.accessible/type_declaration_areas.params.yaml b/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/04.accessible/type_declaration_areas.params.yaml index 28559cc9422965f54c607b8649e61a3326cd383d..00aa6c163c772fbf228afb5e6768e0e85054bc5c 100644 --- a/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/04.accessible/type_declaration_areas.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/04.accessible/type_declaration_areas.params.yaml @@ -18,7 +18,7 @@ cases: let checked = false; { let a: A = new Boolean(true); - checked = a.unboxed(); + checked = a; } function main() { diff --git a/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/04.accessible/type_name_class_field.params.yaml b/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/04.accessible/type_name_class_field.params.yaml index e7b1b18224597f0529bf97ede15ee4de9885c0a0..2806f702e640878321625cc5da69edefbe2bd985 100644 --- a/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/04.accessible/type_name_class_field.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/04.accessible/type_name_class_field.params.yaml @@ -141,118 +141,6 @@ cases: } # Boxed - - decl: |- - type T = Byte - field: |- - foo: T = new Byte(0x7F.toByte()); - static sfoo: T = new Byte(0x7F.toByte()); - check: |- - function main() { - arktest.assertEQ(A.sfoo.unboxed(), 0x7F.toByte()); - let a: A = new A(); - arktest.assertEQ(a.foo.unboxed(), 0x7F.toByte()); - arktest.assertEQ(a.bar(a.foo).unboxed(), 0x7F.toByte()); - arktest.assertEQ(A.sbar(a.foo).unboxed(), 0x7F.toByte()); - } - - - decl: |- - type T = Short - field: |- - foo: T = new Short(2); - static sfoo: T = new Short(2); - check: |- - function main() { - arktest.assertEQ(A.sfoo.unboxed(), new Short(2)); - let a: A = new A(); - arktest.assertEQ(a.foo.unboxed(), new Short(2)); - arktest.assertEQ(a.bar(a.foo).unboxed(), new Short(2)); - arktest.assertEQ(A.sbar(a.foo).unboxed(), new Short(2)); - } - - - decl: |- - type T = Int - field: |- - foo: T = new Int(3); - static sfoo: T = new Int(3); - check: |- - function main() { - arktest.assertEQ(A.sfoo.unboxed(), new Int(3)); - let a: A = new A(); - arktest.assertEQ(a.foo.unboxed(), new Int(3)); - arktest.assertEQ(a.bar(a.foo).unboxed(), new Int(3)); - arktest.assertEQ(A.sbar(a.foo).unboxed(), new Int(3)); - } - - - decl: |- - type T = Long - field: |- - foo: T = new Long(4); - static sfoo: T = new Long(4); - check: |- - function main() { - arktest.assertEQ(A.sfoo.unboxed(), new Long(4)); - let a: A = new A(); - arktest.assertEQ(a.foo.unboxed(), new Long(4)); - arktest.assertEQ(a.bar(a.foo).unboxed(), new Long(4)); - arktest.assertEQ(A.sbar(a.foo).unboxed(), new Long(4)); - } - - - decl: |- - type T = Float - field: |- - foo: T = new Float(0.1); - static sfoo: T = new Float(0.1); - check: |- - function main() { - arktest.assertEQ(A.sfoo.unboxed(), new Float(0.1)); - let a: A = new A(); - arktest.assertEQ(a.foo.unboxed(), new Float(0.1)); - arktest.assertEQ(a.bar(a.foo).unboxed(), new Float(0.1)); - arktest.assertEQ(A.sbar(a.foo).unboxed(), new Float(0.1)); - } - - - decl: |- - type T = Double - field: |- - foo: T = new Double(0.1); - static sfoo: T = new Double(0.1); - check: |- - function main() { - arktest.assertEQ(A.sfoo.unboxed(), new Double(0.1)); - let a: A = new A(); - arktest.assertEQ(a.foo.unboxed(), new Double(0.1)); - arktest.assertEQ(a.bar(a.foo).unboxed(), new Double(0.1)); - arktest.assertEQ(A.sbar(a.foo).unboxed(), new Double(0.1)); - } - - - decl: |- - type T = Number - field: |- - foo: T = new Number(0.1 as number); - static sfoo: T = new Number(0.1 as number); - check: |- - function main() { - arktest.assertEQ(A.sfoo.unboxed(), 0.1 as number); - let a: A = new A(); - arktest.assertEQ(a.foo.unboxed(), 0.1 as number); - arktest.assertEQ(a.bar(a.foo).unboxed(), 0.1 as number); - arktest.assertEQ(A.sbar(a.foo).unboxed(), 0.1 as number); - } - - - decl: |- - type T = Char - field: |- - foo: T = new Char(c'b'); - static sfoo: T = new Char(c'b'); - check: |- - function main() { - arktest.assertEQ(A.sfoo.unboxed(), c'b'); - let a: A = new A(); - arktest.assertEQ(a.foo.unboxed(), c'b'); - arktest.assertEQ(a.bar(a.foo).unboxed(), c'b'); - arktest.assertEQ(A.sbar(a.foo).unboxed(), c'b'); - } - - decl: |- type T = string field: |- @@ -281,20 +169,6 @@ cases: arktest.assertEQ(A.sbar(a.foo), "some string"); } - - decl: |- - type T = Boolean - field: |- - foo: T = new Boolean(false); - static sfoo: T = new Boolean(true); - check: |- - function main() { - arktest.assertEQ(A.sfoo.unboxed(), true); - let a: A = new A(); - arktest.assertEQ(a.foo.unboxed(), false); - arktest.assertEQ(a.bar(A.sfoo).unboxed(), true); - arktest.assertEQ(A.sbar(a.foo).unboxed(), false); - } - # Custom - decl: |- type T = int[] diff --git a/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/04.accessible/type_name_interface_prop.params.yaml b/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/04.accessible/type_name_interface_prop.params.yaml index 059be7470b7ed2422c0286c80620896ce8cbd644..36855ce89f40d7c592841297571402484115a749 100644 --- a/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/04.accessible/type_name_interface_prop.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/04.accessible/type_name_interface_prop.params.yaml @@ -114,94 +114,6 @@ cases: } # Boxed - - decl: |- - type T = Byte - init: |- - foo = new Byte(0x7F.toByte()); - check: |- - function main() { - let a: A = new A(); - arktest.assertEQ(a.foo.unboxed(), 0x7F.toByte()); - arktest.assertEQ(a.bar(a.foo).unboxed(), 0x7F.toByte()); - } - - - decl: |- - type T = Short - init: |- - foo = new Short(2); - check: |- - function main() { - let a: A = new A(); - arktest.assertEQ(a.foo.unboxed(), new Short(2)); - arktest.assertEQ(a.bar(a.foo).unboxed(), new Short(2)); - } - - - decl: |- - type T = Int - init: |- - foo = new Int(3); - check: |- - function main() { - let a: A = new A(); - arktest.assertEQ(a.foo.unboxed(), new Int(3)); - arktest.assertEQ(a.bar(a.foo).unboxed(), new Int(3)); - } - - - decl: |- - type T = Long - init: |- - foo = new Long(4); - check: |- - function main() { - let a: A = new A(); - arktest.assertEQ(a.foo.unboxed(), new Long(4)); - arktest.assertEQ(a.bar(a.foo).unboxed(), new Long(4)); - } - - - decl: |- - type T = Float - init: |- - foo = new Float(0.1); - check: |- - function main() { - let a: A = new A(); - arktest.assertEQ(a.foo.unboxed(), new Float(0.1)); - arktest.assertEQ(a.bar(a.foo).unboxed(), new Float(0.1)); - } - - - decl: |- - type T = Double - init: |- - foo = new Double(0.1); - check: |- - function main() { - let a: A = new A(); - arktest.assertEQ(a.foo.unboxed(), new Double(0.1)); - arktest.assertEQ(a.bar(a.foo).unboxed(), new Double(0.1)); - } - - - decl: |- - type T = Number - init: |- - foo = new Number(0.1 as number); - check: |- - function main() { - let a: A = new A(); - arktest.assertEQ(a.foo.unboxed(), 0.1 as number); - arktest.assertEQ(a.bar(a.foo).unboxed(), 0.1 as number); - } - - - decl: |- - type T = Char - init: |- - foo = new Char(c'b'); - check: |- - function main() { - let a: A = new A(); - arktest.assertEQ(a.foo.unboxed(), c'b'); - arktest.assertEQ(a.bar(a.foo).unboxed(), c'b'); - } - - decl: |- type T = string init: |- @@ -224,17 +136,6 @@ cases: arktest.assertEQ(a.bar(a.foo), "some string"); } - - decl: |- - type T = Boolean - init: |- - foo = new Boolean(false); - check: |- - function main() { - let a: A = new A(); - arktest.assertEQ(a.foo.unboxed(), false); - arktest.assertEQ(a.bar(a.foo).unboxed(), false); - } - # Custom - decl: |- type T = int[] @@ -263,16 +164,16 @@ cases: arktest.assertEQ(a.foo.length, 2); arktest.assertEQ(a.foo[0].length, 2); arktest.assertEQ(a.foo[1].length, 1); - arktest.assertEQ(a.foo[0][0].unboxed(), 1); - arktest.assertEQ(a.foo[0][1].unboxed(), 3); - arktest.assertEQ(a.foo[1][0].unboxed(), -2); + arktest.assertEQ(a.foo[0][0], 1); + arktest.assertEQ(a.foo[0][1], 3); + arktest.assertEQ(a.foo[1][0], -2); let c = a.bar(a.foo); arktest.assertEQ(a.foo.length, c.length); arktest.assertEQ(a.foo[0].length, c[0].length); arktest.assertEQ(a.foo[1].length, c[1].length); - arktest.assertEQ(a.foo[0][0].unboxed(), c[0][0].unboxed()); - arktest.assertEQ(a.foo[0][1].unboxed(), c[0][1].unboxed()); - arktest.assertEQ(a.foo[1][0].unboxed(), c[1][0].unboxed()); + arktest.assertEQ(a.foo[0][0], c[0][0]); + arktest.assertEQ(a.foo[0][1], c[0][1]); + arktest.assertEQ(a.foo[1][0], c[1][0]); } - decl: |- diff --git a/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/04.accessible/type_name_params.params.yaml b/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/04.accessible/type_name_params.params.yaml index e9e290d5499d8c8b8aae669f0faa2e2816fa2cce..d8e62d577f831e514e91425884996bad22974b30 100644 --- a/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/04.accessible/type_name_params.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/04.accessible/type_name_params.params.yaml @@ -87,70 +87,6 @@ cases: } # Boxed - - decl: |- - type T = Byte - check: |- - function main() { - let a: T = new Byte(0x7F.toByte()); - arktest.assertEQ(foo(a).unboxed(), 0x7F.toByte()); - } - - - decl: |- - type T = Short - check: |- - function main() { - let a: T = new Short(2); - arktest.assertEQ(foo(a).unboxed(), new Short(2)); - } - - - decl: |- - type T = Int - check: |- - function main() { - let a: T = new Int(3); - arktest.assertEQ(foo(a).unboxed(), new Int(3)); - } - - - decl: |- - type T = Long - check: |- - function main() { - let a: T = new Long(4); - arktest.assertEQ(foo(a).unboxed(), new Long(4)); - } - - - decl: |- - type T = Float - check: |- - function main() { - let a: T = new Float(0.1); - arktest.assertEQ(foo(a).unboxed(), new Float(0.1)); - } - - - decl: |- - type T = Double - check: |- - function main() { - let a: T = new Double(0.1); - arktest.assertEQ(foo(a).unboxed(), new Double(0.1)); // Double is an alias to Number - } - - - decl: |- - type T = Number - check: |- - function main() { - let a: T = new Number(0.1 as number); - arktest.assertEQ(foo(a).unboxed(), 0.1 as number); - } - - - decl: |- - type T = Char - check: |- - function main() { - let a: T = new Char(c'b'); - arktest.assertEQ(foo(a).unboxed(), c'b'); - } - - decl: |- type T = string check: |- @@ -167,14 +103,6 @@ cases: arktest.assertEQ(foo(a), "some string"); } - - decl: |- - type T = Boolean - check: |- - function main() { - let a: T = new Boolean(false); - arktest.assertEQ(foo(a).unboxed(), false); - } - # Custom - decl: |- type T = int[] @@ -196,8 +124,8 @@ cases: arktest.assertEQ(a.length, b.length); arktest.assertEQ(a[0].length, b[0].length); arktest.assertEQ(a[1].length, b[1].length); - arktest.assertEQ(a[0][0].unboxed(), b[0][0].unboxed()); - arktest.assertEQ(a[1][0].unboxed(), b[1][0].unboxed()); + arktest.assertEQ(a[0][0], b[0][0]); + arktest.assertEQ(a[1][0], b[1][0]); } - decl: |- diff --git a/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/05.type_declarations/01.type_alias_declaration/alias.params.yaml b/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/05.type_declarations/01.type_alias_declaration/alias.params.yaml index 387b8e8843482f47aef8891c72076fa23c93e868..65fe7479bea20c7d99532c5f59faaed414a9be05 100644 --- a/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/05.type_declarations/01.type_alias_declaration/alias.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/05.type_declarations/01.type_alias_declaration/alias.params.yaml @@ -20,24 +20,6 @@ cases: let v: Rating = 1.1 let ok = (v as double) == 1.1 - # boxed refs - - defs: |- - type Burden = Load - type Load = Mass - type Mass = Weight - type Weight = Double - use: |- - let v: Burden = new Double(1.1) - let ok = v.unboxed() == 1.1 - - - defs: |- - type Weight = Double|null - type Burden = Weight - use: |- - let v1: Burden = null - let v2: Burden = 42.0 - let ok = v1 == null && v2.unboxed() == 42.0 - # arrays - defs: |- type IntArray = int[] @@ -108,7 +90,7 @@ cases: type Func = (p: long) => Long use: |- let v: Func = foo - let ok = v(-9223372036854775808 as long).unboxed() == Long.MIN_VALUE + let ok = v(-9223372036854775808 as long) == Long.MIN_VALUE # classes - defs: |- diff --git a/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/05.type_declarations/01.type_alias_declaration/alias_gen.params.yaml b/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/05.type_declarations/01.type_alias_declaration/alias_gen.params.yaml index bc8c65ce30c4a9ca1eb0d394fbf88c38d2814238..1083b16d7c680fe406082a3f947a3081323acaf0 100644 --- a/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/05.type_declarations/01.type_alias_declaration/alias_gen.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/05.type_declarations/01.type_alias_declaration/alias_gen.params.yaml @@ -18,14 +18,14 @@ cases: type Func = (p: int) => T; use: |- let v: Func = (p: int): Int => { return new Int(p); }; - let ok = v(1).unboxed() == 1; + let ok = v(1) == 1; - defs: |- type Func = (p: int) => T; type NullableFunc = Func|null; use: |- let v: NullableFunc = (p: int): Int => { return new Int(p); }; - let ok = v(1).unboxed() == 1; + let ok = v(1) == 1; - defs: |- type Func = (p: int) => T; @@ -55,14 +55,14 @@ cases: type FF = Func[] use: |- let v: FF = [(p: int): Int => { return new Int(p); }] - let ok = v[0](1).unboxed() == 1; + let ok = v[0](1) == 1; - defs: |- type Func = (p: int) => T; type FF = Func[] use: |- let v: FF = [(p: int): Int => { return new Int(p); }] - let ok = v[0](1).unboxed() == 1; + let ok = v[0](1) == 1; # classes - defs: |- diff --git a/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/06.variable_and_constant_declarations/01.variable_declarations/var_decl.params.yaml b/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/06.variable_and_constant_declarations/01.variable_declarations/var_decl.params.yaml index 26b241febdaaa56915616b473b4bf0ffef309313..9c821d3f698ee1e97e5cdc62a792b3b57fc60027 100644 --- a/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/06.variable_and_constant_declarations/01.variable_declarations/var_decl.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/06.variable_and_constant_declarations/01.variable_declarations/var_decl.params.yaml @@ -32,4 +32,4 @@ var_decl: - decl: let x:Object; use: x = new Number(42); // assigned before first use - assert: x instanceof Number && (x as Number).unboxed() == 42 + assert: x instanceof Number && (x as Number) == 42 diff --git a/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/06.variable_and_constant_declarations/04.type_inference_from_initializer/infer.params.yaml b/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/06.variable_and_constant_declarations/04.type_inference_from_initializer/infer.params.yaml index 819ad2badf9b28cfb55efaf3ddcb7d19624f74cd..bdd8760c941fd62538b9007b94b13b3358c5edaa 100644 --- a/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/06.variable_and_constant_declarations/04.type_inference_from_initializer/infer.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/06.variable_and_constant_declarations/04.type_inference_from_initializer/infer.params.yaml @@ -13,15 +13,6 @@ --- cases: - - decl: 'const INT = 1 + 2 + 3 * 4; // inferred int' - assert: new Int(INT).unboxed() == 15 - - - decl: 'let DOUBLE = 3.0 / 2.0; // inferred double' - assert: new Double(DOUBLE).unboxed() == 1.5 - - - decl: 'const arr = new long[1]; // inferred array of longs' - assert: new Long(arr[0]).unboxed() == 0 as long - - decl: 'let arr = new Object[1]; // inferred array of Objects' use: ' arr[0] = new Object();' assert: arr[0] instanceof Object @@ -29,10 +20,6 @@ cases: - decl: 'let arr = new (Error|undefined)[1]; // inferred array of Error|undefined' assert: arr[0] == undefined - - decl: 'const obj = new Object[1]; // inferred array of Objects' - use: 'obj[0] = new Long(Long.MAX_VALUE);' - assert: obj instanceof Object[] && obj[0] instanceof Long && (obj[0] as Long).unboxed() == Long.MAX_VALUE - - decl: 'let arr:FixedArray>> = new byte[1][2][3]; // inferred three-dimensional array of bytes' assert: arr instanceof FixedArray>> && arr[0][0][0] == 0 diff --git a/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/07.function_declarations/02.parameter_list/param_list.params.yaml b/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/07.function_declarations/02.parameter_list/param_list.params.yaml index 8716a45231b417943fb38ddbb6c9ac46bb2d286d..7264d6901ec6fc2acb91b8150d7ca40c450b2e48 100644 --- a/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/07.function_declarations/02.parameter_list/param_list.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/07.function_declarations/02.parameter_list/param_list.params.yaml @@ -114,4 +114,4 @@ function_decls: } call: |- let v: Byte = foo(1 as byte, null, Long.MIN_VALUE, new Byte(1 as byte), new Byte(2 as byte)) - arktest.assertTrue( v instanceof Byte && v.unboxed() == 1 ) + arktest.assertTrue( v instanceof Byte && v.toByte() == 1 ) diff --git a/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/07.function_declarations/03.readonly_parameters/readonly_custom_neg.params.yaml b/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/07.function_declarations/03.readonly_parameters/readonly_custom_neg.params.yaml index a4be8c00d631bab594dc0caae2ab87bf2ebd7f9f..715dae75628ced12dff74133a49d81fd49f293d6 100644 --- a/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/07.function_declarations/03.readonly_parameters/readonly_custom_neg.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/07.function_declarations/03.readonly_parameters/readonly_custom_neg.params.yaml @@ -159,7 +159,7 @@ cases: - decl: |- function foo(array?: readonly [string, Number]) { - arktest.assertTrue(array[1].unboxed() == 2.2) + arktest.assertTrue(array[1].toDouble() == 2.2) } foo(["str", new Number(2.2)]) diff --git a/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/07.function_declarations/08.return_type_inference/ret_type_infer.params.yaml b/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/07.function_declarations/08.return_type_inference/ret_type_infer.params.yaml index 51f9c0dd7c47aeda2e0161fea840b020c20342c1..1e92cb34e61d8baca5c44a108ed2ca9d2b1ade78 100644 --- a/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/07.function_declarations/08.return_type_inference/ret_type_infer.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/07.function_declarations/08.return_type_inference/ret_type_infer.params.yaml @@ -20,15 +20,6 @@ cases: call: |- arktest.assertTrue(foo() == new Byte(127)); - - decl: |- - function foo() { // infer Byte - return new Byte(127); - } - call: |- - let b = foo(); - arktest.assertTrue(b instanceof Byte); - arktest.assertTrue(b.unboxed() == new Byte(127)); - - decl: |- function foo() { // infer short return 2 as short; @@ -36,24 +27,6 @@ cases: call: |- arktest.assertTrue(foo() == new Short(2)); - - decl: |- - function foo() { // infer Short - return new Short(new Short(2)); - } - call: |- - let b = foo(); - arktest.assertTrue(b instanceof Short); - arktest.assertTrue(b.unboxed() == new Short(2)); - - - decl: |- - function foo() { // infer Int - return new Int(2); - } - call: |- - let b = foo(); - arktest.assertTrue(b instanceof Int); - arktest.assertTrue(b.unboxed() == new Int(2)); - - decl: |- function foo() { // infer long return new Long(3); @@ -61,15 +34,6 @@ cases: call: |- arktest.assertTrue(foo() == new Long(3)); - - decl: |- - function foo() { // infer Long - return new Long(3); - } - call: |- - let b = foo(); - arktest.assertTrue(b instanceof Long); - arktest.assertTrue(b.unboxed() == new Long(3)); - - decl: |- function foo() { // infer float return 4.2f @@ -77,15 +41,6 @@ cases: call: |- arktest.assertTrue(foo() == 4.2f); - - decl: |- - function foo() { // infer Float - return new Float(4.3); - } - call: |- - let b = foo(); - arktest.assertTrue(b instanceof Float); - arktest.assertTrue(b.unboxed() == new Float(4.3)); - - decl: |- function foo() { // infer double return new Double(5.3); @@ -93,24 +48,6 @@ cases: call: |- arktest.assertTrue(foo() == new Double(5.3)); - - decl: |- - function foo() { // infer Double - return new Double(5.4); - } - call: |- - let b = foo(); - arktest.assertTrue(b instanceof Double); - arktest.assertTrue(b.unboxed() == new Double(5.4)); - - - decl: |- - function foo() { // infer Number - return new Number(6.4 as number); - } - call: |- - let b = foo(); - arktest.assertTrue(b instanceof Number); - arktest.assertTrue(b.unboxed() == 6.4 as number); - - decl: |- function foo() { // infer char return c'A'; @@ -118,15 +55,6 @@ cases: call: |- arktest.assertTrue(foo() == c'A'); - - decl: |- - function foo() { // infer Char - return new Char(c'b'); - } - call: |- - let b = foo(); - arktest.assertTrue(b instanceof Char); - arktest.assertTrue(b.unboxed() == c'b'); - - decl: |- function foo() { // infer String return new String("some str"); @@ -143,15 +71,6 @@ cases: call: |- arktest.assertTrue(foo()); - - decl: |- - function foo() { // infer Boolean - return new Boolean(false); - } - call: |- - let b = foo(); - arktest.assertTrue(b instanceof Boolean); - arktest.assertTrue(b.unboxed() == false); - - decl: |- function foo() { // infer null return null; @@ -261,17 +180,6 @@ cases: let i = foo() arktest.assertTrue(i instanceof TPL); - - decl: |- - type A = Byte // infer custom type - function foo() { - let i: A = new Byte(2 as byte); - return i; - } - call: |- - let i = foo(); - arktest.assertTrue(i instanceof Byte); - arktest.assertTrue(i.unboxed() == 2 as byte); - - decl: |- const cstr = "some string" // infer string/char function foo(i: boolean) { diff --git a/static_core/plugins/ets/tests/ets-templates/07.expressions/01.evaluation_of_expressions/01.normal_and_abrupt_completion_of_expression_evaluation/cce2.ets b/static_core/plugins/ets/tests/ets-templates/07.expressions/01.evaluation_of_expressions/01.normal_and_abrupt_completion_of_expression_evaluation/cce2.ets index 2ff34825f6dace2bc39ad9a518ad09d68e07b5bd..aa166c820a60bcca8c4e432cab2f630e3f8bf165 100644 --- a/static_core/plugins/ets/tests/ets-templates/07.expressions/01.evaluation_of_expressions/01.normal_and_abrupt_completion_of_expression_evaluation/cce2.ets +++ b/static_core/plugins/ets/tests/ets-templates/07.expressions/01.evaluation_of_expressions/01.normal_and_abrupt_completion_of_expression_evaluation/cce2.ets @@ -24,7 +24,7 @@ function main(): int { let t: Long|null = (): Long|null => { return null; }(); try { - let v: long = (a = 2) + (t === null ? 0 : t.unboxed()) + (b = 2); + let v: long = (a = 2) + (t === null ? 0 : t.toLong()) + (b = 2); if (a != 2 || b != 2) return 1; return 0; } catch (e) { diff --git a/static_core/plugins/ets/tests/ets-templates/07.expressions/01.evaluation_of_expressions/eval_decl.ets b/static_core/plugins/ets/tests/ets-templates/07.expressions/01.evaluation_of_expressions/eval_decl.ets index 1fd220cb3c1bcd9f5411945e311136a5a8ed1ceb..7941a858dcf48287ec10d574381b3e1b54c623ec 100644 --- a/static_core/plugins/ets/tests/ets-templates/07.expressions/01.evaluation_of_expressions/eval_decl.ets +++ b/static_core/plugins/ets/tests/ets-templates/07.expressions/01.evaluation_of_expressions/eval_decl.ets @@ -22,7 +22,7 @@ desc: >- type Incrementor = (i: int) => int; let sg: int; -let ig: int = new Int(1).unboxed(); +let ig: int = new Int(1).toInt(); class A { public fld: int = 42 + (sg = "abc".length.toInt()); diff --git a/static_core/plugins/ets/tests/ets-templates/15.semantic_rules/14.compatibility_features/01.extended_conditional_expressions/cond_f1.params.yaml b/static_core/plugins/ets/tests/ets-templates/15.semantic_rules/14.compatibility_features/01.extended_conditional_expressions/cond_f1.params.yaml index d412baf03119d677fb31bba58607a2dc4bad8c1b..54cee47479185ae0c9601ee7e391fa524d2605b4 100644 --- a/static_core/plugins/ets/tests/ets-templates/15.semantic_rules/14.compatibility_features/01.extended_conditional_expressions/cond_f1.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/15.semantic_rules/14.compatibility_features/01.extended_conditional_expressions/cond_f1.params.yaml @@ -36,13 +36,13 @@ cases: - 'new Double(-0)' - '-0 as number' - - new Byte().unboxed() - - new Short().unboxed() - - new Int().unboxed() - - new Float().unboxed() - - new Double().unboxed() - - new Number().unboxed() - - new Char().unboxed() + - new Byte().toByte() + - new Short().toShort() + - new Int().toInt() + - new Float().toFloat() + - new Double().toDouble() + - new Number().toDouble() + - new Char().toChar() - '""' - '``' diff --git a/static_core/plugins/ets/tests/ets-templates/15.semantic_rules/14.compatibility_features/01.extended_conditional_expressions/if_f1.params.yaml b/static_core/plugins/ets/tests/ets-templates/15.semantic_rules/14.compatibility_features/01.extended_conditional_expressions/if_f1.params.yaml index b0c2b27034a0dc82621cf69595935b3f0d462798..a710ba2c0b5e3dc40aa727f644c071934deecca9 100644 --- a/static_core/plugins/ets/tests/ets-templates/15.semantic_rules/14.compatibility_features/01.extended_conditional_expressions/if_f1.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/15.semantic_rules/14.compatibility_features/01.extended_conditional_expressions/if_f1.params.yaml @@ -36,13 +36,13 @@ cases: - 'new Double(-0)' - '-0 as number' - - new Byte().unboxed() - - new Short().unboxed() - - new Int().unboxed() - - new Float().unboxed() - - new Double().unboxed() - - new Number().unboxed() - - new Char().unboxed() + - new Byte().toByte() + - new Short().toShort() + - new Int().toInt() + - new Float().toFloat() + - new Double().toDouble() + - new Number().toDouble() + - new Char().toChar() - '""' - '``' diff --git a/static_core/plugins/ets/tests/ets-templates/15.semantic_rules/14.compatibility_features/01.extended_conditional_expressions/if_t1.params.yaml b/static_core/plugins/ets/tests/ets-templates/15.semantic_rules/14.compatibility_features/01.extended_conditional_expressions/if_t1.params.yaml index 57e71f9a8054598f8dba068797961133da9d5f3a..45cfb5fa605ea5d6ee6c055312ed8d7d87f47aba 100644 --- a/static_core/plugins/ets/tests/ets-templates/15.semantic_rules/14.compatibility_features/01.extended_conditional_expressions/if_t1.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/15.semantic_rules/14.compatibility_features/01.extended_conditional_expressions/if_t1.params.yaml @@ -47,12 +47,12 @@ cases: - 'Float.MIN_VALUE' - 'Float.MAX_VALUE' - - new Byte(11).unboxed() - - new Short(1111).unboxed() - - new Int(111111).unboxed() - - new Float(11111111.0).unboxed() - - new Double(1111111111.0).unboxed() - - new Number(1e33 as number).unboxed() + - new Byte(11).toByte() + - new Short(1111).toShort() + - new Int(111111).toInt() + - new Float(11111111.0).toFloat() + - new Double(1111111111.0).toDouble() + - new Number(1e33 as number).toDouble() - '" "' - '` `' diff --git a/static_core/plugins/ets/tests/ets-templates/17.experimental_features/08.statements/01.for-of_type_annotation/for_of.params.yaml b/static_core/plugins/ets/tests/ets-templates/17.experimental_features/08.statements/01.for-of_type_annotation/for_of.params.yaml index 87e9a57eee1689df95f05b1e9cd5aeadd3583913..562bed3437d04f254210b0a98afc7a58e80a9f15 100644 --- a/static_core/plugins/ets/tests/ets-templates/17.experimental_features/08.statements/01.for-of_type_annotation/for_of.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/17.experimental_features/08.statements/01.for-of_type_annotation/for_of.params.yaml @@ -101,12 +101,12 @@ cases: - use: |- // array of primitives (int) with implicit boxing - for (const v: Int of [9, 8, 7, 6, 5]) res += v.unboxed() + for (const v: Int of [9, 8, 7, 6, 5]) res += v.toInt() if (res == "98765") return 0; - use: |- // array of primitives (boolean) with implicit boxing - for (const v: Boolean of [false, true, true, false]) res += v.unboxed() + for (const v: Boolean of [false, true, true, false]) res += v.toBoolean() if (res == "falsetruetruefalse") return 0; - decl: |- diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/01.predefined_types__02.boxed_types/bt.ets b/static_core/plugins/ets/tests/ets-templates_deprecated/01.predefined_types__02.boxed_types/bt.ets index 17bd89eff891c3e370a4f134b1a85ca2cef8f12c..ebdb46de73ee09cc45fce81b3e590f62dec798d8 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/01.predefined_types__02.boxed_types/bt.ets +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/01.predefined_types__02.boxed_types/bt.ets @@ -27,7 +27,7 @@ function main() { {%- for t in c['values'] %} let prim{{loop.index}}: {{c.from_type}} = {{t.expr|safe}} boxed = new {{c.to_type}}(prim{{loop.index}}) - arktest.assertEQ( boxed.unboxed(), {{t.val}} ) + arktest.assertEQ( boxed, {{t.val}} ) {%- endfor %} } {%- endfor %} diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/01.predefined_types__02.boxed_types/bt_default.ets b/static_core/plugins/ets/tests/ets-templates_deprecated/01.predefined_types__02.boxed_types/bt_default.ets index 0b8cec5b06a792cf703951692f1ce87f78e1ab9a..9242fa1d4ffdc42ff49b6fe6fb48ed001eae852c 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/01.predefined_types__02.boxed_types/bt_default.ets +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/01.predefined_types__02.boxed_types/bt_default.ets @@ -31,15 +31,15 @@ let c = new Char() let bool = new Boolean() function main() { - arktest.assertEQ( b.unboxed(), 0 ) - arktest.assertEQ( s.unboxed(), 0 ) - arktest.assertEQ( i.unboxed(), 0 ) - arktest.assertEQ( l.unboxed(), 0 ) - arktest.assertEQ( f.unboxed(), 0.0f ) - arktest.assertEQ( d.unboxed(), 0.0 ) - arktest.assertEQ( n.unboxed(), 0.0 ) - arktest.assertEQ( c.unboxed(), c'\u0000' ) - arktest.assertEQ( bool.unboxed(), false ) + arktest.assertEQ( b, 0 ) + arktest.assertEQ( s, 0 ) + arktest.assertEQ( i, 0 ) + arktest.assertEQ( l, 0 ) + arktest.assertEQ( f, 0.0f ) + arktest.assertEQ( d, 0.0 ) + arktest.assertEQ( n, 0.0 ) + arktest.assertEQ( c, c'\u0000' ) + arktest.assertEQ( bool, false ) arktest.assertEQ( b, 0 ) arktest.assertEQ( s, 0 ) diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/01.predefined_types__02.boxed_types/bt_nan.ets b/static_core/plugins/ets/tests/ets-templates_deprecated/01.predefined_types__02.boxed_types/bt_nan.ets index 87fef113873503cbe80f5e4881dec534361f5d30..766ffc95c0fb71dd3187ef065a4ddbdd91fb057c 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/01.predefined_types__02.boxed_types/bt_nan.ets +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/01.predefined_types__02.boxed_types/bt_nan.ets @@ -28,7 +28,7 @@ function main() { let prim{{loop.index}}: {{c.from_type}} = {{t.expr|safe}} boxed = new {{c.to_type}}(prim{{loop.index}}) arktest.assertTrue( boxed.isNaN() ) - arktest.assertTrue( {{c.to_type}}.isNaN(boxed.unboxed()) ) + arktest.assertTrue( {{c.to_type}}.isNaN(boxed) ) {%- endfor %} } {%- endfor %} diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/assn_var/assn-var.ets b/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/assn_var/assn-var.ets index 02293176ffb3d8a0981bea404c03a230051e269b..f2e3cd65dcf85530190c450cda5b729ec52470c3 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/assn_var/assn-var.ets +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/assn_var/assn-var.ets @@ -26,7 +26,7 @@ function main(): int { {%- for t in c['values'] %} let s{{loop.index}}: {{c.from_type}} = {{t.expr|safe}} d{{loop.index}} = s{{loop.index}} - if (d{{loop.index}}.unboxed() != {{t.val}}) { + if (d{{loop.index}} != {{t.val}}) { return 1 } {%- endfor %} diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/call_cons/call-cons-nan.ets b/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/call_cons/call-cons-nan.ets index 7c774728c305ad06bde6e0e4f66d62f34c168400..8775af8bc217aa0cd10cfd338ecd894d44f7c84d 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/call_cons/call-cons-nan.ets +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/call_cons/call-cons-nan.ets @@ -27,7 +27,7 @@ class A { function main(): int { {%- for t in c['values'] %} let s{{loop.index}}: {{c.from_type}} = {{t.expr|safe}} - if (! {{c.to_type}}.isNaN(new A(s{{loop.index}}).f.unboxed())) { + if (! {{c.to_type}}.isNaN(new A(s{{loop.index}}).f)) { return 1 } {%- endfor %} diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/call_cons/call-cons.ets b/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/call_cons/call-cons.ets index 2f7fc8ce75d9b8ffe512fd67931839d4f2008c95..cf3de2e1f5cedb77fdc6ff771fb3568b632fd35b 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/call_cons/call-cons.ets +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/call_cons/call-cons.ets @@ -27,7 +27,7 @@ class A { function main(): int { {%- for t in c['values'] %} let s{{loop.index}}: {{c.from_type}} = {{t.expr|safe}} - if (new A(s{{loop.index}}).f.unboxed() != {{t.val}}) { + if (new A(s{{loop.index}}).f != {{t.val}}) { return 1 } {%- endfor %} diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/call_func/call-func-nan.ets b/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/call_func/call-func-nan.ets index 6d135605310bdf419c6b1a95585371ff213c4739..f8c17ed8503b8e17fac3d68f02f06bb404d48cf7 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/call_func/call-func-nan.ets +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/call_func/call-func-nan.ets @@ -24,7 +24,7 @@ function foo(p: {{c.to_type}}): {{c.to_type}} { return p } function main(): int { {%- for t in c['values'] %} let s{{loop.index}}: {{c.from_type}} = {{t.expr|safe}} - if (! {{c.to_type}}.isNaN(foo(s{{loop.index}}).unboxed())) { + if (! {{c.to_type}}.isNaN(foo(s{{loop.index}}))) { return 1 } {%- endfor %} diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/call_func/call-func.ets b/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/call_func/call-func.ets index c3cc3e149db69a9f8278b733a745e7a4f985e169..e192b82704a582a3e3e35093a874a534b5aef943 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/call_func/call-func.ets +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/call_func/call-func.ets @@ -24,7 +24,7 @@ function foo(p: {{c.to_type}}): {{c.to_type}} { return p } function main(): int { {%- for t in c['values'] %} let s{{loop.index}}: {{c.from_type}} = {{t.expr|safe}} - if (foo(s{{loop.index}}).unboxed() != {{t.val}}) { + if (foo(s{{loop.index}}) != {{t.val}}) { return 1 } {%- endfor %} diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/call_lmbd/call-lmbd-nan.ets b/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/call_lmbd/call-lmbd-nan.ets index f67a03c0c7fe0969c21d5ad08911430c86e37419..5bf1ca3f5c54f62d7f812aeb1c640c64062d82f0 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/call_lmbd/call-lmbd-nan.ets +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/call_lmbd/call-lmbd-nan.ets @@ -22,7 +22,7 @@ params: NaN conversion from {{c.from_type}} to {{c.to_type}} function main(): int { {%- for t in c['values'] %} let s{{loop.index}}: {{c.from_type}} = {{t.expr|safe}} - if (! {{c.to_type}}.isNaN(((p: {{c.to_type}}): {{c.to_type}} => { return p })(s{{loop.index}}).unboxed())) { + if (! {{c.to_type}}.isNaN(((p: {{c.to_type}}): {{c.to_type}} => { return p })(s{{loop.index}}))) { return 1 } {%- endfor %} diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/call_lmbd/call-lmbd.ets b/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/call_lmbd/call-lmbd.ets index 804c8e0affc9be2f422a3164bb3ac18e115bd55a..6ea6f761e0a137b0bb8436980b43a675e3c5f9e6 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/call_lmbd/call-lmbd.ets +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/call_lmbd/call-lmbd.ets @@ -22,7 +22,7 @@ params: from {{c.from_type}} to {{c.to_type}} function main(): int { {%- for t in c['values'] %} let s{{loop.index}}: {{c.from_type}} = {{t.expr|safe}} - if (((p: {{c.to_type}}): {{c.to_type}} => { return p })(s{{loop.index}}).unboxed() != {{t.val}}) { + if (((p: {{c.to_type}}): {{c.to_type}} => { return p })(s{{loop.index}}) != {{t.val}}) { return 1 } {%- endfor %} diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/call_meth/call-meth-nan.ets b/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/call_meth/call-meth-nan.ets index 0236c2750ac8226d38acaa3d8f9dd9f033690b1e..9d775dbb43e274db11d04e2242f8abe9ffcb3fe6 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/call_meth/call-meth-nan.ets +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/call_meth/call-meth-nan.ets @@ -27,7 +27,7 @@ function main(): int { let a: A = new A() {%- for t in c['values'] %} let s{{loop.index}}: {{c.from_type}} = {{t.expr|safe}} - if (! {{c.to_type}}.isNaN(a.meth(s{{loop.index}}).unboxed())) { + if (! {{c.to_type}}.isNaN(a.meth(s{{loop.index}}))) { return 1 } {%- endfor %} diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/call_meth/call-meth.ets b/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/call_meth/call-meth.ets index be95b54ba7d0b9753bd72c940936a3248c45cc8d..0b8e1b769f3467579981258e2833b3beae49ae22 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/call_meth/call-meth.ets +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/call_meth/call-meth.ets @@ -27,7 +27,7 @@ function main(): int { let a: A = new A() {%- for t in c['values'] %} let s{{loop.index}}: {{c.from_type}} = {{t.expr|safe}} - if (a.meth(s{{loop.index}}).unboxed() != {{t.val}}) { + if (a.meth(s{{loop.index}}) != {{t.val}}) { return 1 } {%- endfor %} diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/comp_arr/comp-arr-nan.ets b/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/comp_arr/comp-arr-nan.ets index 9739e7a334cae776b3752f5228ec113a199e74ca..c3fa16327951e5dcccc89de2ebc8d56be70e04f6 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/comp_arr/comp-arr-nan.ets +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/comp_arr/comp-arr-nan.ets @@ -27,7 +27,7 @@ function main(): int { let d{{loop.index}}: {{c.to_type}}[] = [s{{loop.index}}, s{{loop.index}}] d{{loop.index}} = [] d{{loop.index}} = [s{{loop.index}}] - if (! {{c.to_type}}.isNaN(d{{loop.index}}[0].unboxed())) { + if (! {{c.to_type}}.isNaN(d{{loop.index}}[0])) { return 1 } {%- endfor %} diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/comp_arr/comp-arr.ets b/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/comp_arr/comp-arr.ets index deb2d8d1951a516dab2567982846eb755497bf43..a4ff54f3deeff76246ed4cae60a10c8ab090f556 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/comp_arr/comp-arr.ets +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/comp_arr/comp-arr.ets @@ -27,7 +27,7 @@ function main(): int { let d{{loop.index}}: {{c.to_type}}[] = [s{{loop.index}}, s{{loop.index}}] d{{loop.index}} = [] d{{loop.index}} = [s{{loop.index}}] - if (d{{loop.index}}[0].unboxed() != {{t.val}}) { + if (d{{loop.index}}[0] != {{t.val}}) { return 1 } {%- endfor %} diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/comp_obj/comp-clss-nan.ets b/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/comp_obj/comp-clss-nan.ets index b789859c0c01b996974ff3d2c199a08eb8c6def1..b9687fb414753c22bcf4002fc2b02ab22ed774e3 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/comp_obj/comp-clss-nan.ets +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/comp_obj/comp-clss-nan.ets @@ -26,7 +26,7 @@ let s{{loop.index}}: {{c.from_type}} = {{t.expr|safe}}; function main(): int { {%- for t in c['values'] %} let d{{loop.index}}: A{{loop.index}} = { fld: s{{loop.index}} } - if (! {{c.to_type}}.isNaN(d{{loop.index}}.fld.unboxed())) { + if (! {{c.to_type}}.isNaN(d{{loop.index}}.fld)) { return 1 } {%- endfor %} diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/comp_obj/comp-clss.ets b/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/comp_obj/comp-clss.ets index 0d89d12e5a7ae83248f5873806160638608b5e99..65c4e08a8fa2b6a4ad9d6674ad3759ebf64bd952 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/comp_obj/comp-clss.ets +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/comp_obj/comp-clss.ets @@ -26,7 +26,7 @@ let s{{loop.index}}: {{c.from_type}} = {{t.expr|safe}}; function main(): int { {%- for t in c['values'] %} let d{{loop.index}}: A{{loop.index}} = { fld: s{{loop.index}} } - if (d{{loop.index}}.fld.unboxed() != {{t.val}}) { + if (d{{loop.index}}.fld != {{t.val}}) { return 1 } {%- endfor %} diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/comp_obj/comp-intf-nan.ets b/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/comp_obj/comp-intf-nan.ets index 4c2d8405e17472d9744fe703361d17a7c0cd9bb1..b40507a467dff7080caecb4775ff0d1de3f57c03 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/comp_obj/comp-intf-nan.ets +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/comp_obj/comp-intf-nan.ets @@ -26,7 +26,7 @@ let s{{loop.index}}: {{c.from_type}} = {{t.expr|safe}}; function main(): int { {%- for t in c['values'] %} let d{{loop.index}}: J{{loop.index}} = { fld: s{{loop.index}} } - if (! {{c.to_type}}.isNaN(d{{loop.index}}.fld.unboxed())) { + if (! {{c.to_type}}.isNaN(d{{loop.index}}.fld)) { return 1 } {%- endfor %} diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/comp_obj/comp-intf.ets b/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/comp_obj/comp-intf.ets index 3bd64f4cd962c62b7c94acfb3180cb8b9ea0a317..2e271b8e70c4c42c2deb61c43ec0446a4601f975 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/comp_obj/comp-intf.ets +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/comp_obj/comp-intf.ets @@ -26,7 +26,7 @@ let s{{loop.index}}: {{c.from_type}} = {{t.expr|safe}}; function main(): int { {%- for t in c['values'] %} let d{{loop.index}}: J{{loop.index}} = { fld: s{{loop.index}} } - if (d{{loop.index}}.fld.unboxed() != {{t.val}}) { + if (d{{loop.index}}.fld != {{t.val}}) { return 1 } {%- endfor %} diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/decl_const/decl-const-nan.ets b/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/decl_const/decl-const-nan.ets index 1020699164dacd9379c898b50a0242506ea24bb3..98968a9d417c61cec1ace097ec8f50c4ae1f9843 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/decl_const/decl-const-nan.ets +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/decl_const/decl-const-nan.ets @@ -23,7 +23,7 @@ function main(): int { {%- for t in c['values'] %} let s{{loop.index}}: {{c.from_type}} = {{t.expr|safe}} const d{{loop.index}}: {{c.to_type}} = s{{loop.index}} - if (! {{c.to_type}}.isNaN(d{{loop.index}}.unboxed())) { + if (! {{c.to_type}}.isNaN(d{{loop.index}})) { return 1 } {%- endfor %} diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/decl_const/decl-const.ets b/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/decl_const/decl-const.ets index cae66a4f655c3838817e7c8b4ba9c3cddcb8b9df..3373c05cae98ecde059a50f0e9b091726baf7e67 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/decl_const/decl-const.ets +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/decl_const/decl-const.ets @@ -23,7 +23,7 @@ function main(): int { {%- for t in c['values'] %} let s{{loop.index}}: {{c.from_type}} = {{t.expr|safe}} const d{{loop.index}}: {{c.to_type}} = s{{loop.index}} - if (d{{loop.index}}.unboxed() != {{t.val}}) { + if (d{{loop.index}} != {{t.val}}) { return 1 } {%- endfor %} diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/decl_field/decl-field-nan.ets b/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/decl_field/decl-field-nan.ets index cb2ac512b6a0447110b38e1a445f336ec0a185d3..e615efeace4a1b3e121b167663ed5e2d925f44f3 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/decl_field/decl-field-nan.ets +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/decl_field/decl-field-nan.ets @@ -29,7 +29,7 @@ class A{{loop.index}} { function main(): int { {%- for t in c['values'] %} let a{{loop.index}}: A{{loop.index}} = new A{{loop.index}}() - if (! {{c.to_type}}.isNaN(a{{loop.index}}.d.unboxed())) { + if (! {{c.to_type}}.isNaN(a{{loop.index}}.d)) { return 1 } {%- endfor %} diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/decl_field/decl-field.ets b/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/decl_field/decl-field.ets index e09cec8e7ca7a607da4c58da3bbcf91e61fa8d6d..47c3c04fa5076f9ff78e2e3e8f80aa3085304d32 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/decl_field/decl-field.ets +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/decl_field/decl-field.ets @@ -29,7 +29,7 @@ class A{{loop.index}} { function main(): int { {%- for t in c['values'] %} let a{{loop.index}}: A{{loop.index}} = new A{{loop.index}}() - if (a{{loop.index}}.d.unboxed() != {{t.val}}) { + if (a{{loop.index}}.d != {{t.val}}) { return 1 } {%- endfor %} diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/decl_var/decl-var.ets b/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/decl_var/decl-var.ets index 5b21318981e2e55b0190f1880c260bfd02526664..589ec8a1062fb54045acf628513cd96ef7192334 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/decl_var/decl-var.ets +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/04.boxing_conversion/decl_var/decl-var.ets @@ -23,7 +23,7 @@ function main(): int { {%- for t in c['values'] %} let s{{loop.index}}: {{c.from_type}} = {{t.expr|safe}} let d{{loop.index}}: {{c.to_type}} = s{{loop.index}} - if (d{{loop.index}}.unboxed() != {{t.val}}) { + if (d{{loop.index}} != {{t.val}}) { return 1 } {%- endfor %} diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/02.assignment-like_contexts/prim_boxing.ets b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/02.assignment-like_contexts/prim_boxing.ets index 29e145b3c02e2a505d87e3384ced18bcdae9d7a5..30c76b7e764d988f4fd8cc2cc947ff60e096d60e 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/02.assignment-like_contexts/prim_boxing.ets +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/02.assignment-like_contexts/prim_boxing.ets @@ -24,7 +24,7 @@ let dest: {{conv.dest}}; function main(): void { dest = origin; - arktest.assertTrue(dest.unboxed() == origin); + arktest.assertTrue(dest == origin); } {% endfor %} diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/02.assignment-like_contexts/prim_unboxing.ets b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/02.assignment-like_contexts/prim_unboxing.ets index bf5c506b462e958301f7704bb8955477ab4f9f25..88ddeffdef52249ce883b6dc745e1d22a2dbf732 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/02.assignment-like_contexts/prim_unboxing.ets +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/02.assignment-like_contexts/prim_unboxing.ets @@ -26,7 +26,7 @@ let dest: {{conv.dest}}; function main(): void { dest = origin; - artktest.assertEQ(dest, origin.unboxed()); + artktest.assertEQ(dest, origin); } {% endfor %} diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/04.casting_contexts_and_conversions/identity.params.yaml b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/04.casting_contexts_and_conversions/identity.params.yaml index e223599d7d785035bea04fb5a2036bec79aac455..62343a142fb73aff123c3cd801a90e7aaf82302d 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/04.casting_contexts_and_conversions/identity.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/04.casting_contexts_and_conversions/identity.params.yaml @@ -26,9 +26,5 @@ cases: - { type: Byte, expr: new Byte(new Int(1).byteValue()), op: '!==' } - { type: Char, expr: new Char(c'A'), op: '!==' } - { type: 'char[]', expr: "[c'A', c'B']", op: '!==' } - - { type: '(x: Char) => char', expr: '(p: Char): char => { return p.unboxed(); }', op: '!==' } - - { type: '((x: Char) => char)[]', expr: '[(p: Char): char => { return p.unboxed(); }]', op: '!==' } - - { type: Foo, expr: '(p: Char): char => { return p.unboxed(); }', op: '!==' } - - { type: 'Foo[]', expr: '[(p: Char): char => { return p.unboxed(); }]', op: '!==' } - { type: 'Color', expr: Color.Red, op: '!==' } - { type: 'Color[]', expr: '[Color.Blue]', op: '!==' } diff --git a/static_core/plugins/ets/tests/ets_func_tests/escompat/JsonTest.ets b/static_core/plugins/ets/tests/ets_func_tests/escompat/JsonTest.ets index eb1962869d11aad1fa7fe56c956dd4d15bd5c199..16506fddd0739a8b7ab39e9002fb88e911ffa770 100644 --- a/static_core/plugins/ets/tests/ets_func_tests/escompat/JsonTest.ets +++ b/static_core/plugins/ets/tests/ets_func_tests/escompat/JsonTest.ets @@ -32,17 +32,17 @@ function testNull(): int { function testBoolean(): int { let booleanType = Type.of(new Boolean() as Object) - return test((JSON.parse("true", booleanType) as Boolean).unboxed() == true, "Boolean(true)") + - test((JSON.parse("false", booleanType) as Boolean).unboxed() == false, "Boolean(false)") + return test((JSON.parse("true", booleanType) as Boolean).toBoolean() == true, "Boolean(true)") + + test((JSON.parse("false", booleanType) as Boolean).toBoolean() == false, "Boolean(false)") } function testDouble(): int { let doubleType = Type.of(new Double() as Object) - return test((JSON.parse("0", doubleType) as Double).unboxed() == 0, "Double(0)") + - test((JSON.parse("1", doubleType) as Double).unboxed() == 1, "Double(1)") + - test((JSON.parse("-1", doubleType) as Double).unboxed() == -1, "Double(-1)") + - test((JSON.parse("2.72182", doubleType) as Double).unboxed() == 2.72182, "Double(2.72182)") + - test((JSON.parse("-2.72182", doubleType) as Double).unboxed() == -2.72182, "Double(-2.72182)") + return test((JSON.parse("0", doubleType) as Double).toDouble() == 0, "Double(0)") + + test((JSON.parse("1", doubleType) as Double).toDouble() == 1, "Double(1)") + + test((JSON.parse("-1", doubleType) as Double).toDouble() == -1, "Double(-1)") + + test((JSON.parse("2.72182", doubleType) as Double).toDouble() == 2.72182, "Double(2.72182)") + + test((JSON.parse("-2.72182", doubleType) as Double).toDouble() == -2.72182, "Double(-2.72182)") } function testStringWithEscape01(): int { diff --git a/static_core/plugins/ets/tests/ets_func_tests/escompat/RegExpReplaceFunctionTest.ets b/static_core/plugins/ets/tests/ets_func_tests/escompat/RegExpReplaceFunctionTest.ets index 0d489a861cb5b31c652a00d7aa653f7f8bdd4ca8..62093b3fae03a23a7f34b90b80b49398473978e4 100644 --- a/static_core/plugins/ets/tests/ets_func_tests/escompat/RegExpReplaceFunctionTest.ets +++ b/static_core/plugins/ets/tests/ets_func_tests/escompat/RegExpReplaceFunctionTest.ets @@ -26,7 +26,7 @@ function test1(shor: String): int { return ans; } failure += checkTestResult(shor.replace("x", lambda), "0axbxcx") - failure += checkTestResult(ctr.unboxed(), 1) + failure += checkTestResult(ctr.toInt(), 1) return failure } @@ -43,7 +43,7 @@ function test2(shor: String): int { return ans; } failure += checkTestResult(shor.replace(new RegExp("x"), lambda), "0axbxcx") - failure += checkTestResult(ctr.unboxed(), 1) + failure += checkTestResult(ctr.toInt(), 1) return failure } @@ -54,14 +54,14 @@ function test3(shor: String): int { let lambda : (str: String, args: Object[]) => String = (str: String, args: Object[]) : String => { failure += checkTestResult(str, "x") - failure += checkTestResult(args[0] as Double, new Double((ctr.unboxed() * 2).toDouble())) + failure += checkTestResult(args[0] as Double, new Double((ctr.toInt() * 2).toDouble())) failure += checkTestResult(args[1].toString(), shor) let ans = ctr.toString(); ctr++; return ans; } failure += checkTestResult(shor.replace(new RegExp("x", "g"), lambda), "0a1b2c3") - failure += checkTestResult(ctr.unboxed(), 4) + failure += checkTestResult(ctr.toInt(), 4) return failure } @@ -73,15 +73,15 @@ function test4(shor: String): int { let lambda : (str: String, args: Object[]) => String = (str: String, args: Object[]) : String => { failure += checkTestResult(str, "x") failure += checkTestResult(args[0].toString(), "x") - failure += checkTestResult(args[1].toString(), test[ctr.unboxed()]) - failure += checkTestResult(args[2] as Double, new Double((ctr.unboxed() * 2).toDouble())) + failure += checkTestResult(args[1].toString(), test[ctr.toInt()]) + failure += checkTestResult(args[2] as Double, new Double((ctr.toInt() * 2).toDouble())) failure += checkTestResult(args[3].toString(), shor) let ans = ctr.toString(); ctr++; return ans; } failure += checkTestResult(shor.replace(new RegExp("(x)(?=(.))", "g"), lambda), "0a1b2cx") - failure += checkTestResult(ctr.unboxed(), 3) + failure += checkTestResult(ctr.toInt(), 3) return failure } diff --git a/static_core/plugins/ets/tests/ets_func_tests/std/core/DoubleTest.ets b/static_core/plugins/ets/tests/ets_func_tests/std/core/DoubleTest.ets index b464dd97bb96022a01c531f2431fbae4f99fe076..aeaf29359bd267f260f761fd61acd14b47040244 100644 --- a/static_core/plugins/ets/tests/ets_func_tests/std/core/DoubleTest.ets +++ b/static_core/plugins/ets/tests/ets_func_tests/std/core/DoubleTest.ets @@ -134,7 +134,7 @@ function main() { if (force_log) { console.log("[" + test + "]"); } - let ctor_answer = (new Number(test)).unboxed(); // change to .valueOf to run script in TS + let ctor_answer = (new Number(test)).toDouble(); // change to .valueOf to run script in TS let parse_answer = Number.parseFloat(test); fails += check(ctor_answer, correct_cts[test_id], "Number(" + test + ")"); fails += check(parse_answer, correct_pfs[test_id], "parseFloat(" + test + ")"); diff --git a/static_core/plugins/ets/tests/ets_func_tests/std/core/TypeFieldTest.ets b/static_core/plugins/ets/tests/ets_func_tests/std/core/TypeFieldTest.ets index ff261a8a6634c6fb32e1045c0193d31e6a583848..24e6943aa3e90a15a1a4affd28861fc4399c4c08 100644 --- a/static_core/plugins/ets/tests/ets_func_tests/std/core/TypeFieldTest.ets +++ b/static_core/plugins/ets/tests/ets_func_tests/std/core/TypeFieldTest.ets @@ -108,7 +108,7 @@ function testField(): int { test(zf.getType() == DoubleType.VAL, " Type: double") + test(zf.getAttributes() == Attributes.STATIC, " static attribute") + test(zf.getAccessModifier() == AccessModifier.PUBLIC, " public access modififer") + - test((zf.getStaticValue() as Double).unboxed() == Point3D.ZERO, " static value") + + test((zf.getStaticValue() as Double).toDouble() == Point3D.ZERO, " static value") + test(!zf.isReadonly(), " not readonly") + test(!isInherited(zf, pt), " not inherited") + test(!isOverrided(zf, pt), " not override") + diff --git a/static_core/plugins/ets/tests/interop_js/tests/primitive/ts_to_ets/primitive.ets b/static_core/plugins/ets/tests/interop_js/tests/primitive/ts_to_ets/primitive.ets index f25d0493c2fa6527faad679599c7607929ef4474..722872fbbcd6022448fb82cd1aef2a88630b7e9d 100644 --- a/static_core/plugins/ets/tests/interop_js/tests/primitive/ts_to_ets/primitive.ets +++ b/static_core/plugins/ets/tests/interop_js/tests/primitive/ts_to_ets/primitive.ets @@ -98,7 +98,7 @@ function checkChar(val: char) { } function checkCharBoxed(val: Char) { - arktest.assertTrue(val.unboxed() == c'1') + arktest.assertTrue(val.toChar() == c'1') } function checkString(val: string) { diff --git a/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_boolean_instance.yaml b/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_boolean_instance.yaml index 168f92584fd97e74a9540e1beeccf7786c71f8e7..6fab5d5de768c962f9aba8886c6df2ed080c2ee9 100644 --- a/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_boolean_instance.yaml +++ b/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_boolean_instance.yaml @@ -11,21 +11,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -- { - method_name: unboxed, - object_type: Boolean, - init_object_data_type: "FixedArray", - init_object_data: "[true, false]", - param_init_data_types: {} , - param_types: {}, - param_nature: {}, - method_return_type: boolean, - expected_data_item_type: boolean, - expected_data_type: "FixedArray", - param_list: {}, - expected_test_data: "[true, false]", - verify_test_result_function: comparePrimitiveValue, - } - { method_name: valueOf, object_type: Boolean, diff --git a/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_byte_instance.yaml b/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_byte_instance.yaml index 3b256a8943b07c0ef66a6e3888a23b5d869f2106..36a11314b6b392d5b03fafd9dc61d193ad192d5f 100644 --- a/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_byte_instance.yaml +++ b/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_byte_instance.yaml @@ -11,20 +11,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -- { - method_name: unboxed, - object_type: Byte, - init_object_data_type: "FixedArray", - init_object_data: "[0 as byte, 1 as byte, Byte.MIN_VALUE.toByte(), Byte.MAX_VALUE.toByte()]", - param_init_data_types: {} , - param_types: {}, - method_return_type: byte, - expected_data_item_type: byte, - expected_data_type: "FixedArray", - param_list: {}, - expected_test_data: "[0 as byte, 1 as byte, Byte.MIN_VALUE.toByte(), Byte.MAX_VALUE.toByte()]", - verify_test_result_function: comparePrimitiveValue, - } - { method_name: toByte, object_type: Byte, diff --git a/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_char_instance.yaml b/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_char_instance.yaml index 6f3a68b7e76906e96f2cdbc9d5e81874308ecf81..0fea137613869d3bf4655a637c7ce7b4293f7335 100644 --- a/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_char_instance.yaml +++ b/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_char_instance.yaml @@ -11,21 +11,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -- { - method_name: unboxed, - object_type: Char, - init_object_data_type: "FixedArray", - init_object_type: char, - init_object_type_nature: primitive, - param_init_data_types: {} , - param_types: {}, - param_list: {}, - method_return_type: char, - init_object_data: "[c'x', c'X']", - expected_data_type: "FixedArray", - expected_test_data: "[c'x', c'X']", - verify_test_result_function: comparePrimitiveValue - } - { method_name: toString, object_type: Char, @@ -238,7 +223,7 @@ result_nature: primitive, result_storage: this, result_type: char, - result_retrieve_function: "unboxed()", + result_retrieve_function: "toChar()", expected_data_item_type: char, expected_data_type: "FixedArray", param_list: {}, @@ -258,7 +243,7 @@ result_nature: primitive, result_type: char, result_storage: this, - result_retrieve_function: "unboxed()", + result_retrieve_function: "toChar()", expected_data_item_type: char, expected_data_type: "FixedArray", param_list: {}, diff --git a/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_double_instance.yaml b/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_double_instance.yaml index 948260a9bc5b131ee91ea16c20ad65749555e581..9470583a67226e436833cfe013e18d10501d00ef 100644 --- a/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_double_instance.yaml +++ b/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_double_instance.yaml @@ -11,21 +11,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -- { - method_name: unboxed, - object_type: Double, - init_object_data_type: "FixedArray", - init_object_type: double, - init_object_type_nature: primitive, - param_init_data_types: {}, - param_types: {}, - param_list: {}, - method_return_type: double, - init_object_data: "[0 as double, 1 as double, Byte.MIN_VALUE.toDouble(), Byte.MAX_VALUE.toDouble()]", - expected_data_type: "FixedArray", - expected_test_data: "[0 as double, 1 as double, Byte.MIN_VALUE.toDouble(), Byte.MAX_VALUE.toDouble()]", - verify_test_result_function: compareFloatPointValue - } - { method_name: toByte, object_type: Double, diff --git a/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_float_instance.yaml b/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_float_instance.yaml index 73209dc6fed442a1083478e8fabdc5af45d34321..b052451fb2ff69f396d8aaeeeeac6e811ae41eef 100644 --- a/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_float_instance.yaml +++ b/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_float_instance.yaml @@ -11,20 +11,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -- { - method_name: unboxed, - object_type: Float, - init_object_data_type: "FixedArray", - init_object_type: float, - param_init_data_types: {}, - param_types: {}, - param_list: {}, - method_return_type: float, - init_object_data: "[0.0f, 1.0f, Float.MIN_VALUE, Float.MAX_VALUE]", - expected_data_type: "FixedArray", - expected_test_data: "[0.0f, 1.0f, Float.MIN_VALUE, Float.MAX_VALUE]", - verify_test_result_function: compareFloatPointValue - } - { method_name: toByte, object_type: Float, diff --git a/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_int_instance.yaml b/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_int_instance.yaml index fd961790b941e276652d92feaf9dd5e22712b63c..8149b1678bcb08ba29286d61ba617e861060eecd 100644 --- a/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_int_instance.yaml +++ b/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_int_instance.yaml @@ -11,20 +11,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -- { - method_name: unboxed, - object_type: Int, - init_object_data_type: "FixedArray", - init_object_data: "[0 as int, 1 as int, Int.MIN_VALUE.toInt(), Int.MAX_VALUE.toInt()]", - param_init_data_types: {} , - param_types: {}, - method_return_type: int, - expected_data_item_type: int, - expected_data_type: "FixedArray", - param_list: {}, - expected_test_data: "[0 as int, 1 as int, Int.MIN_VALUE.toInt(), Int.MAX_VALUE.toInt()]", - verify_test_result_function: comparePrimitiveValue, - } - { method_name: toByte, object_type: Int, diff --git a/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_long_instance.yaml b/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_long_instance.yaml index 35bfbfe59130dc0ceb6db2b5926cdbea86299f07..ef4e43196838fa0eefe07cbf3dd7249cf2919675 100644 --- a/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_long_instance.yaml +++ b/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_long_instance.yaml @@ -11,22 +11,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -- { - method_name: unboxed, - object_type: Long, - init_object_data_type: "FixedArray", - init_object_type: long, - init_object_type_nature: primitive, - param_init_data_types: {} , - param_types: {}, - param_list: {}, - method_return_type: long, - init_object_data: "[0 as long, 1 as int, -1 as int, Long.MIN_VALUE.toLong(), Long.MAX_VALUE.toLong()]", - expected_data_type: "FixedArray", - expected_test_data: "[0 as long, 1 as long, -1 as long, Long.MIN_VALUE.toLong(), Long.MAX_VALUE.toLong()]", - verify_test_result_function: comparePrimitiveValue - } - - { method_name: toByte, diff --git a/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_short_instance.yaml b/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_short_instance.yaml index 9af800eef1404864f9e260cc08321c8ec2b84f10..5143199030f5124a201ddc9716bbbb1c659aaa84 100644 --- a/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_short_instance.yaml +++ b/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_short_instance.yaml @@ -11,20 +11,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -- { - method_name: unboxed, - object_type: Short, - init_object_data_type: "FixedArray", - init_object_data: "[0 as short, 1 as short, Short.MIN_VALUE.toShort(), Short.MAX_VALUE.toShort()]", - param_init_data_types: {} , - param_types: {}, - method_return_type: short, - expected_data_item_type: short, - expected_data_type: "FixedArray", - param_list: {}, - expected_test_data: "[0 as short, 1 as short, Short.MIN_VALUE.toShort(), Short.MAX_VALUE.toShort()]", - verify_test_result_function: comparePrimitiveValue, - } - { method_name: toByte, object_type: Short, diff --git a/static_core/plugins/ets/tests/stdlib-templates/utils/test_constructor.j2 b/static_core/plugins/ets/tests/stdlib-templates/utils/test_constructor.j2 index 4249a351e11c6ab71534114078d5b0bfe03f82cd..f11b78a3f2dc1823e7749a5c144e958d17f0fe5e 100644 --- a/static_core/plugins/ets/tests/stdlib-templates/utils/test_constructor.j2 +++ b/static_core/plugins/ets/tests/stdlib-templates/utils/test_constructor.j2 @@ -89,7 +89,7 @@ function testConstructor(initDataIdx : int) : boolean { let object4Copy : {{.item.object_type}} = new {{.item.object_type}}({{.item.init_object_param_list.keys()|list|join(', ')}}); let actualClone : {{.item.object_type}} = new {{.item.object_type}}(object4Copy); // console.print("actualClone:"); - // console.print(actualClone.unboxed()); + // console.print(actualClone); // console.print(";"); if ({{.item.verify_test_result_function}}(actualClone, TEST_DATA_EXPECTED[initDataIdx])) { resultCopy = true diff --git a/static_core/plugins/ets/tests/stdlib-templates/utils/test_verifier_lib.j2 b/static_core/plugins/ets/tests/stdlib-templates/utils/test_verifier_lib.j2 index d645d8003c50d4d2d570248c7b0eb1d560522868..5872ff000f07f19b9b02828d19f7357998bd03ac 100644 --- a/static_core/plugins/ets/tests/stdlib-templates/utils/test_verifier_lib.j2 +++ b/static_core/plugins/ets/tests/stdlib-templates/utils/test_verifier_lib.j2 @@ -61,7 +61,7 @@ function compareFloatPointValue(left : double, right : double) : boolean { {%- if item.method_return_type == "Char" or item.method_return_type == "Boolean" or item.method_return_type == "Byte" or item.method_return_type == "Short" or item.method_return_type == "Int" or item.method_return_type == "Long" or item.method_return_type == "Float" or item.method_return_type == "Double" %} function compareWrapperObjectValue(actual : {{.item.method_return_type}}, expected : {{.item.expected_data_item_type}}) : boolean { let actual2 : {{.item.expected_data_item_type}}; - actual2 = actual.unboxed(); + actual2 = actual; {%- if item.method_return_type == "Float" or item.method_return_type == "Double" %} return compareFloatPointValue(actual2, expected); {% else %} diff --git a/static_core/tests/verifier-tests/checkcast_null_acctype.pa b/static_core/tests/verifier-tests/checkcast_null_acctype.pa index 9d7c2236efb53cf6ebede9437a545729656443b0..dae15cf05f39a0cafe2ecc80a70717c13fdcb341 100644 --- a/static_core/tests/verifier-tests/checkcast_null_acctype.pa +++ b/static_core/tests/verifier-tests/checkcast_null_acctype.pa @@ -19,11 +19,11 @@ sta v0 lda.null checkcast panda.Object - call.virt.acc.short A.unboxed:(A), v0, 0x0 + call.virt.acc.short A.toShort:(A), v0, 0x0 return } -.function i32 A.unboxed(A a0) { +.function i32 A.toShort(A a0) { ldai 0x1 return } \ No newline at end of file