diff --git a/static_core/plugins/ets/sdk/api/@ohos.util.LightWeightSet.ets b/static_core/plugins/ets/sdk/api/@ohos.util.LightWeightSet.ets index 753f9df7b94ecf261531c1bc4c82199a1c6b563b..4ab1a6d0acace747361d4bf610b0fbbf1732f87b 100644 --- a/static_core/plugins/ets/sdk/api/@ohos.util.LightWeightSet.ets +++ b/static_core/plugins/ets/sdk/api/@ohos.util.LightWeightSet.ets @@ -224,7 +224,7 @@ export class LightWeightSet implements ReadonlyLightWeightSet, JsonReplace } else { const hashCode = this.hash(key); let low: int = 0; - let high: int = this.buckets.length - 1; + let high: int = this.buckets.length.toInt() - 1; while (low <= high) { const mid = (low + high) >>> 1; const midHash = this.hash(this.buckets.getKeyAt(mid)!); diff --git a/static_core/plugins/ets/sdk/arkts/@arkts.collections.ets b/static_core/plugins/ets/sdk/arkts/@arkts.collections.ets index 335c6ffc7852623d823c7b9371659e4448df7556..b5c780233bd0c8a2c37a0699fdc1beddbb6c2351 100644 --- a/static_core/plugins/ets/sdk/arkts/@arkts.collections.ets +++ b/static_core/plugins/ets/sdk/arkts/@arkts.collections.ets @@ -87,7 +87,7 @@ export namespace collections { if (length === 0) { this.buffer = new Array(); } else { - this._length = length; + this._length = length.toInt(); this.buffer = Array.create(this.getUsedCapacity(), 0); } } @@ -368,7 +368,7 @@ export namespace collections { throw createBusinessError(OutOfBoundsErrorCodeId, `The value of \"length\" is out of range. It must be >= 0. Received value is: ${size}`); } - let sizeInt: int = size; + let sizeInt: int = size.toInt(); if (this._length >= sizeInt) { this._length = sizeInt; return; diff --git a/static_core/plugins/ets/stdlib/escompat/taskpool.ets b/static_core/plugins/ets/stdlib/escompat/taskpool.ets index 3265a567a9230ed9f9c99dd80756509ece7b612a..0ccfa6cf42b177065273af7c0838f80859bdaa49 100644 --- a/static_core/plugins/ets/stdlib/escompat/taskpool.ets +++ b/static_core/plugins/ets/stdlib/escompat/taskpool.ets @@ -1556,7 +1556,7 @@ export namespace taskpool { function getTaskPoolWorkersNum(): int { let num = 0; ConcurrencyHelpers.lockGuard(workersMutex, () => { - num = workers.size; + num = workers.size.toInt(); }); return num; } diff --git a/static_core/plugins/ets/stdlib/std/core/Console.ets b/static_core/plugins/ets/stdlib/std/core/Console.ets index 0eb5663e1a6b430331aedf1a535f605283d06f79..6273f4eb39ee4da3e253a0327e3c8815b7b279c4 100644 --- a/static_core/plugins/ets/stdlib/std/core/Console.ets +++ b/static_core/plugins/ets/stdlib/std/core/Console.ets @@ -882,8 +882,8 @@ export final class Console { let stringVal = Rows[j * indexNum + i]; let stringLen = Console.getStringLen(stringVal); if (stringLen > 0) { - let left:int = ((columnWidths[j] - stringLen) / 2) as int; - let right:int = (columnWidths[j] - stringLen - left) as int; + let left:int = ((columnWidths[j] - stringLen) / 2).toInt(); + let right:int = (columnWidths[j] - stringLen - left).toInt(); result += Console.stringRepeat(left, " ") + stringVal + Console.stringRepeat(right, " "); } else { result += Console.stringRepeat(columnWidths[j], " "); diff --git a/static_core/plugins/ets/stdlib/std/core/String.ets b/static_core/plugins/ets/stdlib/std/core/String.ets index 34827095ade18e33ac8b1c0ef27c327772c0128b..1a8476c2ea5653f09fb2ff2d33e610660d3322d2 100644 --- a/static_core/plugins/ets/stdlib/std/core/String.ets +++ b/static_core/plugins/ets/stdlib/std/core/String.ets @@ -1533,7 +1533,7 @@ export final class String extends Object implements Comparable, Iterable } let preceding = this.substring(0, position) let following = this.substring(position + searchLength) - let replacement = replacer(searchValue, [position.toDouble() as Object, this as Object] as Object[]) + let replacement = replacer(searchValue, [new Double(position.toDouble()) as Object, this as Object] as Object[]) return preceding + replacement + following } diff --git a/static_core/plugins/ets/tests/ani/tests/array_ops/array_region_float_test.ets b/static_core/plugins/ets/tests/ani/tests/array_ops/array_region_float_test.ets index 4ddb4e6315a0d7cc32b3badca6583d5f359e13e4..f0715e61a4547f20d3c11cd8b5e275d274191bfc 100644 --- a/static_core/plugins/ets/tests/ani/tests/array_ops/array_region_float_test.ets +++ b/static_core/plugins/ets/tests/ani/tests/array_ops/array_region_float_test.ets @@ -17,8 +17,8 @@ class ArrayClass { public static array: float[] = [1.0f, 2.0f, 3.0f, 4.0f, 5.0f] public static changeStaticArray() { - ArrayClass.array[2] = 22.0 as float - ArrayClass.array[4] = 44.0 as float + ArrayClass.array[2] = 22.0f + ArrayClass.array[4] = 44.0f } public static checkStaticArray(): boolean { @@ -40,11 +40,11 @@ function getArray(): float[] { function getEscompatArray(): Array { let a: Array = new Array(5) - a[0] = 1.0 as float - a[1] = 2.0 as float - a[2] = 3.0 as float - a[3] = 4.0 as float - a[4] = 5.0 as float + a[0] = 1.0f + a[1] = 2.0f + a[2] = 3.0f + a[3] = 4.0f + a[4] = 5.0f return a } diff --git a/static_core/plugins/ets/tests/ani/tests/fixedarray_ops/fixedarray_region_float_test.ets b/static_core/plugins/ets/tests/ani/tests/fixedarray_ops/fixedarray_region_float_test.ets index dfd780cac8879f555d89e2a46313aeb1dd86966a..c6a72ad25c64c7d9f248b5254d214adf6090da80 100644 --- a/static_core/plugins/ets/tests/ani/tests/fixedarray_ops/fixedarray_region_float_test.ets +++ b/static_core/plugins/ets/tests/ani/tests/fixedarray_ops/fixedarray_region_float_test.ets @@ -17,8 +17,8 @@ class ArrayClass { public static array: FixedArray = [1.0f, 2.0f, 3.0f, 4.0f, 5.0f] public static changeStaticArray() { - ArrayClass.array[2] = 22.0 as float - ArrayClass.array[4] = 44.0 as float + ArrayClass.array[2] = 22.0f + ArrayClass.array[4] = 44.0f } public static checkStaticArray(): boolean { diff --git a/static_core/plugins/ets/tests/ani/tests/object_ops/call_object_method_float_test.ets b/static_core/plugins/ets/tests/ani/tests/object_ops/call_object_method_float_test.ets index c91e4f95c85b3491a9b027e05a06edfbe8bc0ad6..c6e4c33a889f8f5dbf275fdfe639fd71d26c89b3 100644 --- a/static_core/plugins/ets/tests/ani/tests/object_ops/call_object_method_float_test.ets +++ b/static_core/plugins/ets/tests/ani/tests/object_ops/call_object_method_float_test.ets @@ -26,7 +26,7 @@ class A { public floatMethodVoidParam(): float { - return 5.0 as float; + return 5.0f; } public floatMethodMultipleParam(a0: short, a1: boolean, a2:float, a3:short, a4:float): float @@ -63,7 +63,7 @@ final class B extends A { public subFloatMethodVoidParam(): float { - return 8.0 as float; + return 8.0f; } } diff --git a/static_core/plugins/ets/tests/checked/ani/direct_native.ets b/static_core/plugins/ets/tests/checked/ani/direct_native.ets index b05d10414310b208db3fc56baa207838f3e07e18..b5964d22ddca31a6bc4e2e745d22e7af9fcb7b1a 100644 --- a/static_core/plugins/ets/tests/checked/ani/direct_native.ets +++ b/static_core/plugins/ets/tests/checked/ani/direct_native.ets @@ -61,9 +61,9 @@ function test(i0: byte, i1: short, i2: int, i3: long, f0: float, f1: double, f2: function main(): int { let res = 0; for (let i = 0; i < 100; ++i) { - res = test(0 as byte, 1 as short, 2, 3 as long, 0.0 as float, 1.0, 2.0, + res = test(0 as byte, 1 as short, 2, 3 as long, 0.0f, 1.0, 2.0, 4, 5, 6, 7 as long, 8, 9 as short, 10, 11, 12, 13, 14, - 3.0 as float, 4.0 as float, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0); + 3.0f, 4.0f, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0); if (res != 0) { return res; } diff --git a/static_core/plugins/ets/tests/checked/ani/quick_native.ets b/static_core/plugins/ets/tests/checked/ani/quick_native.ets index 7cfa1cf4e15467ebd020bc860a7213a75de1e19c..f0f19c86c473b2d053ea93b7e9f773adfbc2a6db 100644 --- a/static_core/plugins/ets/tests/checked/ani/quick_native.ets +++ b/static_core/plugins/ets/tests/checked/ani/quick_native.ets @@ -155,10 +155,10 @@ class TestResult { return 16; } - if (this.f0.value != 0.0 as float) { + if (this.f0.value != 0.0f) { return 17; } - if (this.f1 != 1.0 as float) { + if (this.f1 != 1.0f) { return 18; } if (this.f2.value != 2.0 as double) { @@ -167,10 +167,10 @@ class TestResult { if (this.f3 != 3.0 as double) { return 20; } - if (this.f4.value != 4.0 as float) { + if (this.f4.value != 4.0f) { return 21; } - if (this.f5 != 5.0 as float) { + if (this.f5 != 5.0f) { return 22; } if (this.f6.value != 6.0 as double) { @@ -179,10 +179,10 @@ class TestResult { if (this.f7 != 7.0 as double) { return 24; } - if (this.f8.value != 8.0 as float) { + if (this.f8.value != 8.0f) { return 25; } - if (this.f9 != 9.0 as float) { + if (this.f9 != 9.0f) { return 26; } if (this.f10.value != 10.0 as double) { @@ -191,10 +191,10 @@ class TestResult { if (this.f11 != 11.0 as double) { return 28; } - if (this.f12.value != 12.0 as float) { + if (this.f12.value != 12.0f) { return 29; } - if (this.f13 != 13.0 as float) { + if (this.f13 != 13.0f) { return 30; } if (this.f14.value != 14.0 as double) { @@ -302,8 +302,8 @@ export class NativeModule { function testGeneralStaticPrim(): TestResult { let tr = new TestResult(new ByteWrapper(0 as byte), 1 as byte, new ShortWrapper(2 as short), 3 as short, new IntWrapper(4 as int), 5 as int, new LongWrapper(6 as long), 7 as long, new ByteWrapper(8 as byte), 9 as byte, new ShortWrapper(10 as short), 11 as short, new IntWrapper(12 as int), 13 as int, new LongWrapper(14 as long), 15 as long, - new FloatWrapper(0.0 as float), 1.0 as float, new DoubleWrapper(2.0 as double), 3.0 as double, new FloatWrapper(4.0 as float), 5.0 as float, new DoubleWrapper(6.0 as double), 7.0 as double, - new FloatWrapper(8.0 as float), 9.0 as float, new DoubleWrapper(10.0 as double), 11.0 as double, new FloatWrapper(12.0 as float), 13.0 as float, new DoubleWrapper(14.0 as double), 15.0 as double); + new FloatWrapper(0.0f), 1.0f, new DoubleWrapper(2.0 as double), 3.0 as double, new FloatWrapper(4.0f), 5.0f, new DoubleWrapper(6.0 as double), 7.0 as double, + new FloatWrapper(8.0f), 9.0f, new DoubleWrapper(10.0 as double), 11.0 as double, new FloatWrapper(12.0f), 13.0f, new DoubleWrapper(14.0 as double), 15.0 as double); let res = NativeModule.generalStaticPrim(tr.i0, tr.i1, tr.i2, tr.i3, tr.i4, tr.i5, tr.i6, tr.i7, tr.i8, tr.i9, tr.i10, tr.i11, tr.i12, tr.i13, tr.i14, tr.i15, tr.f0, tr.f1, tr.f2, tr.f3, tr.f4, tr.f5, tr.f6, tr.f7, tr.f8, tr.f9, tr.f10, tr.f11, tr.f12, tr.f13, tr.f14, tr.f15); tr.res = new IntWrapper(res); @@ -313,8 +313,8 @@ function testGeneralStaticPrim(): TestResult { function testQuickStaticPrim(): TestResult { let tr = new TestResult(new ByteWrapper(0 as byte), 1 as byte, new ShortWrapper(2 as short), 3 as short, new IntWrapper(4 as int), 5 as int, new LongWrapper(6 as long), 7 as long, new ByteWrapper(8 as byte), 9 as byte, new ShortWrapper(10 as short), 11 as short, new IntWrapper(12 as int), 13 as int, new LongWrapper(14 as long), 15 as long, - new FloatWrapper(0.0 as float), 1.0 as float, new DoubleWrapper(2.0 as double), 3.0 as double, new FloatWrapper(4.0 as float), 5.0 as float, new DoubleWrapper(6.0 as double), 7.0 as double, - new FloatWrapper(8.0 as float), 9.0 as float, new DoubleWrapper(10.0 as double), 11.0 as double, new FloatWrapper(12.0 as float), 13.0 as float, new DoubleWrapper(14.0 as double), 15.0 as double); + new FloatWrapper(0.0f), 1.0f, new DoubleWrapper(2.0 as double), 3.0 as double, new FloatWrapper(4.0f), 5.0f, new DoubleWrapper(6.0 as double), 7.0 as double, + new FloatWrapper(8.0f), 9.0f, new DoubleWrapper(10.0 as double), 11.0 as double, new FloatWrapper(12.0f), 13.0f, new DoubleWrapper(14.0 as double), 15.0 as double); let res = NativeModule.quickStaticPrim(tr.i0, tr.i1, tr.i2, tr.i3, tr.i4, tr.i5, tr.i6, tr.i7, tr.i8, tr.i9, tr.i10, tr.i11, tr.i12, tr.i13, tr.i14, tr.i15, tr.f0, tr.f1, tr.f2, tr.f3, tr.f4, tr.f5, tr.f6, tr.f7, tr.f8, tr.f9, tr.f10, tr.f11, tr.f12, tr.f13, tr.f14, tr.f15); tr.res = new IntWrapper(res); @@ -324,8 +324,8 @@ function testQuickStaticPrim(): TestResult { function testGeneralStaticObj(): TestResult { let tr = new TestResult(new ByteWrapper(0 as byte), 1 as byte, new ShortWrapper(2 as short), 3 as short, new IntWrapper(4 as int), 5 as int, new LongWrapper(6 as long), 7 as long, new ByteWrapper(8 as byte), 9 as byte, new ShortWrapper(10 as short), 11 as short, new IntWrapper(12 as int), 13 as int, new LongWrapper(14 as long), 15 as long, - new FloatWrapper(0.0 as float), 1.0 as float, new DoubleWrapper(2.0 as double), 3.0 as double, new FloatWrapper(4.0 as float), 5.0 as float, new DoubleWrapper(6.0 as double), 7.0 as double, - new FloatWrapper(8.0 as float), 9.0 as float, new DoubleWrapper(10.0 as double), 11.0 as double, new FloatWrapper(12.0 as float), 13.0 as float, new DoubleWrapper(14.0 as double), 15.0 as double); + new FloatWrapper(0.0f), 1.0f, new DoubleWrapper(2.0 as double), 3.0 as double, new FloatWrapper(4.0f), 5.0f, new DoubleWrapper(6.0 as double), 7.0 as double, + new FloatWrapper(8.0f), 9.0f, new DoubleWrapper(10.0 as double), 11.0 as double, new FloatWrapper(12.0f), 13.0f, new DoubleWrapper(14.0 as double), 15.0 as double); let res = NativeModule.generalStaticObj(tr.i0, tr.i1, tr.i2, tr.i3, tr.i4, tr.i5, tr.i6, tr.i7, tr.i8, tr.i9, tr.i10, tr.i11, tr.i12, tr.i13, tr.i14, tr.i15, tr.f0, tr.f1, tr.f2, tr.f3, tr.f4, tr.f5, tr.f6, tr.f7, tr.f8, tr.f9, tr.f10, tr.f11, tr.f12, tr.f13, tr.f14, tr.f15); tr.res = res; @@ -335,8 +335,8 @@ function testGeneralStaticObj(): TestResult { function testQuickStaticObj(): TestResult { let tr = new TestResult(new ByteWrapper(0 as byte), 1 as byte, new ShortWrapper(2 as short), 3 as short, new IntWrapper(4 as int), 5 as int, new LongWrapper(6 as long), 7 as long, new ByteWrapper(8 as byte), 9 as byte, new ShortWrapper(10 as short), 11 as short, new IntWrapper(12 as int), 13 as int, new LongWrapper(14 as long), 15 as long, - new FloatWrapper(0.0 as float), 1.0 as float, new DoubleWrapper(2.0 as double), 3.0 as double, new FloatWrapper(4.0 as float), 5.0 as float, new DoubleWrapper(6.0 as double), 7.0 as double, - new FloatWrapper(8.0 as float), 9.0 as float, new DoubleWrapper(10.0 as double), 11.0 as double, new FloatWrapper(12.0 as float), 13.0 as float, new DoubleWrapper(14.0 as double), 15.0 as double); + new FloatWrapper(0.0f), 1.0f, new DoubleWrapper(2.0 as double), 3.0 as double, new FloatWrapper(4.0f), 5.0f, new DoubleWrapper(6.0 as double), 7.0 as double, + new FloatWrapper(8.0f), 9.0f, new DoubleWrapper(10.0 as double), 11.0 as double, new FloatWrapper(12.0f), 13.0f, new DoubleWrapper(14.0 as double), 15.0 as double); let res = NativeModule.quickStaticObj(tr.i0, tr.i1, tr.i2, tr.i3, tr.i4, tr.i5, tr.i6, tr.i7, tr.i8, tr.i9, tr.i10, tr.i11, tr.i12, tr.i13, tr.i14, tr.i15, tr.f0, tr.f1, tr.f2, tr.f3, tr.f4, tr.f5, tr.f6, tr.f7, tr.f8, tr.f9, tr.f10, tr.f11, tr.f12, tr.f13, tr.f14, tr.f15); tr.res = res; @@ -346,8 +346,8 @@ function testQuickStaticObj(): TestResult { function testGeneralVirtualFinalPrim(): TestResult { let tr = new TestResult(new ByteWrapper(0 as byte), 1 as byte, new ShortWrapper(2 as short), 3 as short, new IntWrapper(4 as int), 5 as int, new LongWrapper(6 as long), 7 as long, new ByteWrapper(8 as byte), 9 as byte, new ShortWrapper(10 as short), 11 as short, new IntWrapper(12 as int), 13 as int, new LongWrapper(14 as long), 15 as long, - new FloatWrapper(0.0 as float), 1.0 as float, new DoubleWrapper(2.0 as double), 3.0 as double, new FloatWrapper(4.0 as float), 5.0 as float, new DoubleWrapper(6.0 as double), 7.0 as double, - new FloatWrapper(8.0 as float), 9.0 as float, new DoubleWrapper(10.0 as double), 11.0 as double, new FloatWrapper(12.0 as float), 13.0 as float, new DoubleWrapper(14.0 as double), 15.0 as double); + new FloatWrapper(0.0f), 1.0f, new DoubleWrapper(2.0 as double), 3.0 as double, new FloatWrapper(4.0f), 5.0f, new DoubleWrapper(6.0 as double), 7.0 as double, + new FloatWrapper(8.0f), 9.0f, new DoubleWrapper(10.0 as double), 11.0 as double, new FloatWrapper(12.0f), 13.0f, new DoubleWrapper(14.0 as double), 15.0 as double); let res = (new NativeModule).generalVirtualFinalPrim(tr.i0, tr.i1, tr.i2, tr.i3, tr.i4, tr.i5, tr.i6, tr.i7, tr.i8, tr.i9, tr.i10, tr.i11, tr.i12, tr.i13, tr.i14, tr.i15, tr.f0, tr.f1, tr.f2, tr.f3, tr.f4, tr.f5, tr.f6, tr.f7, tr.f8, tr.f9, tr.f10, tr.f11, tr.f12, tr.f13, tr.f14, tr.f15); tr.res = new IntWrapper(res); @@ -357,8 +357,8 @@ function testGeneralVirtualFinalPrim(): TestResult { function testQuickVirtualFinalPrim(): TestResult { let tr = new TestResult(new ByteWrapper(0 as byte), 1 as byte, new ShortWrapper(2 as short), 3 as short, new IntWrapper(4 as int), 5 as int, new LongWrapper(6 as long), 7 as long, new ByteWrapper(8 as byte), 9 as byte, new ShortWrapper(10 as short), 11 as short, new IntWrapper(12 as int), 13 as int, new LongWrapper(14 as long), 15 as long, - new FloatWrapper(0.0 as float), 1.0 as float, new DoubleWrapper(2.0 as double), 3.0 as double, new FloatWrapper(4.0 as float), 5.0 as float, new DoubleWrapper(6.0 as double), 7.0 as double, - new FloatWrapper(8.0 as float), 9.0 as float, new DoubleWrapper(10.0 as double), 11.0 as double, new FloatWrapper(12.0 as float), 13.0 as float, new DoubleWrapper(14.0 as double), 15.0 as double); + new FloatWrapper(0.0f), 1.0f, new DoubleWrapper(2.0 as double), 3.0 as double, new FloatWrapper(4.0f), 5.0f, new DoubleWrapper(6.0 as double), 7.0 as double, + new FloatWrapper(8.0f), 9.0f, new DoubleWrapper(10.0 as double), 11.0 as double, new FloatWrapper(12.0f), 13.0f, new DoubleWrapper(14.0 as double), 15.0 as double); let res = (new NativeModule).quickVirtualFinalPrim(tr.i0, tr.i1, tr.i2, tr.i3, tr.i4, tr.i5, tr.i6, tr.i7, tr.i8, tr.i9, tr.i10, tr.i11, tr.i12, tr.i13, tr.i14, tr.i15, tr.f0, tr.f1, tr.f2, tr.f3, tr.f4, tr.f5, tr.f6, tr.f7, tr.f8, tr.f9, tr.f10, tr.f11, tr.f12, tr.f13, tr.f14, tr.f15); tr.res = new IntWrapper(res); @@ -368,8 +368,8 @@ function testQuickVirtualFinalPrim(): TestResult { function testGeneralVirtualFinalObj(): TestResult { let tr = new TestResult(new ByteWrapper(0 as byte), 1 as byte, new ShortWrapper(2 as short), 3 as short, new IntWrapper(4 as int), 5 as int, new LongWrapper(6 as long), 7 as long, new ByteWrapper(8 as byte), 9 as byte, new ShortWrapper(10 as short), 11 as short, new IntWrapper(12 as int), 13 as int, new LongWrapper(14 as long), 15 as long, - new FloatWrapper(0.0 as float), 1.0 as float, new DoubleWrapper(2.0 as double), 3.0 as double, new FloatWrapper(4.0 as float), 5.0 as float, new DoubleWrapper(6.0 as double), 7.0 as double, - new FloatWrapper(8.0 as float), 9.0 as float, new DoubleWrapper(10.0 as double), 11.0 as double, new FloatWrapper(12.0 as float), 13.0 as float, new DoubleWrapper(14.0 as double), 15.0 as double); + new FloatWrapper(0.0f), 1.0f, new DoubleWrapper(2.0 as double), 3.0 as double, new FloatWrapper(4.0f), 5.0f, new DoubleWrapper(6.0 as double), 7.0 as double, + new FloatWrapper(8.0f), 9.0f, new DoubleWrapper(10.0 as double), 11.0 as double, new FloatWrapper(12.0f), 13.0f, new DoubleWrapper(14.0 as double), 15.0 as double); let res = (new NativeModule).generalVirtualFinalObj(tr.i0, tr.i1, tr.i2, tr.i3, tr.i4, tr.i5, tr.i6, tr.i7, tr.i8, tr.i9, tr.i10, tr.i11, tr.i12, tr.i13, tr.i14, tr.i15, tr.f0, tr.f1, tr.f2, tr.f3, tr.f4, tr.f5, tr.f6, tr.f7, tr.f8, tr.f9, tr.f10, tr.f11, tr.f12, tr.f13, tr.f14, tr.f15); tr.res = res; @@ -379,8 +379,8 @@ function testGeneralVirtualFinalObj(): TestResult { function testQuickVirtualFinalObj(): TestResult { let tr = new TestResult(new ByteWrapper(0 as byte), 1 as byte, new ShortWrapper(2 as short), 3 as short, new IntWrapper(4 as int), 5 as int, new LongWrapper(6 as long), 7 as long, new ByteWrapper(8 as byte), 9 as byte, new ShortWrapper(10 as short), 11 as short, new IntWrapper(12 as int), 13 as int, new LongWrapper(14 as long), 15 as long, - new FloatWrapper(0.0 as float), 1.0 as float, new DoubleWrapper(2.0 as double), 3.0 as double, new FloatWrapper(4.0 as float), 5.0 as float, new DoubleWrapper(6.0 as double), 7.0 as double, - new FloatWrapper(8.0 as float), 9.0 as float, new DoubleWrapper(10.0 as double), 11.0 as double, new FloatWrapper(12.0 as float), 13.0 as float, new DoubleWrapper(14.0 as double), 15.0 as double); + new FloatWrapper(0.0f), 1.0f, new DoubleWrapper(2.0 as double), 3.0 as double, new FloatWrapper(4.0f), 5.0f, new DoubleWrapper(6.0 as double), 7.0 as double, + new FloatWrapper(8.0f), 9.0f, new DoubleWrapper(10.0 as double), 11.0 as double, new FloatWrapper(12.0f), 13.0f, new DoubleWrapper(14.0 as double), 15.0 as double); let res = (new NativeModule).quickVirtualFinalObj(tr.i0, tr.i1, tr.i2, tr.i3, tr.i4, tr.i5, tr.i6, tr.i7, tr.i8, tr.i9, tr.i10, tr.i11, tr.i12, tr.i13, tr.i14, tr.i15, tr.f0, tr.f1, tr.f2, tr.f3, tr.f4, tr.f5, tr.f6, tr.f7, tr.f8, tr.f9, tr.f10, tr.f11, tr.f12, tr.f13, tr.f14, tr.f15); tr.res = res; diff --git a/static_core/plugins/ets/tests/checked/escompat_array_get_set_derived.ets b/static_core/plugins/ets/tests/checked/escompat_array_get_set_derived.ets index 776fca727c8cbbd45bfd9431a1579390d59d2c28..f19cfcbce919cf3a2266c2b445273e03b512323c 100644 --- a/static_core/plugins/ets/tests/checked/escompat_array_get_set_derived.ets +++ b/static_core/plugins/ets/tests/checked/escompat_array_get_set_derived.ets @@ -156,7 +156,7 @@ function __noinline__testWithRandomBranch(branch: int): void { } function __noinline__getRandomBranch() { - return (Date.now() % NUM_ARRAY_BRANCHES) as int; + return (Date.now() % NUM_ARRAY_BRANCHES).toInt(); } function test1(): void { diff --git a/static_core/plugins/ets/tests/checked/ets_isFinite.ets b/static_core/plugins/ets/tests/checked/ets_isFinite.ets index 5c5269275248a69a165ee3901baedeb61e55d9ee..8c31234e26fcfef29452550b8bac798b1f5832ef 100644 --- a/static_core/plugins/ets/tests/checked/ets_isFinite.ets +++ b/static_core/plugins/ets/tests/checked/ets_isFinite.ets @@ -75,7 +75,7 @@ function check_isfinite_f32() : int { if (Float.isFinite(Float.NEGATIVE_INFINITY)) return 3; if (!Float.isFinite(Float.MAX_VALUE)) return 4; if (!Float.isFinite(Float.MIN_VALUE)) return 5; - if (!Float.isFinite(1.2345 as float)) return 6; + if (!Float.isFinite(1.2345f)) return 6; return 0; } diff --git a/static_core/plugins/ets/tests/checked/ets_isNaN.ets b/static_core/plugins/ets/tests/checked/ets_isNaN.ets index 51829c87d9057dd858040e540e752fed5f517bda..ee4355f127d7d6f6e412b82aff7ddff5fb9bbd69 100644 --- a/static_core/plugins/ets/tests/checked/ets_isNaN.ets +++ b/static_core/plugins/ets/tests/checked/ets_isNaN.ets @@ -63,7 +63,7 @@ function check_isnan_f32() : int { if (Float.isNaN(Float.NEGATIVE_INFINITY)) return 3; if (Float.isNaN(Float.MAX_VALUE)) return 4; if (Float.isNaN(Float.MIN_VALUE)) return 5; - if (Float.isNaN(1.2345 as float)) return 6; + if (Float.isNaN(1.2345f)) return 6; return 0; } diff --git a/static_core/plugins/ets/tests/checked/ets_max.ets b/static_core/plugins/ets/tests/checked/ets_max.ets index 4fe287cb41144713cadbd188d8698f12a38ed7e0..07074e2b278e74caeb870c6fa9da7e23409ebaed 100644 --- a/static_core/plugins/ets/tests/checked/ets_max.ets +++ b/static_core/plugins/ets/tests/checked/ets_max.ets @@ -103,12 +103,12 @@ function test_i64() : int { function test_f32() : int { if (max(Float.POSITIVE_INFINITY, Float.NEGATIVE_INFINITY) != Float.POSITIVE_INFINITY) return 21; if (max(Float.MAX_VALUE, Float.NEGATIVE_INFINITY) != Float.MAX_VALUE) return 22; - if (max(0. as float, Float.NEGATIVE_INFINITY) != 0 as float) return 23; - if (max(0. as float, Float.MIN_VALUE) != Float.MIN_VALUE) return 24; + if (max((0.).toFloat(), Float.NEGATIVE_INFINITY) != 0 as float) return 23; + if (max((0).toFloat(), Float.MIN_VALUE) != Float.MIN_VALUE) return 24; if (max(Float.MAX_VALUE, Float.MIN_VALUE) != Float.MAX_VALUE) return 25; - if (max(0. as float, 2. as float) != 2. as float) return 26; - if (max(0. as float, -4. as float) != 0. as float) return 27; - if (max(1.e-10 as float, 2.e+12 as float) != 2.e+12 as float) return 28; + if (max((0).toFloat(), (2).toFloat()) != (2).toFloat()) return 26; + if (max((0).toFloat(), (-4).toFloat()) != (0).toFloat()) return 27; + if (max((1.e-10).toFloat(), (2.e+12).toFloat()) != (2.e+12).toFloat()) return 28; if (!Float.isNaN(max(Float.NaN, Float.NaN))) return 29; if (!Float.isNaN(max(Float.MAX_VALUE, Float.NaN))) return 30; diff --git a/static_core/plugins/ets/tests/checked/ets_min.ets b/static_core/plugins/ets/tests/checked/ets_min.ets index 0f4f228a00c022e69905987f1299e390e1792743..88341a628611a05de8cdb728bc413e40bc329f68 100644 --- a/static_core/plugins/ets/tests/checked/ets_min.ets +++ b/static_core/plugins/ets/tests/checked/ets_min.ets @@ -103,12 +103,12 @@ function test_i64() : int { function test_f32() : int { if (min(Float.POSITIVE_INFINITY, Float.NEGATIVE_INFINITY) != Float.NEGATIVE_INFINITY) return 21; if (min(Float.MAX_VALUE, Float.NEGATIVE_INFINITY) != Float.NEGATIVE_INFINITY) return 22; - if (min(0. as float, Float.NEGATIVE_INFINITY) != Float.NEGATIVE_INFINITY) return 23; - if (min(0. as float, Float.MIN_VALUE) != 0. as float) return 24; + if (min(0.0f, Float.NEGATIVE_INFINITY) != Float.NEGATIVE_INFINITY) return 23; + if (min(0.0f, Float.MIN_VALUE) != 0.0f) return 24; if (min(Float.MAX_VALUE, Float.MIN_VALUE) != Float.MIN_VALUE) return 25; - if (min(0. as float, 2. as float) != 0. as float) return 26; - if (min(0. as float, -4. as float) != -4. as float) return 27; - if (min(1.e-10 as float, 2.e+12 as float) != 1.e-10 as float) return 28; + if (min(0.0f, 2.0f) != 0.0f) return 26; + if (min(0.0f, -4.0f) != -4.0f) return 27; + if (min((1.e-10).toFloat(), (2.e+12).toFloat()) != (1.e-10).toFloat()) return 28; if (!Float.isNaN(min(Float.NaN, Float.NaN))) return 29; if (!Float.isNaN(min(Float.MAX_VALUE, Float.NaN))) return 30; diff --git a/static_core/plugins/ets/tests/checked/optimize_doubled_xor.ets b/static_core/plugins/ets/tests/checked/optimize_doubled_xor.ets index 28979c328c1131846e77e9c259fdebda33e05bb8..234aa905e26427567f147d7610a90cf311e4a256 100644 --- a/static_core/plugins/ets/tests/checked/optimize_doubled_xor.ets +++ b/static_core/plugins/ets/tests/checked/optimize_doubled_xor.ets @@ -292,7 +292,7 @@ function test_xor_chain_byte(param: byte): byte { let t: Int = __noinline__dummyReturn() } - return result as byte; + return result.toByte(); } function test_xor_chain_short(param: short): short { @@ -304,7 +304,7 @@ function test_xor_chain_short(param: short): short { let t: Int = __noinline__dummyReturn() } - return result as short; + return result.toShort(); } function test_xor_chain_int(param: int): int { diff --git a/static_core/plugins/ets/tests/common/bouncing_pandas/bouncing_pandas.ets b/static_core/plugins/ets/tests/common/bouncing_pandas/bouncing_pandas.ets index 008d0706c114149308e3e29bcad363f1758b97df..ec03a104a0f730c350f506571a4a9deea146ad6d 100644 --- a/static_core/plugins/ets/tests/common/bouncing_pandas/bouncing_pandas.ets +++ b/static_core/plugins/ets/tests/common/bouncing_pandas/bouncing_pandas.ets @@ -133,10 +133,10 @@ function simProcessCollision(a: SBody, b: SBody): void { let shift: float = a.rad + b.rad - rlen as float; if (shift < 0) return; // too far - let n = v2scale(1.0 as float / rlen as float, r); + let n = v2scale(1.0f / rlen as float, r); let mratio: float = b.m / a.m; - let msum: float = 1.0 as float + mratio; - let dvlen: float = (2.0 as float * v2dot(n, v2sub(a.v, b.v)) as float / msum) as float; + let msum: float = 1.0f + mratio; + let dvlen: float = (2.0f * v2dot(n, v2sub(a.v, b.v)) as float / msum) as float; a.v = v2add(a.v, v2scale(-mratio as float * dvlen as float, n)); b.v = v2add(b.v, v2scale(dvlen, n)); a.r = v2add(a.r, v2scale((-mratio * shift) as float / msum as float, n)); diff --git a/static_core/plugins/ets/tests/ets-common-tests/intrinsics/bigint64array_sort.ets b/static_core/plugins/ets/tests/ets-common-tests/intrinsics/bigint64array_sort.ets index defc9abf319a2c3a3d0e2d78d39892e2c68710a1..683ca870d30247b98a9266440d879468f2ea3415 100644 --- a/static_core/plugins/ets/tests/ets-common-tests/intrinsics/bigint64array_sort.ets +++ b/static_core/plugins/ets/tests/ets-common-tests/intrinsics/bigint64array_sort.ets @@ -32,7 +32,7 @@ function sortEmpty(): void { function sortSingle(): void { let single: BigInt64Array = new BigInt64Array(SINGLE); single.sort(); - arktest.assertEQ(single[0].getLong(), SINGLE[0] as long); + arktest.assertEQ(single[0].getLong(), SINGLE[0].toLong()); } function sortNormal(): void { diff --git a/static_core/plugins/ets/tests/ets-common-tests/intrinsics/biguint64array_sort.ets b/static_core/plugins/ets/tests/ets-common-tests/intrinsics/biguint64array_sort.ets index f4c5ab3a7414490c4654736793a15145e6134352..52e82725c3df7938216977b800427baa0a8d3403 100644 --- a/static_core/plugins/ets/tests/ets-common-tests/intrinsics/biguint64array_sort.ets +++ b/static_core/plugins/ets/tests/ets-common-tests/intrinsics/biguint64array_sort.ets @@ -20,7 +20,7 @@ const SINGLE = [88]; function checkSorted(a: BigUint64Array): void { for (let i = 0; i < ARRAY_SIZE; ++i) { - arktest.assertEQ(a[i].getLong(), SORTED[i] as long); + arktest.assertEQ(a[i].getLong(), SORTED[i].toLong()); } } @@ -32,7 +32,7 @@ function sortEmpty(): void { function sortSingle(): void { let single: BigUint64Array = new BigUint64Array(SINGLE); single.sort(); - arktest.assertEQ(single[0].getLong(), SINGLE[0] as long); + arktest.assertEQ(single[0].getLong(), SINGLE[0].toLong()); } function sortNormal(): void { diff --git a/static_core/plugins/ets/tests/ets-common-tests/intrinsics/int16array_sort.ets b/static_core/plugins/ets/tests/ets-common-tests/intrinsics/int16array_sort.ets index 9293f415b34fd8a84227ff9488832e3c22a1e02f..95c0afd89ed4e681c620315028a885b940c5e311 100644 --- a/static_core/plugins/ets/tests/ets-common-tests/intrinsics/int16array_sort.ets +++ b/static_core/plugins/ets/tests/ets-common-tests/intrinsics/int16array_sort.ets @@ -25,7 +25,7 @@ function fillBuffer(buf: ArrayBuffer): void { arktest.assertEQ(Short.BYTE_SIZE, 2); for (let i = 0; i < AB_SIZE; ++i) { if ((i % Short.BYTE_SIZE) == 0) { - let v: short = UNSORTED[i / 2] as short; + let v: short = UNSORTED[i / 2].toShort(); if (Runtime.isLittleEndianPlatform()) { buf.set(i, v.toByte()); buf.set(i + 1, (v >>> 8).toByte()); diff --git a/static_core/plugins/ets/tests/ets-common-tests/intrinsics/int32array_sort.ets b/static_core/plugins/ets/tests/ets-common-tests/intrinsics/int32array_sort.ets index 1940d81dd4ddd3ec5d7fce9cbea00979339dec4d..e68de4e8b6b923872ce3d8e3ab2bcf6224438f1a 100644 --- a/static_core/plugins/ets/tests/ets-common-tests/intrinsics/int32array_sort.ets +++ b/static_core/plugins/ets/tests/ets-common-tests/intrinsics/int32array_sort.ets @@ -25,7 +25,7 @@ function fillBuffer(buf: ArrayBuffer): void { arktest.assertEQ(Int.BYTE_SIZE, 4); for (let i = 0; i < AB_SIZE; ++i) { if ((i % Int.BYTE_SIZE) == 0) { - let v: int = UNSORTED[i / Int.BYTE_SIZE] as int; + let v: int = UNSORTED[i / Int.BYTE_SIZE].toInt(); if (Runtime.isLittleEndianPlatform()) { buf.set(i, v.toByte()); buf.set(i + 1, (v >>> 8).toByte()); diff --git a/static_core/plugins/ets/tests/ets-common-tests/intrinsics/isFinite.ets b/static_core/plugins/ets/tests/ets-common-tests/intrinsics/isFinite.ets index 5655e07549cacf40550f50982da02621296010ea..afaa202488adc5379e516f9c806dc44700e61a76 100644 --- a/static_core/plugins/ets/tests/ets-common-tests/intrinsics/isFinite.ets +++ b/static_core/plugins/ets/tests/ets-common-tests/intrinsics/isFinite.ets @@ -29,7 +29,7 @@ function main(): int { if (!Float.isFinite(Float.MIN_VALUE)) { return 5; } - if (!Float.isFinite(1.2345 as float)) { + if (!Float.isFinite(1.2345f)) { return 6; } if (Double.isFinite(Double.NaN)) { diff --git a/static_core/plugins/ets/tests/ets-common-tests/intrinsics/isInteger.ets b/static_core/plugins/ets/tests/ets-common-tests/intrinsics/isInteger.ets index 8df65b15caca27a8317882c22bde4bdfbae113cf..40e433def78fcf354393cd87913c2c1abc9474ae 100644 --- a/static_core/plugins/ets/tests/ets-common-tests/intrinsics/isInteger.ets +++ b/static_core/plugins/ets/tests/ets-common-tests/intrinsics/isInteger.ets @@ -26,7 +26,7 @@ class IsIntegerDoubleTest { function main(): int { let ft = new IsIntegerFloatTest(); ft.rightInteger = 1.0f; - ft.wrongInteger = 1.0 as float + Float.DELTA + Float.DELTA; + ft.wrongInteger = 1.0f + Float.DELTA + Float.DELTA; if (Float.isInteger(Float.NaN) != false) { return 1; diff --git a/static_core/plugins/ets/tests/ets-common-tests/intrinsics/isNaN.ets b/static_core/plugins/ets/tests/ets-common-tests/intrinsics/isNaN.ets index 34103d451785661667a91bdadc49abc0f9e7873c..516ad21023ce0d9fda8ef2943e0260194a35c960 100644 --- a/static_core/plugins/ets/tests/ets-common-tests/intrinsics/isNaN.ets +++ b/static_core/plugins/ets/tests/ets-common-tests/intrinsics/isNaN.ets @@ -29,7 +29,7 @@ function main(): int { if (Float.isNaN(Float.MIN_VALUE)) { return 5; } - if (Float.isNaN(1.2345 as float)) { + if (Float.isNaN(1.2345f)) { return 6; } diff --git a/static_core/plugins/ets/tests/ets-common-tests/intrinsics/isSafeInteger.ets b/static_core/plugins/ets/tests/ets-common-tests/intrinsics/isSafeInteger.ets index f84174f5b01d57eb902ac9c2b901f83d1a4b69ef..de8cb6868f0137bec984db2582dbec342dba52ae 100644 --- a/static_core/plugins/ets/tests/ets-common-tests/intrinsics/isSafeInteger.ets +++ b/static_core/plugins/ets/tests/ets-common-tests/intrinsics/isSafeInteger.ets @@ -26,7 +26,7 @@ class IsIntegerDoubleTest { function main(): int { let ft = new IsIntegerFloatTest(); ft.safeInteger = 1.0f; - ft.unsafeInteger = 1.0 as float + Float.MAX_SAFE_INTEGER; + ft.unsafeInteger = 1.0f + Float.MAX_SAFE_INTEGER; if (Float.isSafeInteger(Float.NaN) != false) { return 1; diff --git a/static_core/plugins/ets/tests/ets-common-tests/intrinsics/max.ets b/static_core/plugins/ets/tests/ets-common-tests/intrinsics/max.ets index 65f996d1133e05757e5685cacd4201c89e0d53f0..6e9200fc2787dc501c5fbfebcdf2d39a033ef4c2 100644 --- a/static_core/plugins/ets/tests/ets-common-tests/intrinsics/max.ets +++ b/static_core/plugins/ets/tests/ets-common-tests/intrinsics/max.ets @@ -58,22 +58,22 @@ function main() : int { if (max(Float.MAX_VALUE, Float.NEGATIVE_INFINITY) != Float.MAX_VALUE) { return 22; } - if (max(0.0 as float, Float.NEGATIVE_INFINITY) != 0) { + if (max(0.0f, Float.NEGATIVE_INFINITY) != 0) { return 23; } - if (max(0.0 as float, Float.MIN_VALUE) != Float.MIN_VALUE) { + if (max(0.0f, Float.MIN_VALUE) != Float.MIN_VALUE) { return 24; } if (max(Float.MAX_VALUE, Float.MIN_VALUE) != Float.MAX_VALUE) { return 25; } - if (max(0.0 as float, 2.0 as float) != 2.0 as float) { + if (max(0.0f, 2.0f) != 2.0f) { return 26; } - if (max(0.0 as float, -4.0 as float) != 0.0 as float) { + if (max((0.0).toFloat(), (-4.0).toFloat()) != (0.0).toFloat()) { return 27; } - if (max(1.e-10 as float, 2.e+12 as float) != 2.e+12 as float) { + if (max((1.e-10).toFloat(), (2.e+12).toFloat()) != (2.e+12).toFloat()) { return 28; } diff --git a/static_core/plugins/ets/tests/ets-common-tests/intrinsics/min.ets b/static_core/plugins/ets/tests/ets-common-tests/intrinsics/min.ets index e44eaf6a839b458ce078ea0a62f54200750b8457..52f0319a138a566e9c04dc1a990775e57a9b8fcb 100644 --- a/static_core/plugins/ets/tests/ets-common-tests/intrinsics/min.ets +++ b/static_core/plugins/ets/tests/ets-common-tests/intrinsics/min.ets @@ -58,22 +58,22 @@ function main() : int { if (min(Float.MAX_VALUE, Float.NEGATIVE_INFINITY) != Float.NEGATIVE_INFINITY) { return 22; } - if (min(0.0 as float, Float.NEGATIVE_INFINITY) != Float.NEGATIVE_INFINITY) { + if (min(0.0f, Float.NEGATIVE_INFINITY) != Float.NEGATIVE_INFINITY) { return 23; } - if (min(0.0 as float, Float.MIN_VALUE) != 0.0 as float) { + if (min(0.0f, Float.MIN_VALUE) != 0.0f) { return 24; } if (min(Float.MAX_VALUE, Float.MIN_VALUE) != Float.MIN_VALUE) { return 25; } - if (min(0.0 as float, 2.0 as float) != 0.0 as float) { + if (min(0.0f, 2.0f) != 0.0f) { return 26; } - if (min(0.0 as float, -4.0 as float) != -4.0 as float) { + if (min((0.0).toFloat(), (-4.0).toFloat()) != (-4.0).toFloat()) { return 27; } - if (min(1.e-10 as float, 2.e+12 as float) != 1.e-10 as float) { + if (min((1.e-10).toFloat(), (2.e+12).toFloat()) != (1.e-10).toFloat()) { return 28; } diff --git a/static_core/plugins/ets/tests/ets-common-tests/intrinsics/to_string_cache.ets b/static_core/plugins/ets/tests/ets-common-tests/intrinsics/to_string_cache.ets index ca10a2e9a8b14d82f492a447cdbe09cfa4c6222f..be411c3773d6f5afb5eeb1f07c18351c8be5cbfd 100644 --- a/static_core/plugins/ets/tests/ets-common-tests/intrinsics/to_string_cache.ets +++ b/static_core/plugins/ets/tests/ets-common-tests/intrinsics/to_string_cache.ets @@ -44,7 +44,7 @@ function parseLong(s: String): long|null { if (!Char.isDecDigit(ch)) { return null; } - let digit = (ch.toInt() - Char.toInt(c'0')) as int; + let digit = (ch.toInt() - Char.toInt(c'0')).toInt(); if (negative) { if (result < (Long.MIN_VALUE + digit) / 10) { return null; @@ -89,8 +89,8 @@ function isEqual(s: String, number: T): boolean { if (Float.isNaN(number)) { return s == 'NaN'; } - let eps: float = Math.abs(number.toFloat()) * 2 * Float.EPSILON as float; - let parsed = Double.parseFloat(s) as float; + let eps: float = (Math.abs(number.toFloat()) * 2 * Float.EPSILON).toFloat(); + let parsed = Double.parseFloat(s).toFloat(); let delta: float = parsed - number.toFloat(); if (Math.abs(delta) > eps) { console.println(`float parsed: ${parsed}, bitCastToInt: ${Float.bitCastToInt(parsed as float)} eps: ${eps} delta: ${delta}`) @@ -114,7 +114,7 @@ class Worker { let numbers = new Array; for (let i = 0; i < iters; i++) { state = xorshift(state); - let randomInt = (state >>> 33) as int; + let randomInt = (state >>> 33).toInt(); let index = randomInt % this.values.length; let value = this.values[index]!; let str = (value as object).toString(); @@ -143,7 +143,7 @@ const iterCount = valueCount * 3; function doTest(values: T[], workers: int) { let jobs = new (Job | undefined)[workers]; for (let i = 0; i < workers; i++) { - let state = (i as long * 1234567) | 42; + let state = (i.toLong() * 1234567) | 42; // check only in one worker to make others faster let check = i == 0; let worker = new Worker(values); @@ -162,7 +162,7 @@ function testDoubles() { // console.println('testDoubles') let values = new Double[valueCount]; for (let i = 0; i < valueCount; i++) { - let exp = (Math.random() * 2 - 1) * 310 as int + let exp = (Math.random() * 2 - 1) * (310).toInt() values[i] = Math.random() * Math.pow(10, exp); } doTest(values, workerCount); @@ -183,8 +183,8 @@ function testFloats() { // console.println('testFloats'); let values = new Float[valueCount]; for (let i = 0; i < valueCount; i++) { - let exp = (Math.random() * 2 - 1) * 39 as int - values[i] = Math.random() * Math.pow(10, exp) as float; + let exp = (Math.random() * 2 - 1) * (39).toInt() + values[i] = (Math.random() * Math.pow(10, exp)).toFloat(); } doTest(values, workerCount); } @@ -195,7 +195,7 @@ function testFloatsBitcast() { let state = 42 as long; for (let i = 0; i < valueCount; i++) { state = xorshift(state); - values[i] = Float.bitCastFromInt(state as int); + values[i] = Float.bitCastFromInt(state.toInt()); } doTest(values, workerCount); } diff --git a/static_core/plugins/ets/tests/ets-templates/03.types/06.value_types/01.numeric_types/hier1.params.yaml b/static_core/plugins/ets/tests/ets-templates/03.types/06.value_types/01.numeric_types/hier1.params.yaml index 526e7fa80b1beeda8d38081c761f1183a5d50da0..43a0a7400320bebf0cb253b91febf1101c6b3ba0 100644 --- a/static_core/plugins/ets/tests/ets-templates/03.types/06.value_types/01.numeric_types/hier1.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/03.types/06.value_types/01.numeric_types/hier1.params.yaml @@ -57,7 +57,7 @@ cases: - { op: '<<=', val: 1280 } - { op: '>>=', val: 0 } - { op: '>>>=', val: 0 } - - lg: 'float = 16.0 as float' + - lg: 'float = 16.0f' sm: 'byte = 4 as byte' ops: - { op: '=', val: 4 } @@ -106,7 +106,7 @@ cases: - { op: '<<=', val: 1280 } - { op: '>>=', val: 0 } - { op: '>>>=', val: 0 } - - lg: 'float = 16.0 as float' + - lg: 'float = 16.0f' sm: 'short = 4 as short' ops: - { op: '=', val: 4 } @@ -140,7 +140,7 @@ cases: - { op: '<<=', val: 1280 } - { op: '>>=', val: 0 } - { op: '>>>=', val: 0 } - - lg: 'float = 16.0 as float' + - lg: 'float = 16.0f' sm: 'int = 4 as int' ops: - { op: '=', val: 4 } @@ -159,7 +159,7 @@ cases: - { op: '/=', val: 4 } - { op: '%=', val: 0 } - - lg: 'float = 16.0 as float' + - lg: 'float = 16.0f' sm: 'long = 4 as long' ops: - { op: '=', val: 4 } @@ -179,7 +179,7 @@ cases: - { op: '%=', val: 0 } - lg: 'double = 16.0 as double' - sm: 'float = 4 as float' + sm: 'float = 4.0f' ops: - { op: '=', val: 4 } - { op: '+=', val: 20 } diff --git a/static_core/plugins/ets/tests/ets-templates/03.types/06.value_types/03.floating-point_types_and_operations/equal/equal_float.params.yaml b/static_core/plugins/ets/tests/ets-templates/03.types/06.value_types/03.floating-point_types_and_operations/equal/equal_float.params.yaml index 0549b606a867492980248cdfd9b2394f6d67bb19..7f3db8e58744c24b3dba0de0ef45d480224279a8 100644 --- a/static_core/plugins/ets/tests/ets-templates/03.types/06.value_types/03.floating-point_types_and_operations/equal/equal_float.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/03.types/06.value_types/03.floating-point_types_and_operations/equal/equal_float.params.yaml @@ -3,7 +3,7 @@ # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0f # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, diff --git a/static_core/plugins/ets/tests/ets-templates/03.types/06.value_types/03.floating-point_types_and_operations/greater_or_equal/greater_or_equal_float.params.yaml b/static_core/plugins/ets/tests/ets-templates/03.types/06.value_types/03.floating-point_types_and_operations/greater_or_equal/greater_or_equal_float.params.yaml index 7f32c51661071d2260979878e36c675a97ec102f..98f925e3c12c02b78252f4eab8708f544c5cb65e 100644 --- a/static_core/plugins/ets/tests/ets-templates/03.types/06.value_types/03.floating-point_types_and_operations/greater_or_equal/greater_or_equal_float.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/03.types/06.value_types/03.floating-point_types_and_operations/greater_or_equal/greater_or_equal_float.params.yaml @@ -1,9 +1,9 @@ # Copyright (c) 2021-2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); +# Licensed under the Apache License, Version 2.0f (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0f # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, diff --git a/static_core/plugins/ets/tests/ets-templates/03.types/06.value_types/03.floating-point_types_and_operations/greater_than/greater_than_float.params.yaml b/static_core/plugins/ets/tests/ets-templates/03.types/06.value_types/03.floating-point_types_and_operations/greater_than/greater_than_float.params.yaml index d796a8887bad64a105b36964e59dafe2673491b3..e200d0fad099ed809ca1b17b811f50bdab7b0667 100644 --- a/static_core/plugins/ets/tests/ets-templates/03.types/06.value_types/03.floating-point_types_and_operations/greater_than/greater_than_float.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/03.types/06.value_types/03.floating-point_types_and_operations/greater_than/greater_than_float.params.yaml @@ -1,9 +1,9 @@ # Copyright (c) 2021-2024 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); +# Licensed under the Apache License, Version 2.0f (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0f # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, diff --git a/static_core/plugins/ets/tests/ets-templates/03.types/06.value_types/03.floating-point_types_and_operations/less_or_equal/less_or_equal_float.params.yaml b/static_core/plugins/ets/tests/ets-templates/03.types/06.value_types/03.floating-point_types_and_operations/less_or_equal/less_or_equal_float.params.yaml index 315dbc5e7d100e038ab40b8a2bcf1923a69b9bf8..e1d033247c5b1173ba19a7ca5f77e2de997f841a 100644 --- a/static_core/plugins/ets/tests/ets-templates/03.types/06.value_types/03.floating-point_types_and_operations/less_or_equal/less_or_equal_float.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/03.types/06.value_types/03.floating-point_types_and_operations/less_or_equal/less_or_equal_float.params.yaml @@ -3,7 +3,7 @@ # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0f # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, diff --git a/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/04.accessible/type_name_class_field.ets b/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/04.accessible/type_name_class_field.ets index 63c018c8ef633d148b9eceacdd70be9ee5bea624..168ef6f97c51c318358a5b7c0cf7434ab52e5399 100644 --- a/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/04.accessible/type_name_class_field.ets +++ b/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/04.accessible/type_name_class_field.ets @@ -27,7 +27,7 @@ desc: >- {{c.decl}} class A { - {{c.field}} + {{c.field|indent}} bar(i: T): T { return i; } diff --git a/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/07.function_declarations/04.optional_parameters/opt_param.params.yaml b/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/07.function_declarations/04.optional_parameters/opt_param.params.yaml index a05220a6dafc6eb925bacf367b4fa655d12f0290..fc7df5767ec787b388a3bc66abc94ebe5ee85222 100644 --- a/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/07.function_declarations/04.optional_parameters/opt_param.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/07.function_declarations/04.optional_parameters/opt_param.params.yaml @@ -25,7 +25,7 @@ cases: - decl: |- // check primitive defaults - function foo(a: byte = 1, b: short = 2, c: int = 3, d: long = 4, e: float = 5.0, f: double = 6.0, g: boolean = true, h: char = c'W') { + function foo(a: byte = 1, b: short = 2, c: int = 3, d: long = 4, e: float = 5.0f, f: double = 6.0, g: boolean = true, h: char = c'W') { arktest.assertEQ( a, 1 ) arktest.assertEQ( b, 2 ) arktest.assertEQ( c, 3 ) diff --git a/static_core/plugins/ets/tests/ets-templates/05.generics/01.type_parameters/01.type_parameter_constraint/generic_functions/generic_function_constraint.params.yaml b/static_core/plugins/ets/tests/ets-templates/05.generics/01.type_parameters/01.type_parameter_constraint/generic_functions/generic_function_constraint.params.yaml index fa65e2b08b1abec3370a9ed87f641d223e45c089..5da372bca43db46a67a3961357b169055004c835 100644 --- a/static_core/plugins/ets/tests/ets-templates/05.generics/01.type_parameters/01.type_parameter_constraint/generic_functions/generic_function_constraint.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/05.generics/01.type_parameters/01.type_parameter_constraint/generic_functions/generic_function_constraint.params.yaml @@ -36,7 +36,7 @@ constraints: p: 1 as long - type: float use: float - p: 1.1.toFloat() + p: 1.1f - type: double use: double p: 1.2 as double diff --git a/static_core/plugins/ets/tests/ets-templates/05.generics/01.type_parameters/01.type_parameter_constraint/generic_methods/generic_method_with_body_constraint.params.yaml b/static_core/plugins/ets/tests/ets-templates/05.generics/01.type_parameters/01.type_parameter_constraint/generic_methods/generic_method_with_body_constraint.params.yaml index 2757a091b194e6b2fd86293911561111eace99f4..311a55b18ee0499fdc2ab87c4f517aff4381842f 100644 --- a/static_core/plugins/ets/tests/ets-templates/05.generics/01.type_parameters/01.type_parameter_constraint/generic_methods/generic_method_with_body_constraint.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/05.generics/01.type_parameters/01.type_parameter_constraint/generic_methods/generic_method_with_body_constraint.params.yaml @@ -50,8 +50,8 @@ constraints: expected: 1 as long - type: float use: float - p: 1.1.toFloat() - expected: 1.1.toFloat() + p: 1.1f + expected: 1.1f - type: double use: double p: 1.2 as double diff --git a/static_core/plugins/ets/tests/ets-templates/06.contexts_and_conversions/05.implicit_conversions/01.widening_numeric_conversions/decl_const/decl-const-n.params.yaml b/static_core/plugins/ets/tests/ets-templates/06.contexts_and_conversions/05.implicit_conversions/01.widening_numeric_conversions/decl_const/decl-const-n.params.yaml index 24e5c77a82de390afea8244cd42c4c1b0b878624..b8697c1124c5eb5ecc927e2261c13cf0d945416e 100644 --- a/static_core/plugins/ets/tests/ets-templates/06.contexts_and_conversions/05.implicit_conversions/01.widening_numeric_conversions/decl_const/decl-const-n.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/06.contexts_and_conversions/05.implicit_conversions/01.widening_numeric_conversions/decl_const/decl-const-n.params.yaml @@ -36,10 +36,10 @@ cases: - { from_type: long, expr: 0 as long, to_type: Color } # from float - - { from_type: float, expr: +0.0.toFloat(), to_type: byte } - - { from_type: float, expr: +0.0.toFloat(), to_type: short } - - { from_type: float, expr: +0.0.toFloat(), to_type: int } - - { from_type: float, expr: +0.0.toFloat(), to_type: long } - - { from_type: float, expr: +0.0.toFloat(), to_type: boolean } - - { from_type: float, expr: +0.0.toFloat(), to_type: Color } + - { from_type: float, expr: +0.0f, to_type: byte } + - { from_type: float, expr: +0.0f, to_type: short } + - { from_type: float, expr: +0.0f, to_type: int } + - { from_type: float, expr: +0.0f, to_type: long } + - { from_type: float, expr: +0.0f, to_type: boolean } + - { from_type: float, expr: +0.0f, to_type: Color } diff --git a/static_core/plugins/ets/tests/ets-templates/06.contexts_and_conversions/05.implicit_conversions/01.widening_numeric_conversions/decl_var/decl-var-n.params.yaml b/static_core/plugins/ets/tests/ets-templates/06.contexts_and_conversions/05.implicit_conversions/01.widening_numeric_conversions/decl_var/decl-var-n.params.yaml index 24e5c77a82de390afea8244cd42c4c1b0b878624..b8697c1124c5eb5ecc927e2261c13cf0d945416e 100644 --- a/static_core/plugins/ets/tests/ets-templates/06.contexts_and_conversions/05.implicit_conversions/01.widening_numeric_conversions/decl_var/decl-var-n.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/06.contexts_and_conversions/05.implicit_conversions/01.widening_numeric_conversions/decl_var/decl-var-n.params.yaml @@ -36,10 +36,10 @@ cases: - { from_type: long, expr: 0 as long, to_type: Color } # from float - - { from_type: float, expr: +0.0.toFloat(), to_type: byte } - - { from_type: float, expr: +0.0.toFloat(), to_type: short } - - { from_type: float, expr: +0.0.toFloat(), to_type: int } - - { from_type: float, expr: +0.0.toFloat(), to_type: long } - - { from_type: float, expr: +0.0.toFloat(), to_type: boolean } - - { from_type: float, expr: +0.0.toFloat(), to_type: Color } + - { from_type: float, expr: +0.0f, to_type: byte } + - { from_type: float, expr: +0.0f, to_type: short } + - { from_type: float, expr: +0.0f, to_type: int } + - { from_type: float, expr: +0.0f, to_type: long } + - { from_type: float, expr: +0.0f, to_type: boolean } + - { from_type: float, expr: +0.0f, to_type: Color } diff --git a/static_core/plugins/ets/tests/ets-templates/07.expressions/04.array_literal/02.type_inference_from_types_of_elements/arr_inf2_num2.params.yaml b/static_core/plugins/ets/tests/ets-templates/07.expressions/04.array_literal/02.type_inference_from_types_of_elements/arr_inf2_num2.params.yaml index f679c762eee46865bac89308129b68620754d130..e172d3d89e3d5e48a0610051432fd6b10c823ada 100644 --- a/static_core/plugins/ets/tests/ets-templates/07.expressions/04.array_literal/02.type_inference_from_types_of_elements/arr_inf2_num2.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/07.expressions/04.array_literal/02.type_inference_from_types_of_elements/arr_inf2_num2.params.yaml @@ -22,12 +22,12 @@ cases: - val: '[[0.0f, 2.0]]' # primitives - - { val: '[[0b1.toByte()]]', type: byte } - - { val: '[[0xF.toShort()]]', type: short} - - { val: '[[0o7.toInt()]]', type: int } - - { val: '[[new Long(-9223372036854775807)]]', type: long } - - { val: '[[111e11.toFloat()]]', type: float } - - { val: '[[222e22.toDouble()]]', type: number } + - { val: '[[0b1 as byte]]', type: byte } + - { val: '[[0xF as short]]', type: short} + - { val: '[[0o7 as int]]', type: int } + - { val: '[[-9223372036854775807 as long]]', type: long } + - { val: '[[(111e11).toFloat()]]', type: float } + - { val: '[[222e22 as double]]', type: number } - { val: '[[11111111111n]]', type: BigInt } # boxed diff --git a/static_core/plugins/ets/tests/ets-templates/07.expressions/25.equality_expressions/bigint_equality_operators/eq.params.yaml b/static_core/plugins/ets/tests/ets-templates/07.expressions/25.equality_expressions/bigint_equality_operators/eq.params.yaml index a0a976881812688a64ae0597a78a15e2c98700e2..d7ee835205a5f8d9185b40e5c296a907c957fc98 100644 --- a/static_core/plugins/ets/tests/ets-templates/07.expressions/25.equality_expressions/bigint_equality_operators/eq.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/07.expressions/25.equality_expressions/bigint_equality_operators/eq.params.yaml @@ -99,7 +99,7 @@ cases: - new BigInt(9007199254.740991e6) - values: - new BigInt(9007199254.740991e6) - - new BigInt(9007199254740991 as long) + - new BigInt((9007199254740991).toLong()) - values: - 9007199254740990n # max safe integer in double - 1 - new BigInt(new BigInt(9007199254740990.0)) @@ -117,7 +117,7 @@ cases: - new BigInt(-0.9007199254740989e16) - values: - new BigInt(-0.9007199254740989e16) - - new BigInt(-9007199254740989 as long) + - new BigInt((-9007199254740989).toLong()) # from bigint - values: - 94876543875610289630n diff --git a/static_core/plugins/ets/tests/ets-templates/07.expressions/25.equality_expressions/bigint_equality_operators/ne1.params.yaml b/static_core/plugins/ets/tests/ets-templates/07.expressions/25.equality_expressions/bigint_equality_operators/ne1.params.yaml index a0a976881812688a64ae0597a78a15e2c98700e2..d7ee835205a5f8d9185b40e5c296a907c957fc98 100644 --- a/static_core/plugins/ets/tests/ets-templates/07.expressions/25.equality_expressions/bigint_equality_operators/ne1.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/07.expressions/25.equality_expressions/bigint_equality_operators/ne1.params.yaml @@ -99,7 +99,7 @@ cases: - new BigInt(9007199254.740991e6) - values: - new BigInt(9007199254.740991e6) - - new BigInt(9007199254740991 as long) + - new BigInt((9007199254740991).toLong()) - values: - 9007199254740990n # max safe integer in double - 1 - new BigInt(new BigInt(9007199254740990.0)) @@ -117,7 +117,7 @@ cases: - new BigInt(-0.9007199254740989e16) - values: - new BigInt(-0.9007199254740989e16) - - new BigInt(-9007199254740989 as long) + - new BigInt((-9007199254740989).toLong()) # from bigint - values: - 94876543875610289630n diff --git a/static_core/plugins/ets/tests/ets-templates/07.expressions/25.equality_expressions/bigint_equality_operators/ne2.params.yaml b/static_core/plugins/ets/tests/ets-templates/07.expressions/25.equality_expressions/bigint_equality_operators/ne2.params.yaml index a0a976881812688a64ae0597a78a15e2c98700e2..d7ee835205a5f8d9185b40e5c296a907c957fc98 100644 --- a/static_core/plugins/ets/tests/ets-templates/07.expressions/25.equality_expressions/bigint_equality_operators/ne2.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/07.expressions/25.equality_expressions/bigint_equality_operators/ne2.params.yaml @@ -99,7 +99,7 @@ cases: - new BigInt(9007199254.740991e6) - values: - new BigInt(9007199254.740991e6) - - new BigInt(9007199254740991 as long) + - new BigInt((9007199254740991).toLong()) - values: - 9007199254740990n # max safe integer in double - 1 - new BigInt(new BigInt(9007199254740990.0)) @@ -117,7 +117,7 @@ cases: - new BigInt(-0.9007199254740989e16) - values: - new BigInt(-0.9007199254740989e16) - - new BigInt(-9007199254740989 as long) + - new BigInt((-9007199254740989).toLong()) # from bigint - values: - 94876543875610289630n diff --git a/static_core/plugins/ets/tests/ets-templates/07.expressions/31.string_interpolation_expressions/siexp.params.yaml b/static_core/plugins/ets/tests/ets-templates/07.expressions/31.string_interpolation_expressions/siexp.params.yaml index 8c47cbe33d151e8814a05955280eda863ab4ad3b..1550561a1fa52af4551795cc62c55892966030eb 100644 --- a/static_core/plugins/ets/tests/ets-templates/07.expressions/31.string_interpolation_expressions/siexp.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/07.expressions/31.string_interpolation_expressions/siexp.params.yaml @@ -14,19 +14,19 @@ cases: - use: |- const b1: byte = Byte.MIN_VALUE - const b2: byte = 0 as byte + const b2: byte = (0).toByte() const b3: byte = Byte.MAX_VALUE const s1: short = Short.MIN_VALUE - const s2: short = 0 as short + const s2: short = (0).toShort() const s3: short = Short.MAX_VALUE const i1: int = Int.MIN_VALUE - const i2: int = 0 as int + const i2: int = (0).toInt() const i3: int = Int.MAX_VALUE const l1: long = Long.MIN_VALUE - const l2: long = 0 as long + const l2: long = (0).toLong() const l3: long = Long.MAX_VALUE const f1: float = Float.MIN_VALUE - const f2: float = 0.0.toFloat() + const f2: float = 0.0f const f3: float = Float.MAX_VALUE const n1: number = Number.MIN_VALUE const n2: number = 0.0 @@ -37,19 +37,19 @@ cases: - use: |- const b1: Byte = Byte.MIN_VALUE - const b2: Byte = 0 as byte + const b2: Byte = (0).toByte() const b3: Byte = Byte.MAX_VALUE const s1: Short = Short.MIN_VALUE - const s2: Short = 0 as short + const s2: Short = (0).toShort() const s3: Short = Short.MAX_VALUE const i1: Int = Int.MIN_VALUE - const i2: Int = 0 as int + const i2: Int = (0).toInt() const i3: Int = Int.MAX_VALUE const l1: Long = Long.MIN_VALUE - const l2: Long = 0 as long + const l2: Long = (0).toLong() const l3: Long = Long.MAX_VALUE const f1: Float = Float.MIN_VALUE - const f2: Float = 0.0.toFloat() + const f2: Float = 0.0f const f3: Float = Float.MAX_VALUE const n1: Number = Number.MIN_VALUE const n2: Number = 0.0 diff --git a/static_core/plugins/ets/tests/ets-templates/07.expressions/33.constant_expression/check_array/constant_bitwise_expression.params.yaml b/static_core/plugins/ets/tests/ets-templates/07.expressions/33.constant_expression/check_array/constant_bitwise_expression.params.yaml index f7570ed7961928120ddf9f6bd74cf54417bc232f..9af9317f65b777680e9d1ab283d0006286504cd5 100644 --- a/static_core/plugins/ets/tests/ets-templates/07.expressions/33.constant_expression/check_array/constant_bitwise_expression.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/07.expressions/33.constant_expression/check_array/constant_bitwise_expression.params.yaml @@ -22,10 +22,10 @@ cases: - { type: int, value: 10, expression: '& 7', expected: 2 } - { type: int, value: 10, expression: '| 7', expected: 15 } - - { type: int, value: 10, expression: '^ 7', expected: 13 } + - { type: int, value: (10).toInt(), expression: '^ 7', expected: 13 } - - { type: long, value: 10, expression: '& 7', expected: 2 } - - { type: long, value: 10, expression: '| 7', expected: 15 } + - { type: long, value: (10).toLong(), expression: '& 7', expected: 2 } + - { type: long, value: (10).toLong(), expression: '| 7', expected: 15 } - { type: long, value: 10, expression: '^ 7', expected: 13 } - { type: float, value: 10.5f, expression: '& 7.0f', expected: 2 } diff --git a/static_core/plugins/ets/tests/ets-templates/07.expressions/33.constant_expression/check_array/constant_logical_expression.params.yaml b/static_core/plugins/ets/tests/ets-templates/07.expressions/33.constant_expression/check_array/constant_logical_expression.params.yaml index 6d0d12c256e02f906749ab700547a1bd4b46ef40..c84ce4b70b0fd5ef1198aa7285a7f7a2cc900059 100644 --- a/static_core/plugins/ets/tests/ets-templates/07.expressions/33.constant_expression/check_array/constant_logical_expression.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/07.expressions/33.constant_expression/check_array/constant_logical_expression.params.yaml @@ -12,19 +12,19 @@ # limitations under the License. --- cases: - - { type: byte, value: 10, expression: '< 12', expected: 10 } - - { type: byte, value: 10, expression: '< 12.0f', expected: 10 } - - { type: short, value: 10, expression: '< 12', expected: 10 } - - { type: short, value: 10, expression: '< 12.0f', expected: 10 } - + - { type: byte, value: (10).toByte(), expression: '< 12', expected: 10 } + - { type: byte, value: (10).toByte(), expression: '< 12.0f', expected: 10 } + - { type: short, value: (10).toByte(), expression: '< 12', expected: 10 } + - { type: short, value: (10).toByte(), expression: '< 12.0f', expected: 10 } + - { type: short, value: 260, expression: '<= 25', expected: 285 } - { type: int, value: 30, expression: '>= -30', expected: 30 } - - { type: long, value: 260, expression: '== 259', expected: 285 } + - { type: long, value: (260).toLong(), expression: '== 259', expected: 285 } - { type: float, value: 26.0f, expression: '== 26.0f', expected: 26 } - { type: number, value: 27.0, expression: '== 27', expected: 27 } - { type: number, value: 28.3, expression: '== 28.3', expected: 28 } - { type: float, value: 21.7f, expression: '== 21.7f', expected: 21 } - - { type: number, value: 22.3, expression: '== 22.3', expected: 22 } + - { type: number, value: 22.3f, expression: '== 22.3f', expected: 22 } - { type: char, value: c'p', expression: '== 112', expected: 112 } - { type: char, value: c'p', expression: '> 100', expected: 112 } diff --git a/static_core/plugins/ets/tests/ets-templates/07.expressions/33.constant_expression/check_array/constant_shift.params.yaml b/static_core/plugins/ets/tests/ets-templates/07.expressions/33.constant_expression/check_array/constant_shift.params.yaml index 928ecdf165cf0fc20ab601b3a249afbdaa87d238..9a4f68ab7413b536752ac6c52d6ea002c60ef530 100644 --- a/static_core/plugins/ets/tests/ets-templates/07.expressions/33.constant_expression/check_array/constant_shift.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/07.expressions/33.constant_expression/check_array/constant_shift.params.yaml @@ -24,9 +24,9 @@ cases: - { type: int, value: 38, sign: '>>', expected: 4 } - { type: int, value: 38, sign: '>>>', expected: 4 } - - { type: long, value: 46, sign: '<<', expected: 368 } - - { type: long, value: 46, sign: '>>', expected: 5 } - - { type: long, value: 46, sign: '>>>', expected: 5 } + - { type: long, value: (46).toLong(), sign: '<<', expected: 368 } + - { type: long, value: (46).toLong(), sign: '>>', expected: 5 } + - { type: long, value: (46).toLong(), sign: '>>>', expected: 5 } - { type: float, value: 53.2f, sign: '<<', expected: 424 } - { type: float, value: 53.2f, sign: '>>', expected: 6 } diff --git a/static_core/plugins/ets/tests/ets-templates/15.semantic_rules/10.overloading/single_class_overload_n.params.yaml b/static_core/plugins/ets/tests/ets-templates/15.semantic_rules/10.overloading/single_class_overload_n.params.yaml index 6e78d1d449b2f56c5f4b1f58bfa6f680cff421d4..7cc68d7f7797613680544d496711aff224b5a06c 100644 --- a/static_core/plugins/ets/tests/ets-templates/15.semantic_rules/10.overloading/single_class_overload_n.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/15.semantic_rules/10.overloading/single_class_overload_n.params.yaml @@ -34,31 +34,31 @@ cases: new Base(); arktest.assertEQ( res, 1); - new Base(1 as short); + new Base((1).toShort()); arktest.assertEQ( res, 2); new Base(new Short()); arktest.assertEQ( res, 2); - new Base(1 as int); + new Base((1).toInt()); arktest.assertEQ( res, 4); new Base(new Int()); arktest.assertEQ( res, 4); - new Base(1 as long); + new Base((1).toLong()); arktest.assertEQ( res, 6); new Base(new Long()); arktest.assertEQ( res, 6); - new Base(1.1.toFloat()); + new Base((1.1).toFloat()); arktest.assertEQ( res, 8); new Base(new Float()); arktest.assertEQ( res, 8); - new Base(1.2 as double); + new Base(1.2); arktest.assertEQ( res, 10); new Base(new Number()); @@ -73,7 +73,7 @@ cases: new Base("some str"); arktest.assertEQ( res, 14); - new Base(1 as byte); + new Base((1).toByte()); arktest.assertEQ( res, 15); new Base(new Byte()); @@ -85,7 +85,7 @@ cases: new Base(new Boolean()); arktest.assertEQ( res, 17); - new Base(1 as int, 1 as int); + new Base((1).toInt(), (1).toInt()); arktest.assertEQ( res, 19); new Base(new Gen()); @@ -103,7 +103,7 @@ cases: new Base(1.1 as number, new Number()); arktest.assertEQ( res, 23); - new Base(new Number(), 1.1 as number); + new Base(new Number(), 1.1); arktest.assertEQ( res, 23); - tags: negative, compile-only @@ -152,31 +152,31 @@ cases: a.foo(); arktest.assertEQ( res, 1); - a.foo(1 as short); + a.foo((1).toShort()); arktest.assertEQ( res, 2); a.foo(new Short()); arktest.assertEQ( res, 2); - a.foo(1 as int); + a.foo((1).toInt()); arktest.assertEQ( res, 4); a.foo(new Int()); arktest.assertEQ( res, 4); - a.foo(1 as long); + a.foo((1).toLong()); arktest.assertEQ( res, 6); a.foo(new Long()); arktest.assertEQ( res, 6); - a.foo(1.1.toFloat()); + a.foo((1.1).toFloat()); arktest.assertEQ( res, 8); a.foo(new Float()); arktest.assertEQ( res, 8); - a.foo(1.2 as double); + a.foo(1.2); arktest.assertEQ( res, 10); a.foo(new Number()); @@ -191,7 +191,7 @@ cases: a.foo("some str"); arktest.assertEQ( res, 14); - a.foo(1 as byte); + a.foo((1).toByte()); arktest.assertEQ( res, 15); a.foo(new Byte()); @@ -203,7 +203,7 @@ cases: a.foo(new Boolean()); arktest.assertEQ( res, 17); - a.foo(1 as int, 1 as int); + a.foo((1).toInt(), (1).toInt()); arktest.assertEQ( res, 19); a.foo(new Gen()); @@ -269,31 +269,31 @@ cases: Base.foo(); arktest.assertEQ( res, 1); - Base.foo(1 as short); + Base.foo((1).toShort()); arktest.assertEQ( res, 2); Base.foo(new Short()); arktest.assertEQ( res, 2); - Base.foo(1 as int); + Base.foo((1).toInt()); arktest.assertEQ( res, 4); Base.foo(new Int()); arktest.assertEQ( res, 4); - Base.foo(1 as long); + Base.foo((1).toLong()); arktest.assertEQ( res, 6); Base.foo(new Long()); arktest.assertEQ( res, 6); - Base.foo(1.1.toFloat()); + Base.foo((1.1).toFloat()); arktest.assertEQ( res, 8); Base.foo(new Float()); arktest.assertEQ( res, 8); - Base.foo(1.2 as double); + Base.foo(1.2); arktest.assertEQ( res, 10); Base.foo(new Number()); @@ -308,7 +308,7 @@ cases: Base.foo("some str"); arktest.assertEQ( res, 14); - Base.foo(1 as byte); + Base.foo((1).toByte()); arktest.assertEQ( res, 15); Base.foo(new Byte()); @@ -320,7 +320,7 @@ cases: Base.foo(new Boolean()); arktest.assertEQ( res, 17); - Base.foo(1 as int, 1 as int); + Base.foo((1).toInt(), (1).toInt()); arktest.assertEQ( res, 19); Base.foo(undefined); diff --git a/static_core/plugins/ets/tests/ets-templates/15.semantic_rules/14.compatibility_features/01.extended_conditional_expressions/cond_t1.params.yaml b/static_core/plugins/ets/tests/ets-templates/15.semantic_rules/14.compatibility_features/01.extended_conditional_expressions/cond_t1.params.yaml index 150aa8f160830556b02977ced4849dc7c9c68b33..44ca0e6137ad953dfb17e1c6529a37c8622a9c89 100644 --- a/static_core/plugins/ets/tests/ets-templates/15.semantic_rules/14.compatibility_features/01.extended_conditional_expressions/cond_t1.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/15.semantic_rules/14.compatibility_features/01.extended_conditional_expressions/cond_t1.params.yaml @@ -50,7 +50,7 @@ cases: - new Byte(11) - new Short(1111) - new Int(111111) - - new Float(11111111.0) + - new Float(11111111.0f) - new Double(1111111111.0) - new Number(1e33 as number) diff --git a/static_core/plugins/ets/tests/ets-templates/15.semantic_rules/14.compatibility_features/01.extended_conditional_expressions/cond_t2.params.yaml b/static_core/plugins/ets/tests/ets-templates/15.semantic_rules/14.compatibility_features/01.extended_conditional_expressions/cond_t2.params.yaml index 75e7f29453f6a98fec462041445cce06beaa3587..43245b4b452eb0976326de1c5818b493d43a09d1 100644 --- a/static_core/plugins/ets/tests/ets-templates/15.semantic_rules/14.compatibility_features/01.extended_conditional_expressions/cond_t2.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/15.semantic_rules/14.compatibility_features/01.extended_conditional_expressions/cond_t2.params.yaml @@ -13,8 +13,8 @@ --- # truthy values cases: - - { val: '0x80.toByte()', type: 'byte' } - - { val: '0x8000.toShort()', type: 'short' } + - { val: '(0x80).toByte()', type: 'byte' } + - { val: '(0x8000).toShort()', type: 'short' } - { val: '0x80000000', type: 'int' } - { val: '0x8000000000000000.toLong()', type: 'long' } - { val: '0.000001f', type: 'float' } diff --git a/static_core/plugins/ets/tests/ets-templates/15.semantic_rules/14.compatibility_features/01.extended_conditional_expressions/do_t.params.yaml b/static_core/plugins/ets/tests/ets-templates/15.semantic_rules/14.compatibility_features/01.extended_conditional_expressions/do_t.params.yaml index 75e7f29453f6a98fec462041445cce06beaa3587..43245b4b452eb0976326de1c5818b493d43a09d1 100644 --- a/static_core/plugins/ets/tests/ets-templates/15.semantic_rules/14.compatibility_features/01.extended_conditional_expressions/do_t.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/15.semantic_rules/14.compatibility_features/01.extended_conditional_expressions/do_t.params.yaml @@ -13,8 +13,8 @@ --- # truthy values cases: - - { val: '0x80.toByte()', type: 'byte' } - - { val: '0x8000.toShort()', type: 'short' } + - { val: '(0x80).toByte()', type: 'byte' } + - { val: '(0x8000).toShort()', type: 'short' } - { val: '0x80000000', type: 'int' } - { val: '0x8000000000000000.toLong()', type: 'long' } - { val: '0.000001f', type: 'float' } diff --git a/static_core/plugins/ets/tests/ets-templates/15.semantic_rules/14.compatibility_features/01.extended_conditional_expressions/for_t.params.yaml b/static_core/plugins/ets/tests/ets-templates/15.semantic_rules/14.compatibility_features/01.extended_conditional_expressions/for_t.params.yaml index 75e7f29453f6a98fec462041445cce06beaa3587..43245b4b452eb0976326de1c5818b493d43a09d1 100644 --- a/static_core/plugins/ets/tests/ets-templates/15.semantic_rules/14.compatibility_features/01.extended_conditional_expressions/for_t.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/15.semantic_rules/14.compatibility_features/01.extended_conditional_expressions/for_t.params.yaml @@ -13,8 +13,8 @@ --- # truthy values cases: - - { val: '0x80.toByte()', type: 'byte' } - - { val: '0x8000.toShort()', type: 'short' } + - { val: '(0x80).toByte()', type: 'byte' } + - { val: '(0x8000).toShort()', type: 'short' } - { val: '0x80000000', type: 'int' } - { val: '0x8000000000000000.toLong()', type: 'long' } - { val: '0.000001f', type: 'float' } 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..fdb00c97857bd151e30c7bb72eecc93e4969ef3c 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 @@ -18,7 +18,7 @@ cases: - '0x7FFF.toShort()' - '0x7FFFFFFF.toInt()' - '0x7FFFFFFFFFFFFFFF as long' - - '0.0001.toFloat()' + - '(0.0001).toFloat()' - '1e22.toDouble()' - '0.0000001 as number' @@ -50,7 +50,7 @@ cases: - new Byte(11).unboxed() - new Short(1111).unboxed() - new Int(111111).unboxed() - - new Float(11111111.0).unboxed() + - new Float(11111111.0f).unboxed() - new Double(1111111111.0).unboxed() - new Number(1e33 as number).unboxed() diff --git a/static_core/plugins/ets/tests/ets-templates/15.semantic_rules/14.compatibility_features/01.extended_conditional_expressions/if_t2.params.yaml b/static_core/plugins/ets/tests/ets-templates/15.semantic_rules/14.compatibility_features/01.extended_conditional_expressions/if_t2.params.yaml index 75e7f29453f6a98fec462041445cce06beaa3587..43245b4b452eb0976326de1c5818b493d43a09d1 100644 --- a/static_core/plugins/ets/tests/ets-templates/15.semantic_rules/14.compatibility_features/01.extended_conditional_expressions/if_t2.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/15.semantic_rules/14.compatibility_features/01.extended_conditional_expressions/if_t2.params.yaml @@ -13,8 +13,8 @@ --- # truthy values cases: - - { val: '0x80.toByte()', type: 'byte' } - - { val: '0x8000.toShort()', type: 'short' } + - { val: '(0x80).toByte()', type: 'byte' } + - { val: '(0x8000).toShort()', type: 'short' } - { val: '0x80000000', type: 'int' } - { val: '0x8000000000000000.toLong()', type: 'long' } - { val: '0.000001f', type: 'float' } diff --git a/static_core/plugins/ets/tests/ets-templates/15.semantic_rules/14.compatibility_features/01.extended_conditional_expressions/while_t.params.yaml b/static_core/plugins/ets/tests/ets-templates/15.semantic_rules/14.compatibility_features/01.extended_conditional_expressions/while_t.params.yaml index 75e7f29453f6a98fec462041445cce06beaa3587..43245b4b452eb0976326de1c5818b493d43a09d1 100644 --- a/static_core/plugins/ets/tests/ets-templates/15.semantic_rules/14.compatibility_features/01.extended_conditional_expressions/while_t.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/15.semantic_rules/14.compatibility_features/01.extended_conditional_expressions/while_t.params.yaml @@ -13,8 +13,8 @@ --- # truthy values cases: - - { val: '0x80.toByte()', type: 'byte' } - - { val: '0x8000.toShort()', type: 'short' } + - { val: '(0x80).toByte()', type: 'byte' } + - { val: '(0x8000).toShort()', type: 'short' } - { val: '0x80000000', type: 'int' } - { val: '0x8000000000000000.toLong()', type: 'long' } - { val: '0.000001f', type: 'float' } diff --git a/static_core/plugins/ets/tests/ets-templates/17.experimental_features/02.fixed_array_types/far1.params.yaml b/static_core/plugins/ets/tests/ets-templates/17.experimental_features/02.fixed_array_types/far1.params.yaml index af976fee3edf55fc4bab3540ee0be0060abcb444..0d158192757c73947c3b652e91c49d84660a6e2d 100644 --- a/static_core/plugins/ets/tests/ets-templates/17.experimental_features/02.fixed_array_types/far1.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/17.experimental_features/02.fixed_array_types/far1.params.yaml @@ -16,7 +16,7 @@ cases: - decl: |- let x: FixedArray use: |- - x = [0x80.toByte(), 0x7f.toByte()] + x = [(0x80).toByte(), (0x7f).toByte()] let obj: Object = toObj(x) let arr = obj as FixedArray let v: byte = arr[0] @@ -26,7 +26,7 @@ cases: - decl: |- let x: FixedArray use: |- - x = [0x8000.toShort(), 0x7fff.toShort()] + x = [(0x8000).toShort(), (0x7fff).toShort()] let obj: Object = toObj(x) let arr = obj as FixedArray let v: short = arr[0] diff --git a/static_core/plugins/ets/tests/ets-templates/17.experimental_features/02.fixed_array_types/far2.params.yaml b/static_core/plugins/ets/tests/ets-templates/17.experimental_features/02.fixed_array_types/far2.params.yaml index eb5aceb483abcc838ddeb4728dddd996aeddb420..eec86bdb5e5348803d5777e481c00314ceeeb916 100644 --- a/static_core/plugins/ets/tests/ets-templates/17.experimental_features/02.fixed_array_types/far2.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/17.experimental_features/02.fixed_array_types/far2.params.yaml @@ -25,10 +25,10 @@ types: cases: - type: byte - vals: '0x80.toByte(), 0x7f.toByte()' + vals: '(0x80).toByte(), (0x7f).toByte()' - type: short - vals: '0x8000.toShort(), 0x7fff.toShort()' + vals: '(0x8000).toShort(), (0x7fff).toShort()' - type: int vals: '0x80000000, 0x7fffffff' diff --git a/static_core/plugins/ets/tests/ets-templates/17.experimental_features/09.overload_declarations/02.class_method_overload_declarations/cm_over1.params.yaml b/static_core/plugins/ets/tests/ets-templates/17.experimental_features/09.overload_declarations/02.class_method_overload_declarations/cm_over1.params.yaml index 9444c6d05657b54303885702ef55862ac33f23ca..4a8495966f78225e5822d572a3617e08d15d38a6 100644 --- a/static_core/plugins/ets/tests/ets-templates/17.experimental_features/09.overload_declarations/02.class_method_overload_declarations/cm_over1.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/17.experimental_features/09.overload_declarations/02.class_method_overload_declarations/cm_over1.params.yaml @@ -57,16 +57,16 @@ cases: use: |- let a: A = new A() arktest.assertEQ( a.meth(new Byte(-1 as byte)), "byte" ) - arktest.assertEQ( a.meth(new Short(-1 as short)), "short" ) - arktest.assertEQ( a.meth(new Int(-1 as int)), "int" ) - arktest.assertEQ( a.meth(new Long(-1 as long)), "long" ) + arktest.assertEQ( a.meth(new Short((-1)).toShort()), "short" ) + arktest.assertEQ( a.meth(new Int((-1).toInt())), "int" ) + arktest.assertEQ( a.meth(new Long((-1).toLong())), "long" ) arktest.assertEQ( a.meth(new Char(c'A')), "char" ) arktest.assertEQ( a.meth(new Boolean(false)), "boolean" ) arktest.assertEQ( a.meth(new Float(3.14.toFloat())), "float" ) arktest.assertEQ( a.meth(new Double(3.14)), "double" ) - arktest.assertEQ( a.meth(-1 as long), "long" ) - arktest.assertEQ( a.meth(-1 as int), "int" ) - arktest.assertEQ( a.meth(-1 as short), "short" ) + arktest.assertEQ( a.meth((-1).toLong()), "long" ) + arktest.assertEQ( a.meth((-1).toInt()), "int" ) + arktest.assertEQ( a.meth((-1).toShort()), "short" ) arktest.assertEQ( a.meth(-1 as byte), "byte" ) arktest.assertEQ( a.meth(c'A'), "char" ) arktest.assertEQ( a.meth(false), "boolean" ) @@ -100,16 +100,16 @@ cases: use: |- let a: A = new A() arktest.assertEQ( a.meth(new Byte(-1 as byte)), "byte" ) - arktest.assertEQ( a.meth(new Short(-1 as short)), "short" ) - arktest.assertEQ( a.meth(new Int(-1 as int)), "int" ) - arktest.assertEQ( a.meth(new Long(-1 as long)), "long" ) + arktest.assertEQ( a.meth(new Short((-1)).toShort()), "short" ) + arktest.assertEQ( a.meth(new Int((-1).toInt())), "int" ) + arktest.assertEQ( a.meth(new Long((-1).toLong())), "long" ) arktest.assertEQ( a.meth(new Char(c'A')), "char" ) arktest.assertEQ( a.meth(new Boolean(false)), "boolean" ) arktest.assertEQ( a.meth(new Float(3.14.toFloat())), "float" ) arktest.assertEQ( a.meth(new Double(3.14)), "double" ) - arktest.assertEQ( a.meth(-1 as long), "long" ) - arktest.assertEQ( a.meth(-1 as int), "int" ) - arktest.assertEQ( a.meth(-1 as short), "short" ) + arktest.assertEQ( a.meth((-1).toLong()), "long" ) + arktest.assertEQ( a.meth((-1).toInt()), "int" ) + arktest.assertEQ( a.meth((-1).toShort()), "short" ) arktest.assertEQ( a.meth(-1 as byte), "byte" ) arktest.assertEQ( a.meth(c'A'), "char" ) arktest.assertEQ( a.meth(false), "boolean" ) @@ -129,9 +129,9 @@ cases: } use: |- let a: A = new A() - arktest.assertEQ( a.meth(-1), "int" ) + arktest.assertEQ( a.meth((-1).toInt()), "int" ) arktest.assertEQ( a.meth(Color.Red), "Color" ) - arktest.assertEQ( a.meth(-2 as short), "short" ) + arktest.assertEQ( a.meth((-2).toShort()), "short" ) arktest.assertEQ( a.meth("abc"), "string" ) arktest.assertEQ( a.meth(Size.L), "Size" ) arktest.assertEQ( a.meth(42 as byte), "int" ) diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/02.assignment-like_contexts/prim_unboxing.params.yaml b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/02.assignment-like_contexts/prim_unboxing.params.yaml index 8f29cdc9c91200c61544d8dbdec2f9b8442db3a6..7442775a3e3e6bfa0c2f92f53c276c8393470119 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/02.assignment-like_contexts/prim_unboxing.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/02.assignment-like_contexts/prim_unboxing.params.yaml @@ -19,5 +19,5 @@ unboxing_conversions: - { origin: Char, dest: char, value: "c'a'" } - { origin: Int, dest: int, value: 1 } - { origin: Long, dest: long, value: new Long(1 as long) } - - { origin: Float, dest: float, value: new Float(1.0 as float) } + - { origin: Float, dest: float, value: new Float(1.0) } - { origin: Double, dest: double, value: 1.0 } diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/04.casting_contexts_and_conversions/01.numeric_casting_conversions/unboxing.params.yaml b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/04.casting_contexts_and_conversions/01.numeric_casting_conversions/unboxing.params.yaml index 47acb2c5e52775192c93359e5101331e73338921..6dd6fe055cbdab0beebe2f02f31837fc5e78ead2 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/04.casting_contexts_and_conversions/01.numeric_casting_conversions/unboxing.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/04.casting_contexts_and_conversions/01.numeric_casting_conversions/unboxing.params.yaml @@ -19,5 +19,5 @@ cases: - { type: Short, val: 0x5555 as short } - { type: Int, val: 0x12121212 as int } - { type: Long, val: 0x3434343456565656 as long } - - { type: Float, val: 0.00001 as float } + - { type: Float, val: 0.00001f } - { type: Double, val: 0.00000000001 as double } diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/04.casting_contexts_and_conversions/02.class_or_interface_casting_conversions/predef_ref.ets b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/04.casting_contexts_and_conversions/02.class_or_interface_casting_conversions/predef_ref.ets index f4b98dad1a2805e3928c2193242e0a85e25fb1ee..7f66a42d8b4306b2baea8e5c961e934284d9143b 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/04.casting_contexts_and_conversions/02.class_or_interface_casting_conversions/predef_ref.ets +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/04.casting_contexts_and_conversions/02.class_or_interface_casting_conversions/predef_ref.ets @@ -18,14 +18,12 @@ desc: Casting contexts allow the use of the narrowing reference conversion. ---*/ -function main(): int { +function main() { {%- for t in c['types'] %} let s{{loop.index}}: {{t.stype}} = new {{t.dtype}}({{t.pval}}); let d{{loop.index}}: {{t.dtype}} = s{{loop.index}} as {{t.dtype}}; - if (d{{loop.index}} != {{t.pval}}) { - return 1; - } + arktest.assertEQ(d{{loop.index}}, {{t.pval}}) + {%- endfor %} - return 0; } {% endfor %} diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/04.casting_contexts_and_conversions/02.class_or_interface_casting_conversions/predef_ref.params.yaml b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/04.casting_contexts_and_conversions/02.class_or_interface_casting_conversions/predef_ref.params.yaml index 5ed8a51c9fbc43bccef0a57b7c37673d6d4abbf1..a1c8abe75101623cc0b65dfd9a302efaa32df3e3 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/04.casting_contexts_and_conversions/02.class_or_interface_casting_conversions/predef_ref.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/04.casting_contexts_and_conversions/02.class_or_interface_casting_conversions/predef_ref.params.yaml @@ -21,8 +21,8 @@ cases: - { dtype: Byte, stype: Object, pval: 0x55 as byte } - { dtype: Byte, stype: Numeric, pval: 0x7F as byte } - - { dtype: Byte, stype: Integral, pval: 0x80 as byte } - - { dtype: Byte, stype: Comparable, pval: 0x80 as byte } + - { dtype: Byte, stype: Integral, pval: Int.toByte(0x80) } + - { dtype: Byte, stype: Comparable, pval: Int.toByte(0x80) } - { dtype: Char, stype: Object, pval: "c'W'" } - { dtype: Char, stype: Comparable, pval: "c'Z'" } @@ -49,7 +49,7 @@ cases: - { dtype: Double, stype: Object, pval: '0.00000000001' } - { dtype: Double, stype: Numeric, pval: '0.00000000001' } - - { dtype: Double, stype: Floating, pval: '0.00000000001' } + - { dtype: Double, stype: Floating, pval: '0.00000000001f' } - { dtype: Double, stype: Comparable, pval: '0.00000000001' } - { dtype: String, stype: Object, pval: '"ABC"' } 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..85ec08ebf43163ebb567e3775cec6bae9f7d520c 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 @@ -19,7 +19,7 @@ cases: - { type: short, expr: 0x5555 as short, op: '!=' } - { type: int, expr: 0x12121212 as int, op: '!=' } - { type: long, expr: 0x3434343456565656 as long, op: '!=' } - - { type: float, expr: 0.00001 as float, op: '!=' } + - { type: float, expr: 0.00001f, op: '!=' } - { type: double, expr: 0.00000000001 as double, op: '!=' } - { type: Boolean, expr: new Boolean(true), op: '!==' } - { type: Byte, expr: new Byte(new Int(1).toByte()), op: '!==' } diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/04.casting_contexts_and_conversions/invalid.params.yaml b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/04.casting_contexts_and_conversions/invalid.params.yaml index d83cf155459b1a313cc4c5a83c34cf3e7d3d0720..8d53379138b68533f9326da1cb9e82c2e9d0e630 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/04.casting_contexts_and_conversions/invalid.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/04.casting_contexts_and_conversions/invalid.params.yaml @@ -64,8 +64,8 @@ cases: - { stype: Long, sval: new Long(0 as long), dtype: boolean } - { stype: Long, sval: new Long(0 as long), dtype: Boolean } - - { stype: Float, sval: new Float(0 as float), dtype: boolean } - - { stype: Float, sval: new Float(0 as float), dtype: Boolean } + - { stype: Float, sval: new Float(0), dtype: boolean } + - { stype: Float, sval: new Float(0), dtype: Boolean } - { stype: Double, sval: new Double(0 as double), dtype: boolean } - { stype: Double, sval: new Double(0 as double), dtype: Boolean } diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/04.casting_contexts_and_conversions/widening_refs.params.yaml b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/04.casting_contexts_and_conversions/widening_refs.params.yaml index 978a9ec74f00c435606a6d8b3b85b9cad30ee440..8f0bc03a24a1dea3006facaac5e7a852c1f4fd9b 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/04.casting_contexts_and_conversions/widening_refs.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/04.casting_contexts_and_conversions/widening_refs.params.yaml @@ -24,7 +24,7 @@ cases: - { stype: Int, expr: new Int(0x12121212 as int), dtype: Integral } - { stype: Long, expr: new Long(0x3434343456565656 as long), dtype: Object } - { stype: Long, expr: new Long(0x3434343456565656 as long), dtype: Integral } - - { stype: Float, expr: new Float(0.00001 as float), dtype: Object } - - { stype: Float, expr: new Float(0.00001 as float), dtype: Floating } + - { stype: Float, expr: new Float(0.00001), dtype: Object } + - { stype: Float, expr: new Float(0.00001), dtype: Floating } - { stype: Double, expr: new Double(0.00000000001 as double), dtype: Object } - { stype: Double, expr: new Double(0.00000000001 as double), dtype: Floating } diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/assn_var/assn-var-un.params.yaml b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/assn_var/assn-var-un.params.yaml index f41c22137d511f90435385ecbf7c8ca96c9da3f7..cd5273356bcea0fed07301410b46f1cc2eabf349 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/assn_var/assn-var-un.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/assn_var/assn-var-un.params.yaml @@ -152,7 +152,7 @@ cases: - { from_type: 'A', ref_type: 'A', expr: 'a', eq: '===' } - { from_type: 'B', ref_type: 'B', expr: 'b', eq: '===' } - { from_type: 'float', ref_type: 'Float', expr: '2.5e02f', eq: '==' } - - { from_type: 'short', ref_type: 'Short', expr: '0x8001 as short', eq: '==' } + - { from_type: 'short', ref_type: 'Short', expr: '(0x8001).toShort()', eq: '==' } - { from_type: 'boolean', ref_type: 'Boolean', expr: '!!false', eq: '==' } - { from_type: 'undefined', ref_type: 'undefined', expr: 'u', eq: '==' } - { from_type: 'null', ref_type: 'null', expr: 'n', eq: '==' } diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/assn_var/assn-var-wd.params.yaml b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/assn_var/assn-var-wd.params.yaml index e15ee3523b41c881c23fbfe611abfdad46fc9f6c..3d82df9c0e7b10bbf3cfda8d2522b78a183a2501 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/assn_var/assn-var-wd.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/assn_var/assn-var-wd.params.yaml @@ -23,8 +23,8 @@ cases: decl: |- let vByte: Byte = new Byte(127 as byte) let vInt: Int = new Int(-7) - let vShort: Short = new Short(0xCAFE as short) - let vLong: Long = new Long(0o777 as long) + let vShort: Short = new Short((0xCAFE).toShort()) + let vLong: Long = new Long((0o777).toLong()) values: - { from_type: 'Byte|Long', expr: vByte, eq: '===' } - { from_type: 'Short|Byte|Int', expr: vInt, eq: '===' } @@ -61,8 +61,8 @@ cases: decl: |- let vByte: Byte = new Byte(127 as byte) let vInt: Int = new Int(-7) - let vShort: Short = new Short(0xCAFE as short) - let vLong: Long = new Long(0o777 as long) + let vShort: Short = new Short((0xCAFE).toShort()) + let vLong: Long = new Long((0o777).toLong()) let vFloat: Float = new Float(3.5f) let vDouble: Double = new Double(-1.1E-20) let vNumber: Number = new Number(1234567e8) @@ -77,9 +77,9 @@ cases: - to_type: byte|short|int|long|boolean|char|float|double|bigint|string values: - { from_type: 'byte|boolean|char', ref_type: Byte, expr: '127 as byte', eq: '==' } - - { from_type: 'short|char|string|double', ref_type: Short, expr: '0xCAFE as short', eq: '==' } + - { from_type: 'short|char|string|double', ref_type: Short, expr: '(0xCAFE).toShort()', eq: '==' } - { from_type: 'int|boolean', ref_type: Int, expr: -7, eq: '==' } - - { from_type: 'long|string|long|string|boolean', ref_type: Long, expr: 0o777 as long, eq: '==' } + - { from_type: 'long|string|long|string|boolean', ref_type: Long, expr: (0o777).toLong(), eq: '==' } - { from_type: 'char|byte|short', ref_type: Char, expr: "c'\\u5C5C'", eq: '==' } - { from_type: 'boolean|string', ref_type: Boolean, expr: 'false', eq: '==' } - { from_type: 'float|bigint', ref_type: Float, expr: 3.5f, eq: '==' } diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/call_cons/call-cons-un.params.yaml b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/call_cons/call-cons-un.params.yaml index 2f5dabbef49116a40b8acfcd7e983b9d6a8254b5..e6004bc9203dd23d86ad42a15a22c29ee01a2102 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/call_cons/call-cons-un.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/call_cons/call-cons-un.params.yaml @@ -152,7 +152,7 @@ cases: - { from_type: 'A', ref_type: 'A', expr: 'a', eq: '===' } - { from_type: 'B', ref_type: 'B', expr: 'b', eq: '===' } - { from_type: 'float', ref_type: 'Float', expr: '2.5e02f', eq: '==' } - - { from_type: 'short', ref_type: 'Short', expr: '0x8001 as short', eq: '==' } + - { from_type: 'short', ref_type: 'Short', expr: '(0x8001).toShort()', eq: '==' } - { from_type: 'boolean', ref_type: 'Boolean', expr: '!!false', eq: '==' } - { from_type: 'undefined', ref_type: 'undefined', expr: 'u', eq: '==' } - { from_type: 'null', ref_type: 'null', expr: 'n', eq: '==' } diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/call_cons/call-cons-wd.params.yaml b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/call_cons/call-cons-wd.params.yaml index e15ee3523b41c881c23fbfe611abfdad46fc9f6c..3d82df9c0e7b10bbf3cfda8d2522b78a183a2501 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/call_cons/call-cons-wd.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/call_cons/call-cons-wd.params.yaml @@ -23,8 +23,8 @@ cases: decl: |- let vByte: Byte = new Byte(127 as byte) let vInt: Int = new Int(-7) - let vShort: Short = new Short(0xCAFE as short) - let vLong: Long = new Long(0o777 as long) + let vShort: Short = new Short((0xCAFE).toShort()) + let vLong: Long = new Long((0o777).toLong()) values: - { from_type: 'Byte|Long', expr: vByte, eq: '===' } - { from_type: 'Short|Byte|Int', expr: vInt, eq: '===' } @@ -61,8 +61,8 @@ cases: decl: |- let vByte: Byte = new Byte(127 as byte) let vInt: Int = new Int(-7) - let vShort: Short = new Short(0xCAFE as short) - let vLong: Long = new Long(0o777 as long) + let vShort: Short = new Short((0xCAFE).toShort()) + let vLong: Long = new Long((0o777).toLong()) let vFloat: Float = new Float(3.5f) let vDouble: Double = new Double(-1.1E-20) let vNumber: Number = new Number(1234567e8) @@ -77,9 +77,9 @@ cases: - to_type: byte|short|int|long|boolean|char|float|double|bigint|string values: - { from_type: 'byte|boolean|char', ref_type: Byte, expr: '127 as byte', eq: '==' } - - { from_type: 'short|char|string|double', ref_type: Short, expr: '0xCAFE as short', eq: '==' } + - { from_type: 'short|char|string|double', ref_type: Short, expr: '(0xCAFE).toShort()', eq: '==' } - { from_type: 'int|boolean', ref_type: Int, expr: -7, eq: '==' } - - { from_type: 'long|string|long|string|boolean', ref_type: Long, expr: 0o777 as long, eq: '==' } + - { from_type: 'long|string|long|string|boolean', ref_type: Long, expr: (0o777).toLong(), eq: '==' } - { from_type: 'char|byte|short', ref_type: Char, expr: "c'\\u5C5C'", eq: '==' } - { from_type: 'boolean|string', ref_type: Boolean, expr: 'false', eq: '==' } - { from_type: 'float|bigint', ref_type: Float, expr: 3.5f, eq: '==' } diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/call_func/call-func-un.params.yaml b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/call_func/call-func-un.params.yaml index bade4e8fb11e0c7715154559902e76a7a446ed06..7c4a99ec6179e51824a36375cfb242a0705ca03c 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/call_func/call-func-un.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/call_func/call-func-un.params.yaml @@ -152,7 +152,7 @@ cases: - { from_type: 'A', ref_type: 'A', expr: 'a', eq: '===' } - { from_type: 'B', ref_type: 'B', expr: 'b', eq: '===' } - { from_type: 'float', ref_type: 'Float', expr: '2.5e02f', eq: '==' } - - { from_type: 'short', ref_type: 'Short', expr: '0x8001 as short', eq: '==' } + - { from_type: 'short', ref_type: 'Short', expr: '(0x8001).toShort()', eq: '==' } - { from_type: 'boolean', ref_type: 'Boolean', expr: '!!false', eq: '==' } - { from_type: 'undefined', ref_type: 'undefined', expr: 'u', eq: '==' } - { from_type: 'null', ref_type: 'null', expr: 'n', eq: '==' } diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/call_func/call-func-wd.params.yaml b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/call_func/call-func-wd.params.yaml index e15ee3523b41c881c23fbfe611abfdad46fc9f6c..3d82df9c0e7b10bbf3cfda8d2522b78a183a2501 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/call_func/call-func-wd.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/call_func/call-func-wd.params.yaml @@ -23,8 +23,8 @@ cases: decl: |- let vByte: Byte = new Byte(127 as byte) let vInt: Int = new Int(-7) - let vShort: Short = new Short(0xCAFE as short) - let vLong: Long = new Long(0o777 as long) + let vShort: Short = new Short((0xCAFE).toShort()) + let vLong: Long = new Long((0o777).toLong()) values: - { from_type: 'Byte|Long', expr: vByte, eq: '===' } - { from_type: 'Short|Byte|Int', expr: vInt, eq: '===' } @@ -61,8 +61,8 @@ cases: decl: |- let vByte: Byte = new Byte(127 as byte) let vInt: Int = new Int(-7) - let vShort: Short = new Short(0xCAFE as short) - let vLong: Long = new Long(0o777 as long) + let vShort: Short = new Short((0xCAFE).toShort()) + let vLong: Long = new Long((0o777).toLong()) let vFloat: Float = new Float(3.5f) let vDouble: Double = new Double(-1.1E-20) let vNumber: Number = new Number(1234567e8) @@ -77,9 +77,9 @@ cases: - to_type: byte|short|int|long|boolean|char|float|double|bigint|string values: - { from_type: 'byte|boolean|char', ref_type: Byte, expr: '127 as byte', eq: '==' } - - { from_type: 'short|char|string|double', ref_type: Short, expr: '0xCAFE as short', eq: '==' } + - { from_type: 'short|char|string|double', ref_type: Short, expr: '(0xCAFE).toShort()', eq: '==' } - { from_type: 'int|boolean', ref_type: Int, expr: -7, eq: '==' } - - { from_type: 'long|string|long|string|boolean', ref_type: Long, expr: 0o777 as long, eq: '==' } + - { from_type: 'long|string|long|string|boolean', ref_type: Long, expr: (0o777).toLong(), eq: '==' } - { from_type: 'char|byte|short', ref_type: Char, expr: "c'\\u5C5C'", eq: '==' } - { from_type: 'boolean|string', ref_type: Boolean, expr: 'false', eq: '==' } - { from_type: 'float|bigint', ref_type: Float, expr: 3.5f, eq: '==' } diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/call_lmbd/call-lmbd-un.params.yaml b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/call_lmbd/call-lmbd-un.params.yaml index 30df95f7a86579e13e50d7b4ab60991d9e1f7687..425a9341b713f62f4bd415e2a541d06cab144128 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/call_lmbd/call-lmbd-un.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/call_lmbd/call-lmbd-un.params.yaml @@ -152,7 +152,7 @@ cases: - { from_type: 'A', ref_type: 'A', expr: 'a', eq: '===' } - { from_type: 'B', ref_type: 'B', expr: 'b', eq: '===' } - { from_type: 'float', ref_type: 'Float', expr: '2.5e02f', eq: '==' } - - { from_type: 'short', ref_type: 'Short', expr: '0x8001 as short', eq: '==' } + - { from_type: 'short', ref_type: 'Short', expr: '(0x8001).toShort()', eq: '==' } - { from_type: 'boolean', ref_type: 'Boolean', expr: '!!false', eq: '==' } - { from_type: 'undefined', ref_type: 'undefined', expr: 'u', eq: '==' } - { from_type: 'null', ref_type: 'null', expr: 'n', eq: '==' } diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/call_lmbd/call-lmbd-wd.params.yaml b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/call_lmbd/call-lmbd-wd.params.yaml index e15ee3523b41c881c23fbfe611abfdad46fc9f6c..3d82df9c0e7b10bbf3cfda8d2522b78a183a2501 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/call_lmbd/call-lmbd-wd.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/call_lmbd/call-lmbd-wd.params.yaml @@ -23,8 +23,8 @@ cases: decl: |- let vByte: Byte = new Byte(127 as byte) let vInt: Int = new Int(-7) - let vShort: Short = new Short(0xCAFE as short) - let vLong: Long = new Long(0o777 as long) + let vShort: Short = new Short((0xCAFE).toShort()) + let vLong: Long = new Long((0o777).toLong()) values: - { from_type: 'Byte|Long', expr: vByte, eq: '===' } - { from_type: 'Short|Byte|Int', expr: vInt, eq: '===' } @@ -61,8 +61,8 @@ cases: decl: |- let vByte: Byte = new Byte(127 as byte) let vInt: Int = new Int(-7) - let vShort: Short = new Short(0xCAFE as short) - let vLong: Long = new Long(0o777 as long) + let vShort: Short = new Short((0xCAFE).toShort()) + let vLong: Long = new Long((0o777).toLong()) let vFloat: Float = new Float(3.5f) let vDouble: Double = new Double(-1.1E-20) let vNumber: Number = new Number(1234567e8) @@ -77,9 +77,9 @@ cases: - to_type: byte|short|int|long|boolean|char|float|double|bigint|string values: - { from_type: 'byte|boolean|char', ref_type: Byte, expr: '127 as byte', eq: '==' } - - { from_type: 'short|char|string|double', ref_type: Short, expr: '0xCAFE as short', eq: '==' } + - { from_type: 'short|char|string|double', ref_type: Short, expr: '(0xCAFE).toShort()', eq: '==' } - { from_type: 'int|boolean', ref_type: Int, expr: -7, eq: '==' } - - { from_type: 'long|string|long|string|boolean', ref_type: Long, expr: 0o777 as long, eq: '==' } + - { from_type: 'long|string|long|string|boolean', ref_type: Long, expr: (0o777).toLong(), eq: '==' } - { from_type: 'char|byte|short', ref_type: Char, expr: "c'\\u5C5C'", eq: '==' } - { from_type: 'boolean|string', ref_type: Boolean, expr: 'false', eq: '==' } - { from_type: 'float|bigint', ref_type: Float, expr: 3.5f, eq: '==' } diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/call_meth/call-meth-un.params.yaml b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/call_meth/call-meth-un.params.yaml index 238e2e53f3e803c1457a27bd2f0a495adeef6bb2..180c700ddd82a494977d999cc4550bdfee68dbee 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/call_meth/call-meth-un.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/call_meth/call-meth-un.params.yaml @@ -152,7 +152,7 @@ cases: - { from_type: 'A', ref_type: 'A', expr: 'a', eq: '===' } - { from_type: 'B', ref_type: 'B', expr: 'b', eq: '===' } - { from_type: 'float', ref_type: 'Float', expr: '2.5e02f', eq: '==' } - - { from_type: 'short', ref_type: 'Short', expr: '0x8001 as short', eq: '==' } + - { from_type: 'short', ref_type: 'Short', expr: '(0x8001).toShort()', eq: '==' } - { from_type: 'boolean', ref_type: 'Boolean', expr: '!!false', eq: '==' } - { from_type: 'undefined', ref_type: 'undefined', expr: 'u', eq: '==' } - { from_type: 'null', ref_type: 'null', expr: 'n', eq: '==' } diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/call_meth/call-meth-wd.params.yaml b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/call_meth/call-meth-wd.params.yaml index e15ee3523b41c881c23fbfe611abfdad46fc9f6c..3d82df9c0e7b10bbf3cfda8d2522b78a183a2501 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/call_meth/call-meth-wd.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/call_meth/call-meth-wd.params.yaml @@ -23,8 +23,8 @@ cases: decl: |- let vByte: Byte = new Byte(127 as byte) let vInt: Int = new Int(-7) - let vShort: Short = new Short(0xCAFE as short) - let vLong: Long = new Long(0o777 as long) + let vShort: Short = new Short((0xCAFE).toShort()) + let vLong: Long = new Long((0o777).toLong()) values: - { from_type: 'Byte|Long', expr: vByte, eq: '===' } - { from_type: 'Short|Byte|Int', expr: vInt, eq: '===' } @@ -61,8 +61,8 @@ cases: decl: |- let vByte: Byte = new Byte(127 as byte) let vInt: Int = new Int(-7) - let vShort: Short = new Short(0xCAFE as short) - let vLong: Long = new Long(0o777 as long) + let vShort: Short = new Short((0xCAFE).toShort()) + let vLong: Long = new Long((0o777).toLong()) let vFloat: Float = new Float(3.5f) let vDouble: Double = new Double(-1.1E-20) let vNumber: Number = new Number(1234567e8) @@ -77,9 +77,9 @@ cases: - to_type: byte|short|int|long|boolean|char|float|double|bigint|string values: - { from_type: 'byte|boolean|char', ref_type: Byte, expr: '127 as byte', eq: '==' } - - { from_type: 'short|char|string|double', ref_type: Short, expr: '0xCAFE as short', eq: '==' } + - { from_type: 'short|char|string|double', ref_type: Short, expr: '(0xCAFE).toShort()', eq: '==' } - { from_type: 'int|boolean', ref_type: Int, expr: -7, eq: '==' } - - { from_type: 'long|string|long|string|boolean', ref_type: Long, expr: 0o777 as long, eq: '==' } + - { from_type: 'long|string|long|string|boolean', ref_type: Long, expr: (0o777).toLong(), eq: '==' } - { from_type: 'char|byte|short', ref_type: Char, expr: "c'\\u5C5C'", eq: '==' } - { from_type: 'boolean|string', ref_type: Boolean, expr: 'false', eq: '==' } - { from_type: 'float|bigint', ref_type: Float, expr: 3.5f, eq: '==' } diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/comp_arr/comp-arr-un.params.yaml b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/comp_arr/comp-arr-un.params.yaml index 450189ed3a3594e5f34690292af55cfc3691b4a3..ad02350ce133b82b4175c4222dd6db038ef7a22a 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/comp_arr/comp-arr-un.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/comp_arr/comp-arr-un.params.yaml @@ -152,7 +152,7 @@ cases: - { from_type: 'A', ref_type: 'A', expr: 'a', eq: '===' } - { from_type: 'B', ref_type: 'B', expr: 'b', eq: '===' } - { from_type: 'float', ref_type: 'Float', expr: '2.5e02f', eq: '==' } - - { from_type: 'short', ref_type: 'Short', expr: '0x8001 as short', eq: '==' } + - { from_type: 'short', ref_type: 'Short', expr: '(0x8001).toShort()', eq: '==' } - { from_type: 'boolean', ref_type: 'Boolean', expr: '!!false', eq: '==' } - { from_type: 'undefined', ref_type: 'undefined', expr: 'u', eq: '==' } - { from_type: 'null', ref_type: 'null', expr: 'n', eq: '==' } diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/comp_arr/comp-arr-wd.params.yaml b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/comp_arr/comp-arr-wd.params.yaml index e15ee3523b41c881c23fbfe611abfdad46fc9f6c..4c9791b6c4787051c85921adf1dc7d17a3c888c8 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/comp_arr/comp-arr-wd.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/comp_arr/comp-arr-wd.params.yaml @@ -23,8 +23,8 @@ cases: decl: |- let vByte: Byte = new Byte(127 as byte) let vInt: Int = new Int(-7) - let vShort: Short = new Short(0xCAFE as short) - let vLong: Long = new Long(0o777 as long) + let vShort: Short = new Short((0xCAFE).toShort()) + let vLong: Long = new Long((0o777).toLong()) values: - { from_type: 'Byte|Long', expr: vByte, eq: '===' } - { from_type: 'Short|Byte|Int', expr: vInt, eq: '===' } @@ -61,8 +61,8 @@ cases: decl: |- let vByte: Byte = new Byte(127 as byte) let vInt: Int = new Int(-7) - let vShort: Short = new Short(0xCAFE as short) - let vLong: Long = new Long(0o777 as long) + let vShort: Short = new Short((0xCAFE).toShort()) + let vLong: Long = new Long((0o777).toLong()) let vFloat: Float = new Float(3.5f) let vDouble: Double = new Double(-1.1E-20) let vNumber: Number = new Number(1234567e8) @@ -77,9 +77,9 @@ cases: - to_type: byte|short|int|long|boolean|char|float|double|bigint|string values: - { from_type: 'byte|boolean|char', ref_type: Byte, expr: '127 as byte', eq: '==' } - - { from_type: 'short|char|string|double', ref_type: Short, expr: '0xCAFE as short', eq: '==' } + - { from_type: 'short|char|string|double', ref_type: Short, expr: '(0xCAFE).toShort()', eq: '==' } - { from_type: 'int|boolean', ref_type: Int, expr: -7, eq: '==' } - - { from_type: 'long|string|long|string|boolean', ref_type: Long, expr: 0o777 as long, eq: '==' } + - { from_type: 'long|string|long|string|boolean', ref_type: Long, expr: '(0o777).toLong()', eq: '==' } - { from_type: 'char|byte|short', ref_type: Char, expr: "c'\\u5C5C'", eq: '==' } - { from_type: 'boolean|string', ref_type: Boolean, expr: 'false', eq: '==' } - { from_type: 'float|bigint', ref_type: Float, expr: 3.5f, eq: '==' } diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/comp_obj/comp-obj-un.params.yaml b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/comp_obj/comp-obj-un.params.yaml index df54e30d8fb06bbe4bfd27800bf0f89657d2f161..556ad0e3a2e65c444b1b818aa38286ab66671d2e 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/comp_obj/comp-obj-un.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/comp_obj/comp-obj-un.params.yaml @@ -159,7 +159,7 @@ cases: - { from_type: 'A', ref_type: 'A', expr: 'a', eq: '===' } - { from_type: 'B', ref_type: 'B', expr: 'b', eq: '===' } - { from_type: 'float', ref_type: 'Float', expr: '2.5e02f', eq: '==' } - - { from_type: 'short', ref_type: 'Short', expr: '0x8001 as short', eq: '==' } + - { from_type: 'short', ref_type: 'Short', expr: '(0x8001).toShort()', eq: '==' } - { from_type: 'boolean', ref_type: 'Boolean', expr: '!!false', eq: '==' } - { from_type: 'undefined', ref_type: 'undefined', expr: 'u', eq: '==' } - { from_type: 'null', ref_type: 'null', expr: 'n', eq: '==' } diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/comp_obj/comp-obj-wd.params.yaml b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/comp_obj/comp-obj-wd.params.yaml index d1f32ba7a9119daa570f7ce3f075c8bfc69b6144..edd259ed7a6f2bf5a934ec0b3868e9ad8adeeecf 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/comp_obj/comp-obj-wd.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/comp_obj/comp-obj-wd.params.yaml @@ -24,8 +24,8 @@ cases: decl: |- let vByte: Byte = new Byte(127 as byte) let vInt: Int = new Int(-7) - let vShort: Short = new Short(0xCAFE as short) - let vLong: Long = new Long(0o777 as long) + let vShort: Short = new Short((0xCAFE).toShort()) + let vLong: Long = new Long((0o777).toLong()) values: - { from_type: 'Byte|Long', expr: vByte, eq: '===' } - { from_type: 'Short|Byte|Int', expr: vInt, eq: '===' } @@ -64,8 +64,8 @@ cases: decl: |- let vByte: Byte = new Byte(127 as byte) let vInt: Int = new Int(-7) - let vShort: Short = new Short(0xCAFE as short) - let vLong: Long = new Long(0o777 as long) + let vShort: Short = new Short((0xCAFE).toShort()) + let vLong: Long = new Long((0o777).toLong()) let vFloat: Float = new Float(3.5f) let vDouble: Double = new Double(-1.1E-20) let vNumber: Number = new Number(1234567e8) @@ -81,9 +81,9 @@ cases: init_value: 0 values: - { from_type: 'byte|boolean|char', ref_type: Byte, expr: '127 as byte', eq: '==' } - - { from_type: 'short|char|string|double', ref_type: Short, expr: '0xCAFE as short', eq: '==' } + - { from_type: 'short|char|string|double', ref_type: Short, expr: '(0xCAFE).toShort()', eq: '==' } - { from_type: 'int|boolean', ref_type: Int, expr: -7, eq: '==' } - - { from_type: 'long|string|long|string|boolean', ref_type: Long, expr: 0o777 as long, eq: '==' } + - { from_type: 'long|string|long|string|boolean', ref_type: Long, expr: (0o777).toLong(), eq: '==' } - { from_type: 'char|byte|short', ref_type: Char, expr: "c'\\u5C5C'", eq: '==' } - { from_type: 'boolean|string', ref_type: Boolean, expr: 'false', eq: '==' } - { from_type: 'float|bigint', ref_type: Float, expr: 3.5f, eq: '==' } diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/decl_field/decl-field-un.params.yaml b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/decl_field/decl-field-un.params.yaml index c732e17f68e5580b46df7dee9a5c5284de3c977e..031884766dcd6b035d200450fd7d1a2c28a233ab 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/decl_field/decl-field-un.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/decl_field/decl-field-un.params.yaml @@ -159,7 +159,7 @@ cases: - { from_type: 'A', ref_type: 'A', expr: 'a', eq: '===' } - { from_type: 'B', ref_type: 'B', expr: 'b', eq: '===' } - { from_type: 'float', ref_type: 'Float', expr: '2.5e02f', eq: '==' } - - { from_type: 'short', ref_type: 'Short', expr: '0x8001 as short', eq: '==' } + - { from_type: 'short', ref_type: 'Short', expr: '(0x8001).toShort()', eq: '==' } - { from_type: 'boolean', ref_type: 'Boolean', expr: '!!false', eq: '==' } - { from_type: 'undefined', ref_type: 'undefined', expr: 'u', eq: '==' } - { from_type: 'null', ref_type: 'null', expr: 'n', eq: '==' } diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/decl_field/decl-field-wd.params.yaml b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/decl_field/decl-field-wd.params.yaml index b33d973889feddfbf350bd7774701ec60f1b6aa8..923271b994f045a08de7cbc1347ba5bef99cc6ac 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/decl_field/decl-field-wd.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/decl_field/decl-field-wd.params.yaml @@ -24,8 +24,8 @@ cases: decl: |- let vByte: Byte = new Byte(127 as byte) let vInt: Int = new Int(-7) - let vShort: Short = new Short(0xCAFE as short) - let vLong: Long = new Long(0o777 as long) + let vShort: Short = new Short((0xCAFE).toShort()) + let vLong: Long = new Long((0o777).toLong()) values: - { from_type: 'Byte|Long', expr: vByte, eq: '===' } - { from_type: 'Short|Byte|Int', expr: vInt, eq: '===' } @@ -64,8 +64,8 @@ cases: decl: |- let vByte: Byte = new Byte(127 as byte) let vInt: Int = new Int(-7) - let vShort: Short = new Short(0xCAFE as short) - let vLong: Long = new Long(0o777 as long) + let vShort: Short = new Short((0xCAFE).toShort()) + let vLong: Long = new Long((0o777).toLong()) let vFloat: Float = new Float(3.5f) let vDouble: Double = new Double(-1.1E-20) let vNumber: Number = new Number(1234567e8) @@ -81,9 +81,9 @@ cases: init_value: 0 values: - { from_type: 'byte|boolean|char', ref_type: Byte, expr: '127 as byte', eq: '==' } - - { from_type: 'short|char|string|double', ref_type: Short, expr: '0xCAFE as short', eq: '==' } + - { from_type: 'short|char|string|double', ref_type: Short, expr: '(0xCAFE).toShort()', eq: '==' } - { from_type: 'int|boolean', ref_type: Int, expr: -7, eq: '==' } - - { from_type: 'long|string|long|string|boolean', ref_type: Long, expr: 0o777 as long, eq: '==' } + - { from_type: 'long|string|long|string|boolean', ref_type: Long, expr: (0o777).toLong(), eq: '==' } - { from_type: 'char|byte|short', ref_type: Char, expr: "c'\\u5C5C'", eq: '==' } - { from_type: 'boolean|string', ref_type: Boolean, expr: 'false', eq: '==' } - { from_type: 'float|bigint', ref_type: Float, expr: 3.5f, eq: '==' } diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/decl_var/decl-var-un.params.yaml b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/decl_var/decl-var-un.params.yaml index 23f845f9d0b7d9ae1b0f63fc1f338bf47cc365f1..230645c5dca679cc56c87ff9f26bff8da8492696 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/decl_var/decl-var-un.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/decl_var/decl-var-un.params.yaml @@ -152,7 +152,7 @@ cases: - { from_type: 'A', ref_type: 'A', expr: 'a', eq: '===' } - { from_type: 'B', ref_type: 'B', expr: 'b', eq: '===' } - { from_type: 'float', ref_type: 'Float', expr: '2.5e02f', eq: '==' } - - { from_type: 'short', ref_type: 'Short', expr: '0x8001 as short', eq: '==' } + - { from_type: 'short', ref_type: 'Short', expr: '(0x8001).toShort()', eq: '==' } - { from_type: 'boolean', ref_type: 'Boolean', expr: '!!false', eq: '==' } - { from_type: 'undefined', ref_type: 'undefined', expr: 'u', eq: '==' } - { from_type: 'null', ref_type: 'null', expr: 'n', eq: '==' } diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/decl_var/decl-var-wd.params.yaml b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/decl_var/decl-var-wd.params.yaml index e15ee3523b41c881c23fbfe611abfdad46fc9f6c..3d82df9c0e7b10bbf3cfda8d2522b78a183a2501 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/decl_var/decl-var-wd.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/04.widening_union_conversions/decl_var/decl-var-wd.params.yaml @@ -23,8 +23,8 @@ cases: decl: |- let vByte: Byte = new Byte(127 as byte) let vInt: Int = new Int(-7) - let vShort: Short = new Short(0xCAFE as short) - let vLong: Long = new Long(0o777 as long) + let vShort: Short = new Short((0xCAFE).toShort()) + let vLong: Long = new Long((0o777).toLong()) values: - { from_type: 'Byte|Long', expr: vByte, eq: '===' } - { from_type: 'Short|Byte|Int', expr: vInt, eq: '===' } @@ -61,8 +61,8 @@ cases: decl: |- let vByte: Byte = new Byte(127 as byte) let vInt: Int = new Int(-7) - let vShort: Short = new Short(0xCAFE as short) - let vLong: Long = new Long(0o777 as long) + let vShort: Short = new Short((0xCAFE).toShort()) + let vLong: Long = new Long((0o777).toLong()) let vFloat: Float = new Float(3.5f) let vDouble: Double = new Double(-1.1E-20) let vNumber: Number = new Number(1234567e8) @@ -77,9 +77,9 @@ cases: - to_type: byte|short|int|long|boolean|char|float|double|bigint|string values: - { from_type: 'byte|boolean|char', ref_type: Byte, expr: '127 as byte', eq: '==' } - - { from_type: 'short|char|string|double', ref_type: Short, expr: '0xCAFE as short', eq: '==' } + - { from_type: 'short|char|string|double', ref_type: Short, expr: '(0xCAFE).toShort()', eq: '==' } - { from_type: 'int|boolean', ref_type: Int, expr: -7, eq: '==' } - - { from_type: 'long|string|long|string|boolean', ref_type: Long, expr: 0o777 as long, eq: '==' } + - { from_type: 'long|string|long|string|boolean', ref_type: Long, expr: (0o777).toLong(), eq: '==' } - { from_type: 'char|byte|short', ref_type: Char, expr: "c'\\u5C5C'", eq: '==' } - { from_type: 'boolean|string', ref_type: Boolean, expr: 'false', eq: '==' } - { from_type: 'float|bigint', ref_type: Float, expr: 3.5f, eq: '==' } diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/05.widening_reference_conversions/assn_var/assn-var.params.yaml b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/05.widening_reference_conversions/assn_var/assn-var.params.yaml index 9020a840ef291dd1a06cff85a59c35c4b5f49dd9..c10c056c39b7fed470b061ac658f1c0b0c8802fb 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/05.widening_reference_conversions/assn_var/assn-var.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/05.widening_reference_conversions/assn_var/assn-var.params.yaml @@ -44,16 +44,15 @@ cases: - from_type: Float values: - { to_type: Floating, expr: new Float(Byte.MIN_VALUE.toFloat()) } - - { to_type: Numeric, expr: new Float(-0.0 as float) } - - { to_type: Object, expr: new Float(+0.0 as float) } - - { to_type: Comparable, expr: new Float(+0.0 as float) } + - { to_type: Numeric, expr: new Float(-0.0f) } + - { to_type: Comparable, expr: new Float(+0.0f) } - from_type: Double values: - { to_type: Floating, expr: new Double(Byte.MIN_VALUE.toDouble()) } - - { to_type: Numeric, expr: new Double(-0.0 as float) } - - { to_type: Object, expr: new Double(+0.0 as float) } - - { to_type: Comparable, expr: new Double(+0.0 as float) } + - { to_type: Numeric, expr: new Double(-0.0f) } + - { to_type: Object, expr: new Double(+0.0f) } + - { to_type: Comparable, expr: new Double(+0.0f) } - from_type: Char values: diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/05.widening_reference_conversions/call_cons/call-cons.params.yaml b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/05.widening_reference_conversions/call_cons/call-cons.params.yaml index 9020a840ef291dd1a06cff85a59c35c4b5f49dd9..d2c5245cd292a92b930aa1df00a08674d53d82f1 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/05.widening_reference_conversions/call_cons/call-cons.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/05.widening_reference_conversions/call_cons/call-cons.params.yaml @@ -44,16 +44,16 @@ cases: - from_type: Float values: - { to_type: Floating, expr: new Float(Byte.MIN_VALUE.toFloat()) } - - { to_type: Numeric, expr: new Float(-0.0 as float) } - - { to_type: Object, expr: new Float(+0.0 as float) } - - { to_type: Comparable, expr: new Float(+0.0 as float) } + - { to_type: Numeric, expr: new Float(-0.0f) } + - { to_type: Object, expr: new Float(+0.0f) } + - { to_type: Comparable, expr: new Float(+0.0f) } - from_type: Double values: - { to_type: Floating, expr: new Double(Byte.MIN_VALUE.toDouble()) } - - { to_type: Numeric, expr: new Double(-0.0 as float) } - - { to_type: Object, expr: new Double(+0.0 as float) } - - { to_type: Comparable, expr: new Double(+0.0 as float) } + - { to_type: Numeric, expr: new Double(-0.0f) } + - { to_type: Object, expr: new Double(+0.0f) } + - { to_type: Comparable, expr: new Double(+0.0f) } - from_type: Char values: diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/05.widening_reference_conversions/call_func/call-func.params.yaml b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/05.widening_reference_conversions/call_func/call-func.params.yaml index 9020a840ef291dd1a06cff85a59c35c4b5f49dd9..d2c5245cd292a92b930aa1df00a08674d53d82f1 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/05.widening_reference_conversions/call_func/call-func.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/05.widening_reference_conversions/call_func/call-func.params.yaml @@ -44,16 +44,16 @@ cases: - from_type: Float values: - { to_type: Floating, expr: new Float(Byte.MIN_VALUE.toFloat()) } - - { to_type: Numeric, expr: new Float(-0.0 as float) } - - { to_type: Object, expr: new Float(+0.0 as float) } - - { to_type: Comparable, expr: new Float(+0.0 as float) } + - { to_type: Numeric, expr: new Float(-0.0f) } + - { to_type: Object, expr: new Float(+0.0f) } + - { to_type: Comparable, expr: new Float(+0.0f) } - from_type: Double values: - { to_type: Floating, expr: new Double(Byte.MIN_VALUE.toDouble()) } - - { to_type: Numeric, expr: new Double(-0.0 as float) } - - { to_type: Object, expr: new Double(+0.0 as float) } - - { to_type: Comparable, expr: new Double(+0.0 as float) } + - { to_type: Numeric, expr: new Double(-0.0f) } + - { to_type: Object, expr: new Double(+0.0f) } + - { to_type: Comparable, expr: new Double(+0.0f) } - from_type: Char values: diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/05.widening_reference_conversions/call_lmbd/call-lmbd.params.yaml b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/05.widening_reference_conversions/call_lmbd/call-lmbd.params.yaml index 9020a840ef291dd1a06cff85a59c35c4b5f49dd9..d2c5245cd292a92b930aa1df00a08674d53d82f1 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/05.widening_reference_conversions/call_lmbd/call-lmbd.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/05.widening_reference_conversions/call_lmbd/call-lmbd.params.yaml @@ -44,16 +44,16 @@ cases: - from_type: Float values: - { to_type: Floating, expr: new Float(Byte.MIN_VALUE.toFloat()) } - - { to_type: Numeric, expr: new Float(-0.0 as float) } - - { to_type: Object, expr: new Float(+0.0 as float) } - - { to_type: Comparable, expr: new Float(+0.0 as float) } + - { to_type: Numeric, expr: new Float(-0.0f) } + - { to_type: Object, expr: new Float(+0.0f) } + - { to_type: Comparable, expr: new Float(+0.0f) } - from_type: Double values: - { to_type: Floating, expr: new Double(Byte.MIN_VALUE.toDouble()) } - - { to_type: Numeric, expr: new Double(-0.0 as float) } - - { to_type: Object, expr: new Double(+0.0 as float) } - - { to_type: Comparable, expr: new Double(+0.0 as float) } + - { to_type: Numeric, expr: new Double(-0.0f) } + - { to_type: Object, expr: new Double(+0.0f) } + - { to_type: Comparable, expr: new Double(+0.0f) } - from_type: Char values: diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/05.widening_reference_conversions/call_meth/call-meth.params.yaml b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/05.widening_reference_conversions/call_meth/call-meth.params.yaml index 9020a840ef291dd1a06cff85a59c35c4b5f49dd9..d2c5245cd292a92b930aa1df00a08674d53d82f1 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/05.widening_reference_conversions/call_meth/call-meth.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/05.widening_reference_conversions/call_meth/call-meth.params.yaml @@ -44,16 +44,16 @@ cases: - from_type: Float values: - { to_type: Floating, expr: new Float(Byte.MIN_VALUE.toFloat()) } - - { to_type: Numeric, expr: new Float(-0.0 as float) } - - { to_type: Object, expr: new Float(+0.0 as float) } - - { to_type: Comparable, expr: new Float(+0.0 as float) } + - { to_type: Numeric, expr: new Float(-0.0f) } + - { to_type: Object, expr: new Float(+0.0f) } + - { to_type: Comparable, expr: new Float(+0.0f) } - from_type: Double values: - { to_type: Floating, expr: new Double(Byte.MIN_VALUE.toDouble()) } - - { to_type: Numeric, expr: new Double(-0.0 as float) } - - { to_type: Object, expr: new Double(+0.0 as float) } - - { to_type: Comparable, expr: new Double(+0.0 as float) } + - { to_type: Numeric, expr: new Double(-0.0f) } + - { to_type: Object, expr: new Double(+0.0f) } + - { to_type: Comparable, expr: new Double(+0.0f) } - from_type: Char values: diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/05.widening_reference_conversions/comp_arr/comp-arr.params.yaml b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/05.widening_reference_conversions/comp_arr/comp-arr.params.yaml index 1643b2e0c01bcbe0384545f589bcbb87295fff89..823ec86789c82f7da3503941b5a61d8104233018 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/05.widening_reference_conversions/comp_arr/comp-arr.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/05.widening_reference_conversions/comp_arr/comp-arr.params.yaml @@ -44,16 +44,16 @@ cases: - from_type: Float values: - { to_type: Floating, expr: new Float(Byte.MIN_VALUE.toFloat()) } - - { to_type: Numeric, expr: new Float(-0.0 as float) } - - { to_type: Object, expr: new Float(+0.0 as float) } - - { to_type: Comparable, expr: new Float(+0.0 as float) } + - { to_type: Numeric, expr: new Float(-0.0f) } + - { to_type: Object, expr: new Float(+0.0f) } + - { to_type: Comparable, expr: new Float(+0.0f) } - from_type: Double values: - { to_type: Floating, expr: new Double(Byte.MIN_VALUE.toDouble()) } - - { to_type: Numeric, expr: new Double(-0.0 as float) } - - { to_type: Object, expr: new Double(+0.0 as float) } - - { to_type: Comparable, expr: new Double(+0.0 as float) } + - { to_type: Numeric, expr: new Double(-0.0f) } + - { to_type: Object, expr: new Double(+0.0f) } + - { to_type: Comparable, expr: new Double(+0.0f) } - from_type: Char values: diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/05.widening_reference_conversions/comp_obj/comp-clss.params.yaml b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/05.widening_reference_conversions/comp_obj/comp-clss.params.yaml index 0551a42405c082000ce3cc39537e1773f15cb754..9013b34247ce3fa592497fb8ad69ce7c2db57a5d 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/05.widening_reference_conversions/comp_obj/comp-clss.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/05.widening_reference_conversions/comp_obj/comp-clss.params.yaml @@ -44,16 +44,16 @@ cases: - from_type: Float values: - { to_type: Floating, init_value: 0.0, expr: new Float(Byte.MIN_VALUE.toFloat()) } - - { to_type: Numeric, init_value: 0, expr: new Float(-0.0 as float) } - - { to_type: Object, init_value: new Object(), expr: new Float(+0.0 as float) } - - { to_type: Comparable, init_value: new Float(), expr: new Float(+0.0 as float) } + - { to_type: Numeric, init_value: 0, expr: new Float(-0.0f) } + - { to_type: Object, init_value: new Object(), expr: new Float(+0.0f) } + - { to_type: Comparable, init_value: new Float(), expr: new Float(+0.0f) } - from_type: Double values: - { to_type: Floating, init_value: 0.0, expr: new Double(Byte.MIN_VALUE.toDouble()) } - - { to_type: Numeric, init_value: 0, expr: new Double(-0.0 as float) } - - { to_type: Object, init_value: new Object(), expr: new Double(+0.0 as float) } - - { to_type: Comparable, init_value: new Double(), expr: new Double(+0.0 as float) } + - { to_type: Numeric, init_value: 0, expr: new Double(-0.0f) } + - { to_type: Object, init_value: new Object(), expr: new Double(+0.0f) } + - { to_type: Comparable, init_value: new Double(), expr: new Double(+0.0f) } - from_type: Char values: diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/05.widening_reference_conversions/comp_obj/comp-intf.params.yaml b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/05.widening_reference_conversions/comp_obj/comp-intf.params.yaml index 9020a840ef291dd1a06cff85a59c35c4b5f49dd9..d2c5245cd292a92b930aa1df00a08674d53d82f1 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/05.widening_reference_conversions/comp_obj/comp-intf.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/05.widening_reference_conversions/comp_obj/comp-intf.params.yaml @@ -44,16 +44,16 @@ cases: - from_type: Float values: - { to_type: Floating, expr: new Float(Byte.MIN_VALUE.toFloat()) } - - { to_type: Numeric, expr: new Float(-0.0 as float) } - - { to_type: Object, expr: new Float(+0.0 as float) } - - { to_type: Comparable, expr: new Float(+0.0 as float) } + - { to_type: Numeric, expr: new Float(-0.0f) } + - { to_type: Object, expr: new Float(+0.0f) } + - { to_type: Comparable, expr: new Float(+0.0f) } - from_type: Double values: - { to_type: Floating, expr: new Double(Byte.MIN_VALUE.toDouble()) } - - { to_type: Numeric, expr: new Double(-0.0 as float) } - - { to_type: Object, expr: new Double(+0.0 as float) } - - { to_type: Comparable, expr: new Double(+0.0 as float) } + - { to_type: Numeric, expr: new Double(-0.0f) } + - { to_type: Object, expr: new Double(+0.0f) } + - { to_type: Comparable, expr: new Double(+0.0f) } - from_type: Char values: diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/05.widening_reference_conversions/decl_const/decl-const.params.yaml b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/05.widening_reference_conversions/decl_const/decl-const.params.yaml index 2894b66feb060153216f6c2187851a453c571e20..fafee067eed3d845e042f7f2343a6ae09ca5bf67 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/05.widening_reference_conversions/decl_const/decl-const.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/05.widening_reference_conversions/decl_const/decl-const.params.yaml @@ -44,9 +44,9 @@ cases: - from_type: Float values: - { to_type: Floating, expr: new Float(Byte.MIN_VALUE.toFloat()) } - - { to_type: Numeric, expr: new Float(-0.0 as float) } - - { to_type: Object, expr: new Float(+0.0 as float) } - - { to_type: Comparable, expr: new Float(+0.0 as float) } + - { to_type: Numeric, expr: new Float(-0.0f) } + - { to_type: Object, expr: new Float(+0.0f) } + - { to_type: Comparable, expr: new Float(+0.0f) } - from_type: Double values: diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/05.widening_reference_conversions/decl_field/decl-field.params.yaml b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/05.widening_reference_conversions/decl_field/decl-field.params.yaml index 2894b66feb060153216f6c2187851a453c571e20..fafee067eed3d845e042f7f2343a6ae09ca5bf67 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/05.widening_reference_conversions/decl_field/decl-field.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/05.widening_reference_conversions/decl_field/decl-field.params.yaml @@ -44,9 +44,9 @@ cases: - from_type: Float values: - { to_type: Floating, expr: new Float(Byte.MIN_VALUE.toFloat()) } - - { to_type: Numeric, expr: new Float(-0.0 as float) } - - { to_type: Object, expr: new Float(+0.0 as float) } - - { to_type: Comparable, expr: new Float(+0.0 as float) } + - { to_type: Numeric, expr: new Float(-0.0f) } + - { to_type: Object, expr: new Float(+0.0f) } + - { to_type: Comparable, expr: new Float(+0.0f) } - from_type: Double values: diff --git a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/05.widening_reference_conversions/decl_var/decl-var.params.yaml b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/05.widening_reference_conversions/decl_var/decl-var.params.yaml index 6df5339c54f94cf1bbe134069394450e0cef56fb..e3ee088930a537ff48b2c690aaecd403b4389d9d 100644 --- a/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/05.widening_reference_conversions/decl_var/decl-var.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates_deprecated/06.contexts_and_conversions/05.implicit_conversions/05.widening_reference_conversions/decl_var/decl-var.params.yaml @@ -44,9 +44,9 @@ cases: - from_type: Float values: - { to_type: Floating, expr: new Float(Byte.MIN_VALUE.toFloat()) } - - { to_type: Numeric, expr: new Float(-0.0 as float) } - - { to_type: Object, expr: new Float(+0.0 as float) } - - { to_type: Comparable, expr: new Float(+0.0 as float) } + - { to_type: Numeric, expr: new Float(-0.0f) } + - { to_type: Object, expr: new Float(+0.0f) } + - { to_type: Comparable, expr: new Float(+0.0f) } - from_type: Double values: diff --git a/static_core/plugins/ets/tests/ets_func_tests/escompat/ArrayTestDerived.ets b/static_core/plugins/ets/tests/ets_func_tests/escompat/ArrayTestDerived.ets index 26c1fbf143d6f9cb8f05d16c0188a031fce30636..6c52f9fc79a5a6a5b51655dc31302cfc777455df 100644 --- a/static_core/plugins/ets/tests/ets_func_tests/escompat/ArrayTestDerived.ets +++ b/static_core/plugins/ets/tests/ets_func_tests/escompat/ArrayTestDerived.ets @@ -41,14 +41,14 @@ function __noinline__atOutside(a: Array) { function main(): int { let a = new Derived(10); for (let i = 0; i < 10; i++) { - a[i] = i as number; + a[i] = i.toDouble(); } arktest.assertEQ(__noinline__getOutside(a), DERIVED_ACCESS_OFFSET); arktest.assertEQ(__noinline__atOutside(a), DERIVED_ACCESS_OFFSET); let b = new Array(10); for (let i = 0; i < 10; i++) { - b[i] = i as number; + b[i] = i.toDouble(); } arktest.assertEQ(__noinline__getOutside(b), 0); arktest.assertEQ(__noinline__atOutside(b), 0); diff --git a/static_core/plugins/ets/tests/ets_func_tests/regression/16657.ets b/static_core/plugins/ets/tests/ets_func_tests/regression/16657.ets index e4ab7e7bf56170d9f9e4cd0b0ed0cbd6c697db7b..9ff3883cb718806417755841b4caace71a09fc28 100644 --- a/static_core/plugins/ets/tests/ets_func_tests/regression/16657.ets +++ b/static_core/plugins/ets/tests/ets_func_tests/regression/16657.ets @@ -29,9 +29,9 @@ class TimeAnimationImpl { } } -function smoothAnimation(period: int, from: float = 0.0 as float, to: float = 0.0 as float): TimeAnimationImpl { +function smoothAnimation(period: int, from: float = 0.0f, to: float = 0.0f): TimeAnimationImpl { if (!isFinite(period) || (period < 1)) throw new Error("illegal period: " + period) - return new TimeAnimationImpl((time:long): float => (1 - Math.cos(time / period * Math.PI) as float) / 2 * (to - from) + from) + return new TimeAnimationImpl((time:long): float => (1 - Math.cos(time / period * Math.PI).toFloat()) / 2 * (to - from) + from) } diff --git a/static_core/plugins/ets/tests/ets_func_tests/spec/15.Semantic_Rules/Compatibility_Features/Extended_Conditional_Expressions/numeric/expr/numeric-float-nonzero-expression.ets b/static_core/plugins/ets/tests/ets_func_tests/spec/15.Semantic_Rules/Compatibility_Features/Extended_Conditional_Expressions/numeric/expr/numeric-float-nonzero-expression.ets index e827135d63344a7d26f3cf3f9f34a1d9d68bbb48..d25600310957f96fef473f361e969d66ff976fce 100644 --- a/static_core/plugins/ets/tests/ets_func_tests/spec/15.Semantic_Rules/Compatibility_Features/Extended_Conditional_Expressions/numeric/expr/numeric-float-nonzero-expression.ets +++ b/static_core/plugins/ets/tests/ets_func_tests/spec/15.Semantic_Rules/Compatibility_Features/Extended_Conditional_Expressions/numeric/expr/numeric-float-nonzero-expression.ets @@ -20,7 +20,7 @@ tags: [] function main() : int { - let nonZeroNumber: float = 1.0 as float; + let nonZeroNumber: float = 1.0f; if (nonZeroNumber) { return 0; } else { diff --git a/static_core/plugins/ets/tests/ets_func_tests/spec/15.Semantic_Rules/Compatibility_Features/Extended_Conditional_Expressions/numeric/expr/numeric-float-nonzero-ternary-operator-expression.ets b/static_core/plugins/ets/tests/ets_func_tests/spec/15.Semantic_Rules/Compatibility_Features/Extended_Conditional_Expressions/numeric/expr/numeric-float-nonzero-ternary-operator-expression.ets index ee29c15f4d977541fe6a4957095611e51dc5ee80..b15f3a73813ae8b247a14cf0e5d91a4c2a71c24b 100644 --- a/static_core/plugins/ets/tests/ets_func_tests/spec/15.Semantic_Rules/Compatibility_Features/Extended_Conditional_Expressions/numeric/expr/numeric-float-nonzero-ternary-operator-expression.ets +++ b/static_core/plugins/ets/tests/ets_func_tests/spec/15.Semantic_Rules/Compatibility_Features/Extended_Conditional_Expressions/numeric/expr/numeric-float-nonzero-ternary-operator-expression.ets @@ -20,7 +20,7 @@ tags: [] function main(): int { - let nonZero: float = 1.0 as float; + let nonZero: float = 1.0f; let result = nonZero ? 0 : 1; return result; } diff --git a/static_core/plugins/ets/tests/ets_func_tests/spec/15.Semantic_Rules/Compatibility_Features/Extended_Conditional_Expressions/numeric/expr/numeric-float-zero-epsilon-expression.ets b/static_core/plugins/ets/tests/ets_func_tests/spec/15.Semantic_Rules/Compatibility_Features/Extended_Conditional_Expressions/numeric/expr/numeric-float-zero-epsilon-expression.ets index c1457ef1a56ba5c1b540fcfe89fe6efd81be128c..d47c13a937d6e381a757fcf23165d3660c315d30 100644 --- a/static_core/plugins/ets/tests/ets_func_tests/spec/15.Semantic_Rules/Compatibility_Features/Extended_Conditional_Expressions/numeric/expr/numeric-float-zero-epsilon-expression.ets +++ b/static_core/plugins/ets/tests/ets_func_tests/spec/15.Semantic_Rules/Compatibility_Features/Extended_Conditional_Expressions/numeric/expr/numeric-float-zero-epsilon-expression.ets @@ -20,7 +20,7 @@ tags: [] function main() : int { - let epsilon: float = (0.0 as float) + Float.EPSILON; + let epsilon: float = (0.0f) + Float.EPSILON; if (epsilon) { return 0 } else { diff --git a/static_core/plugins/ets/tests/ets_func_tests/spec/15.Semantic_Rules/Compatibility_Features/Extended_Conditional_Expressions/numeric/expr/numeric-float-zero-expression.ets b/static_core/plugins/ets/tests/ets_func_tests/spec/15.Semantic_Rules/Compatibility_Features/Extended_Conditional_Expressions/numeric/expr/numeric-float-zero-expression.ets index 40e7d77117f5c7bd946d98881842f37198297a49..094070865dc2678fb8ab2bd9c4ee4466d54bad6c 100644 --- a/static_core/plugins/ets/tests/ets_func_tests/spec/15.Semantic_Rules/Compatibility_Features/Extended_Conditional_Expressions/numeric/expr/numeric-float-zero-expression.ets +++ b/static_core/plugins/ets/tests/ets_func_tests/spec/15.Semantic_Rules/Compatibility_Features/Extended_Conditional_Expressions/numeric/expr/numeric-float-zero-expression.ets @@ -20,7 +20,7 @@ tags: [] function main() : int { - let zeroNumber: float = 0.0 as float; + let zeroNumber: float = 0.0f; if (zeroNumber) { return 1; } else { diff --git a/static_core/plugins/ets/tests/ets_func_tests/spec/15.Semantic_Rules/Compatibility_Features/Extended_Conditional_Expressions/numeric/expr/numeric-float-zero-object-expression.ets b/static_core/plugins/ets/tests/ets_func_tests/spec/15.Semantic_Rules/Compatibility_Features/Extended_Conditional_Expressions/numeric/expr/numeric-float-zero-object-expression.ets index 7eb27e07e6633bbd2574e72a3249af3909726df2..fd7507a44a657f98937f3f4c8b805d4102978ef6 100644 --- a/static_core/plugins/ets/tests/ets_func_tests/spec/15.Semantic_Rules/Compatibility_Features/Extended_Conditional_Expressions/numeric/expr/numeric-float-zero-object-expression.ets +++ b/static_core/plugins/ets/tests/ets_func_tests/spec/15.Semantic_Rules/Compatibility_Features/Extended_Conditional_Expressions/numeric/expr/numeric-float-zero-object-expression.ets @@ -20,7 +20,7 @@ tags: [] function main() : int { - let zeroNumber: Float = new Float(0.0 as float); + let zeroNumber: Float = new Float(0.0f); if (zeroNumber) { return 1; } else { diff --git a/static_core/plugins/ets/tests/ets_func_tests/spec/15.Semantic_Rules/Compatibility_Features/Extended_Conditional_Expressions/numeric/expr/numeric-float-zero-ternary-operator-expression.ets b/static_core/plugins/ets/tests/ets_func_tests/spec/15.Semantic_Rules/Compatibility_Features/Extended_Conditional_Expressions/numeric/expr/numeric-float-zero-ternary-operator-expression.ets index 7b425d3e4d8e044d5e7bef2adb22012d47950169..8c08c728873df20935d5506acacbf097cf9e8da3 100644 --- a/static_core/plugins/ets/tests/ets_func_tests/spec/15.Semantic_Rules/Compatibility_Features/Extended_Conditional_Expressions/numeric/expr/numeric-float-zero-ternary-operator-expression.ets +++ b/static_core/plugins/ets/tests/ets_func_tests/spec/15.Semantic_Rules/Compatibility_Features/Extended_Conditional_Expressions/numeric/expr/numeric-float-zero-ternary-operator-expression.ets @@ -20,7 +20,7 @@ tags: [] function main(): int { - let zeroNumber: float = 0 as float; + let zeroNumber: float = 0.0f; let result = zeroNumber ? 1 : 0; return result; } diff --git a/static_core/plugins/ets/tests/ets_func_tests/spec/15.Semantic_Rules/Compatibility_Features/Extended_Conditional_Expressions/numeric/loop/numeric-loop-do-while-float-in.ets b/static_core/plugins/ets/tests/ets_func_tests/spec/15.Semantic_Rules/Compatibility_Features/Extended_Conditional_Expressions/numeric/loop/numeric-loop-do-while-float-in.ets index a1ebafd472a2c61e25fe12df6c69537ee254f22c..0fe480c56549da0b1d0b26a4a71038e7446e5294 100644 --- a/static_core/plugins/ets/tests/ets_func_tests/spec/15.Semantic_Rules/Compatibility_Features/Extended_Conditional_Expressions/numeric/loop/numeric-loop-do-while-float-in.ets +++ b/static_core/plugins/ets/tests/ets_func_tests/spec/15.Semantic_Rules/Compatibility_Features/Extended_Conditional_Expressions/numeric/loop/numeric-loop-do-while-float-in.ets @@ -20,7 +20,7 @@ tags: [] function main(): int { - let nonZeroNumber: float = 1.0 as float; + let nonZeroNumber: float = 1.0f; let counter : int = 0; do { counter = counter + 1; diff --git a/static_core/plugins/ets/tests/ets_func_tests/spec/15.Semantic_Rules/Compatibility_Features/Extended_Conditional_Expressions/numeric/loop/numeric-loop-do-while-float.ets b/static_core/plugins/ets/tests/ets_func_tests/spec/15.Semantic_Rules/Compatibility_Features/Extended_Conditional_Expressions/numeric/loop/numeric-loop-do-while-float.ets index 825bc2e9c1815947216fbfa926b3c484340f7936..a7b8c98e7d9282857e8c21ab5719a7ed118b9254 100644 --- a/static_core/plugins/ets/tests/ets_func_tests/spec/15.Semantic_Rules/Compatibility_Features/Extended_Conditional_Expressions/numeric/loop/numeric-loop-do-while-float.ets +++ b/static_core/plugins/ets/tests/ets_func_tests/spec/15.Semantic_Rules/Compatibility_Features/Extended_Conditional_Expressions/numeric/loop/numeric-loop-do-while-float.ets @@ -20,7 +20,7 @@ tags: [] function main(): int { - let zeroNumber: float = 0.0 as float; + let zeroNumber: float = 0.0f; let counter : int = 0; do { counter = counter + 1; diff --git a/static_core/plugins/ets/tests/ets_func_tests/spec/15.Semantic_Rules/Compatibility_Features/Extended_Conditional_Expressions/numeric/loop/numeric-loop-while-float-in.ets b/static_core/plugins/ets/tests/ets_func_tests/spec/15.Semantic_Rules/Compatibility_Features/Extended_Conditional_Expressions/numeric/loop/numeric-loop-while-float-in.ets index 76d74a6b560612880c295f5564172d70e39a6c17..582b0d84ec38596064525a336b5e830c929613d4 100644 --- a/static_core/plugins/ets/tests/ets_func_tests/spec/15.Semantic_Rules/Compatibility_Features/Extended_Conditional_Expressions/numeric/loop/numeric-loop-while-float-in.ets +++ b/static_core/plugins/ets/tests/ets_func_tests/spec/15.Semantic_Rules/Compatibility_Features/Extended_Conditional_Expressions/numeric/loop/numeric-loop-while-float-in.ets @@ -20,7 +20,7 @@ tags: [] function main(): int { - let nonZeroNumber: float = 1.0 as float; + let nonZeroNumber: float = 1.0f; let counter : int = 0; while(nonZeroNumber) { counter = counter + 1; diff --git a/static_core/plugins/ets/tests/ets_func_tests/spec/15.Semantic_Rules/Compatibility_Features/Extended_Conditional_Expressions/numeric/loop/numeric-loop-while-float.ets b/static_core/plugins/ets/tests/ets_func_tests/spec/15.Semantic_Rules/Compatibility_Features/Extended_Conditional_Expressions/numeric/loop/numeric-loop-while-float.ets index 14905a3fccdc4c6cce55d3baab494d86c1b26f98..0bf1267d54edd9d8b917b02d64281168c051c0c2 100644 --- a/static_core/plugins/ets/tests/ets_func_tests/spec/15.Semantic_Rules/Compatibility_Features/Extended_Conditional_Expressions/numeric/loop/numeric-loop-while-float.ets +++ b/static_core/plugins/ets/tests/ets_func_tests/spec/15.Semantic_Rules/Compatibility_Features/Extended_Conditional_Expressions/numeric/loop/numeric-loop-while-float.ets @@ -20,7 +20,7 @@ tags: [] function main(): int { - let zeroNumber: float = 0.0 as float; + let zeroNumber: float = 0.0f; let counter : int = 0; while(zeroNumber) { counter = counter + 1; diff --git a/static_core/plugins/ets/tests/ets_func_tests/std/core/TypeCreateInterfaceTest.ets b/static_core/plugins/ets/tests/ets_func_tests/std/core/TypeCreateInterfaceTest.ets index c8d0fd408443969f09581af0d0105e9b35a58e27..1a53895dc4fbf7d1cbf23f5615d3b23f36cc1c74 100644 --- a/static_core/plugins/ets/tests/ets_func_tests/std/core/TypeCreateInterfaceTest.ets +++ b/static_core/plugins/ets/tests/ets_func_tests/std/core/TypeCreateInterfaceTest.ets @@ -28,7 +28,7 @@ class C implements I1, I2 { function getIfaces(): (InterfaceType | undefined)[] { const c = Type.of(new C()) as ClassType - let n = c.getInterfacesNum() as int + let n = c.getInterfacesNum().toInt() let r = new (InterfaceType | undefined)[n] for (let i = 0; i < n; i++) { r[i] = c.getInterface(i) diff --git a/static_core/plugins/ets/tests/ets_sdk/api/@ohos/buffer/BufferTests.ets b/static_core/plugins/ets/tests/ets_sdk/api/@ohos/buffer/BufferTests.ets index 19093c07f819cff2c6476c25af4875f4e34ae323..3fce1a56a0c2100b25913d9b54584e2116ad0148 100644 --- a/static_core/plugins/ets/tests/ets_sdk/api/@ohos/buffer/BufferTests.ets +++ b/static_core/plugins/ets/tests/ets_sdk/api/@ohos/buffer/BufferTests.ets @@ -529,35 +529,35 @@ function testWrite0009() { function testfrom0792() { let ab = new ArrayBuffer(100); - let buf = buffer.from(ab, 1.2 as int, 1.2 as int); + let buf = buffer.from(ab, (1.2).toInt(), (1.2).toInt()); let res = buf.toString('hex'); arktest.assertEQ(res, '00'); } function testfrom0793() { let ab = new ArrayBuffer(100); - let buf = buffer.from(ab, 1, 1.2 as int); + let buf = buffer.from(ab, 1, (1.2).toInt()); let res = buf.toString('hex'); arktest.assertEQ(res, '00'); } function testfrom0794() { let ab = new ArrayBuffer(100); - let buf = buffer.from(ab, 1.2 as int, 1); + let buf = buffer.from(ab, (1.2).toInt(), 1); let res = buf.toString('hex'); arktest.assertEQ(res, '00'); } function testfrom0795() { let ab = new ArrayBuffer(100); - let buf = buffer.from(ab, 9.9 as int, 9.9 as int); + let buf = buffer.from(ab, (9.9).toInt(), (9.9).toInt()); let res = buf.toString('hex'); arktest.assertEQ(res, '000000000000000000'); } function testfrom0796() { let ab = new ArrayBuffer(100); - let buf = buffer.from(ab, 2.9 as int , 2.9 as int); + let buf = buffer.from(ab, (2.9).toInt() , (2.9).toInt()); let res = buf.toString('hex'); arktest.assertEQ(res, '0000'); } diff --git a/static_core/plugins/ets/tests/ets_sdk/api/@ohos/util/PlainArray/PlainArrayForEachIteratorTests.ets b/static_core/plugins/ets/tests/ets_sdk/api/@ohos/util/PlainArray/PlainArrayForEachIteratorTests.ets index a154c491ff2cd94e0985d1d046f06f50d63e5736..dd0b5b5c1d20bbccae8a1c6956682d6059549abf 100644 --- a/static_core/plugins/ets/tests/ets_sdk/api/@ohos/util/PlainArray/PlainArrayForEachIteratorTests.ets +++ b/static_core/plugins/ets/tests/ets_sdk/api/@ohos/util/PlainArray/PlainArrayForEachIteratorTests.ets @@ -68,7 +68,7 @@ function testForEachWithOneParameter() { function testForEachWithTwoParameters() { let plainArray = new PlainArray(); for (let i: int = 0; i < TestData.forNumber2.length; i++) { - plainArray.add(TestData.forNumber2[i] as int, TestData.forNumber2[i]); + plainArray.add(TestData.forNumber2[i].toInt(), TestData.forNumber2[i]); } let forEachCount: int = 0; plainArray.forEach((value: double, index: int) => { diff --git a/static_core/plugins/ets/tests/ets_sdk/api/@ohos/util/PlainArray/PlainArrayForEachTest.ets b/static_core/plugins/ets/tests/ets_sdk/api/@ohos/util/PlainArray/PlainArrayForEachTest.ets index 8d4d421a1f14b810b8a7060b17c0455adfa33613..2dccffa053099444092f2d25dd1a8f1476bd38a9 100644 --- a/static_core/plugins/ets/tests/ets_sdk/api/@ohos/util/PlainArray/PlainArrayForEachTest.ets +++ b/static_core/plugins/ets/tests/ets_sdk/api/@ohos/util/PlainArray/PlainArrayForEachTest.ets @@ -86,7 +86,7 @@ function testSymbolIteratorWithStringValues() { let iter = plainArray.$_iterator(); let temp: IteratorResult<[Int, string]> = iter.next(); while (!temp.done) { - let key = temp.value![0] as double; + let key = temp.value![0].toDouble(); let value = temp.value![1] as string; arktest.assertEQ(plainArray.get(key.toInt()), value); temp = iter.next(); @@ -102,7 +102,7 @@ function testSymbolIteratorWithDuplicateStringValues() { let iter = plainArray.$_iterator(); let temp: IteratorResult<[Int, string]> = iter.next(); while (!temp.done) { - let key = temp.value![0] as double; + let key = temp.value![0].toDouble(); let value = temp.value![1] as string; arktest.assertEQ(plainArray.get(key.toInt()), value); temp = iter.next(); @@ -115,7 +115,7 @@ function testSymbolIteratorWithEmptyArray() { let iter = plainArray.$_iterator(); let temp: IteratorResult<[Int, string]> = iter.next(); while (!temp.done) { - let key = temp.value![0] as double; + let key = temp.value![0].toDouble(); let value = temp.value![1] as string; arktest.assertEQ(plainArray.get(key.toInt()), value); temp = iter.next(); diff --git a/static_core/plugins/ets/tests/ets_sdk/api/@ohos/xml/XmlSerializer/XmlSerializerSetAttributesTest.ets b/static_core/plugins/ets/tests/ets_sdk/api/@ohos/xml/XmlSerializer/XmlSerializerSetAttributesTest.ets index 4d38332f654f1e8762d9de69d499a913cfb900c2..c213b6364a719e966d9e63974aacf085ed59fab5 100644 --- a/static_core/plugins/ets/tests/ets_sdk/api/@ohos/xml/XmlSerializer/XmlSerializerSetAttributesTest.ets +++ b/static_core/plugins/ets/tests/ets_sdk/api/@ohos/xml/XmlSerializer/XmlSerializerSetAttributesTest.ets @@ -43,7 +43,7 @@ function main(): int { function performXmlTest( setupCallback: (serializer: xml.XmlSerializer) => void, expectedXml: string, - bufferSize: number = MaxBufferLength + bufferSize: number = MaxBufferLength.toDouble() ): void { const arrayBuffer = new ArrayBuffer(bufferSize); const serializer = new xml.XmlSerializer(arrayBuffer); diff --git a/static_core/plugins/ets/tests/ets_test_suite/gc/stress/test_gc_old.ets b/static_core/plugins/ets/tests/ets_test_suite/gc/stress/test_gc_old.ets index f1edc5f01955fc9d592022300abfcceae11e3df2..9e08dc3d23d2810dbfbc7fdc76d715f8c36ab791 100644 --- a/static_core/plugins/ets/tests/ets_test_suite/gc/stress/test_gc_old.ets +++ b/static_core/plugins/ets/tests/ets_test_suite/gc/stress/test_gc_old.ets @@ -24,7 +24,7 @@ class TreeNode { class Random { public nextInt(n: int): int { - return (random() * n) as int; + return (random() * n).toInt(); } } @@ -55,7 +55,7 @@ class TestGCOld { private static rnd = new Random(); private static init() : void { - let ntrees : int = ((TestGCOld.size * TestGCOld.MEG) / TestGCOld.treeSize) as int; + let ntrees : int = ((TestGCOld.size * TestGCOld.MEG) / TestGCOld.treeSize).toInt(); TestGCOld.trees = new (TreeNode | undefined)[ntrees]; console.println("Allocating " + ntrees + " trees."); @@ -115,7 +115,7 @@ class TestGCOld { TestGCOld.doAllocateForYoungGen(n, TestGCOld.WORDS_DEAD); TestGCOld.runMutation(n); TestGCOld.doAllocateForOldGen(n / TestGCOld.promoteRate); - TestGCOld.runMutationForOldGen(max(0, (mutations + TestGCOld.ptrMutRate) - TestGCOld.actuallyMut) as long); + TestGCOld.runMutationForOldGen(max(0, (mutations + TestGCOld.ptrMutRate) - TestGCOld.actuallyMut).toLong()); } private static doAllocateForYoungGen(n : long, nwords : int) : void { @@ -136,7 +136,7 @@ class TestGCOld { } private static doAllocateForOldGen(n : long) : void { - let full : int = (n / TestGCOld.treeSize) as int; + let full : int = (n / TestGCOld.treeSize).toInt(); let partial : long = n % TestGCOld.treeSize; for (let i : int = 0; i < full; i++) { @@ -159,8 +159,8 @@ class TestGCOld { } private static swapSubtreesForOldGen() : void { - let index1 : int = TestGCOld.rnd.nextInt(TestGCOld.trees.length as int); - let index2 : int = TestGCOld.rnd.nextInt(TestGCOld.trees.length as int); + let index1 : int = TestGCOld.rnd.nextInt(TestGCOld.trees.length.toInt()); + let index2 : int = TestGCOld.rnd.nextInt(TestGCOld.trees.length.toInt()); let depth : int = TestGCOld.rnd.nextInt(TestGCOld.treeHeight); let path : int = TestGCOld.rnd.nextInt(TestGCOld.treeHeight); let tn1 : TreeNode | undefined = TestGCOld.trees[index1]; @@ -234,23 +234,23 @@ class TestGCOld { console.println("Initialization complete..."); - let start : long = Date.now() as long; + let start : long = Date.now().toLong(); for(let step = 0; step < TestGCOld.steps; step++) { TestGCOld.executeStep(TestGCOld.MEG); } - let end : long = Date.now() as long; - let secs : float = ((end-start)/1000.0) as float; + let end : long = Date.now().toLong(); + let secs : float = ((end-start)/1000.0).toFloat(); console.println("\nTook " + secs + " sec in steady state."); console.println("Allocated " + TestGCOld.steps + " Mb of young gen garbage" - + " (= " + (TestGCOld.steps/secs) as float + " Mb/sec)"); - console.println(" (actually allocated " + (TestGCOld.youngBytes/TestGCOld.MEG) as float + " megabytes)"); - let promoted : float = (TestGCOld.steps / TestGCOld.promoteRate) as float; + + " (= " + (TestGCOld.steps/secs).toFloat() + " Mb/sec)"); + console.println(" (actually allocated " + (TestGCOld.youngBytes/TestGCOld.MEG).toFloat() + " megabytes)"); + let promoted : float = (TestGCOld.steps / TestGCOld.promoteRate).toFloat(); console.println("Promoted " + promoted + - " Mb (= " + (promoted/secs) as float + " Mb/sec)"); - console.println(" (actually promoted " + ((TestGCOld.nodes * TestGCOld.BYTES_PER_NODE)/TestGCOld.MEG) as float + " megabytes)"); + " Mb (= " + (promoted/secs).toFloat() + " Mb/sec)"); + console.println(" (actually promoted " + ((TestGCOld.nodes * TestGCOld.BYTES_PER_NODE)/TestGCOld.MEG).toFloat() + " megabytes)"); if (TestGCOld.ptrMutRate != 0) { console.println("Mutated " + TestGCOld.actuallyMut + " pointers (= " + TestGCOld.actuallyMut/secs + " ptrs/sec)"); diff --git a/static_core/plugins/ets/tests/stdlib-templates/spec/expressions/equality/equality_primitive_01.ets b/static_core/plugins/ets/tests/stdlib-templates/spec/expressions/equality/equality_primitive_01.ets index 7cd734595284dc7020bad163adf3d69facb2f351..4c37953d028fc52001ddb7f7efc3e36c81ca7d9d 100644 --- a/static_core/plugins/ets/tests/stdlib-templates/spec/expressions/equality/equality_primitive_01.ets +++ b/static_core/plugins/ets/tests/stdlib-templates/spec/expressions/equality/equality_primitive_01.ets @@ -16,13 +16,13 @@ {% for item in equality_primitive_01 %} /*--- -desc: {function: {{.item.type1}}_equal_{{.item.type2}}} +desc: {function: {{.item.type1|lower}}_equal_{{.item.type2|lower}}} tags: [] ---*/ function main(): void { - let left: {{.item.type1}} = {{.item.value1}} as {{.item.type1}} - let right: {{.item.type2}} = {{.item.value2}} as {{.item.type2}} + let left: {{.item.type1}} = ({{.item.value1}}).to{%if item.type1 == 'number'%}Double{%else%}{{.item.type1}}{%endif%}() + let right: {{.item.type2}} = ({{.item.value2}}).to{%if item.type2 == 'number'%}Double{%else%}{{.item.type2}}{%endif%}() let result1: boolean = left == right let result2: boolean = left === right arktest.assertEQ(result1, result2) diff --git a/static_core/plugins/ets/tests/stdlib-templates/spec/expressions/equality/list.equality_primitive_01.yaml b/static_core/plugins/ets/tests/stdlib-templates/spec/expressions/equality/list.equality_primitive_01.yaml index 1cb3eb2aff5ffa11a7d78cf13fff788c677d150b..3ddb0066bfb2ea79f4daf0951598eeee9ab2e8e0 100644 --- a/static_core/plugins/ets/tests/stdlib-templates/spec/expressions/equality/list.equality_primitive_01.yaml +++ b/static_core/plugins/ets/tests/stdlib-templates/spec/expressions/equality/list.equality_primitive_01.yaml @@ -13,45 +13,45 @@ # Compare floats - { - type1: "float", value1: "10.0", - type2: "float", value2: "2.3", + type1: "Float", value1: "10.0", + type2: "Float", value2: "2.3", result: "false" } - { - type1: "float", value1: "10.0", - type2: "float", value2: "10.0", + type1: "Float", value1: "10.0", + type2: "Float", value2: "10.0", result: "true" } - { - type1: "float", value1: "3.14157", - type2: "float", value2: "3.14157", + type1: "Float", value1: "3.14157", + type2: "Float", value2: "3.14157", result: "true" } - { - type1: "float", value1: "3.14157", - type2: "float", value2: "3.14158", + type1: "Float", value1: "3.14157", + type2: "Float", value2: "3.14158", result: "false" } # Compare doubles - { - type1: "double", value1: "10.0", - type2: "double", value2: "2.3", + type1: "Double", value1: "10.0", + type2: "Double", value2: "2.3", result: "false" } - { - type1: "double", value1: "10.0", - type2: "double", value2: "10.0", + type1: "Double", value1: "10.0", + type2: "Double", value2: "10.0", result: "true" } - { - type1: "double", value1: "3.14157", - type2: "double", value2: "3.14157", + type1: "Double", value1: "3.14157", + type2: "Double", value2: "3.14157", result: "true" } - { - type1: "double", value1: "3.14157", - type2: "double", value2: "3.14158", + type1: "Double", value1: "3.14157", + type2: "Double", value2: "3.14158", result: "false" } @@ -94,48 +94,48 @@ # Compare longs - { - type1: "long", value1: "1234567890", - type2: "long", value2: "1234567891", + type1: "Long", value1: "1234567890", + type2: "Long", value2: "1234567891", result: "false" } - { - type1: "long", value1: "1234567890", - type2: "long", value2: "1234567890", + type1: "Long", value1: "1234567890", + type2: "Long", value2: "1234567890", result: "true" } # Compare ints - { - type1: "int", value1: "65535", - type2: "int", value2: "65534", + type1: "Int", value1: "65535", + type2: "Int", value2: "65534", result: "false" } - { - type1: "int", value1: "65535", - type2: "int", value2: "65535", + type1: "Int", value1: "65535", + type2: "Int", value2: "65535", result: "true" } # Compare shorts - { - type1: "short", value1: "1024", - type2: "short", value2: "1025", + type1: "Short", value1: "1024", + type2: "Short", value2: "1025", result: "false" } - { - type1: "short", value1: "1024", - type2: "short", value2: "1024", + type1: "Short", value1: "1024", + type2: "Short", value2: "1024", result: "true" } # Compare bytes - { - type1: "byte", value1: "255", - type2: "byte", value2: "254", + type1: "Byte", value1: "255", + type2: "Byte", value2: "254", result: "false" } - { - type1: "byte", value1: "255", - type2: "byte", value2: "255", + type1: "Byte", value1: "255", + type2: "Byte", value2: "255", result: "true" } diff --git a/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_type_array_type.yaml b/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_type_array_type.yaml index 6ff6800966ce46edad91c59e3ccc8414075de947..0d0886ea82fd1690fd741075adb6b02572669d90 100644 --- a/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_type_array_type.yaml +++ b/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_type_array_type.yaml @@ -43,7 +43,7 @@ } - { name: float, - init_value: "0.0 as float", + init_value: "0.0f", array_sizes: {1, 2, 10, 100}, } - { diff --git a/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_value.yaml b/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_value.yaml index 5492ad023e45252f4b72732dadd1f6bed31ed6eb..b6040dfa72356de9dad6da7396c56ccc37b206d3 100644 --- a/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_value.yaml +++ b/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_value.yaml @@ -49,7 +49,7 @@ } - { name: float, - init_values: {"0.0f", "1.0 as float", "-1.0 as float", "Float.MIN_VALUE as float", "Float.MAX_VALUE as float"}, + init_values: {"0.0f", "1.0f", "-1.0f", "Float.MIN_VALUE", "Float.MAX_VALUE"}, value_name: Float, primitive: true } @@ -97,7 +97,7 @@ } - { name: Float, - init_values: {"Float.valueOf(0.0 as float)", "Float.valueOf(1.0 as float)", "Float.valueOf(-1.0 as float)", "Float.valueOf(Float.MIN_VALUE as float)", "Float.valueOf(Float.MAX_VALUE as float)"}, + init_values: {"Float.valueOf(0.0f)", "Float.valueOf(1.0f)", "Float.valueOf(-1.0f)", "Float.valueOf(Float.MIN_VALUE)", "Float.valueOf(Float.MAX_VALUE)"}, value_name: Float, primitive: false } @@ -199,7 +199,7 @@ } - { name: "FixedArray", - init_values: {"[Float.valueOf(0.0 as float)] as FixedArray", "[Float.valueOf(0.0 as float), Float.valueOf(1.0 as float), Float.valueOf(-1.0 as float), Float.valueOf(Float.MIN_VALUE as float), Float.valueOf(Float.MAX_VALUE as float)] as FixedArray"}, + init_values: {"[Float.valueOf(0.0f)] as FixedArray", "[Float.valueOf(0.0f), Float.valueOf(1.0f), Float.valueOf(-1.0f), Float.valueOf(Float.MIN_VALUE), Float.valueOf(Float.MAX_VALUE)] as FixedArray"}, value_name: Array, primitive: false } diff --git a/static_core/plugins/ets/tests/stdlib-templates/std/serialization/list.std_serialization_json_static.yaml b/static_core/plugins/ets/tests/stdlib-templates/std/serialization/list.std_serialization_json_static.yaml index 29c7d648338665fcefcad05d267631adf6abf5bd..265c0854d06d0a030694e8b2b9773821ccc2b51a 100644 --- a/static_core/plugins/ets/tests/stdlib-templates/std/serialization/list.std_serialization_json_static.yaml +++ b/static_core/plugins/ets/tests/stdlib-templates/std/serialization/list.std_serialization_json_static.yaml @@ -111,8 +111,8 @@ method_test_index_data: {test1: {d: 1}, test2: {d: -1}, test3: {d: 0}, - test4: {d: 2.72182 as float}, - test5: {d: -2.72182 as float}, + test4: {d: 2.72182f}, + test5: {d: -2.72182f}, }, method_expected_data: {test1 : '"1"', test2: '"-1"', diff --git a/static_core/plugins/ets/tests/stdlib-templates/utils/test_core_typedarray_methods.j2 b/static_core/plugins/ets/tests/stdlib-templates/utils/test_core_typedarray_methods.j2 index fe97184ec1f4675e01713e7ca2a12945d9fa6d32..1d809d9817fb3beff4d8c88711137d9d427bf7cb 100644 --- a/static_core/plugins/ets/tests/stdlib-templates/utils/test_core_typedarray_methods.j2 +++ b/static_core/plugins/ets/tests/stdlib-templates/utils/test_core_typedarray_methods.j2 @@ -1690,7 +1690,7 @@ const testTypedArrayLastIndexOf = parametrize