diff --git a/ets2panda/checker/types/ets/etsResizableArrayType.cpp b/ets2panda/checker/types/ets/etsResizableArrayType.cpp index 2d4da551f1d4d5186d9a7bcf1bf3b34b3e0b7384..464207ceda8e4d8f2c71f898a8cdeb89990fdbe4 100644 --- a/ets2panda/checker/types/ets/etsResizableArrayType.cpp +++ b/ets2panda/checker/types/ets/etsResizableArrayType.cpp @@ -14,6 +14,7 @@ */ #include "etsResizableArrayType.h" +#include "etsUnionType.h" namespace ark::es2panda::checker { @@ -26,8 +27,13 @@ ETSResizableArrayType *ETSResizableArrayType::Substitute(TypeRelation *relation, void ETSResizableArrayType::ToString(std::stringstream &ss, [[maybe_unused]] bool precise) const { - if (element_ != nullptr) { - ss << element_->ToString() << "[]"; + if (ElementType() != nullptr) { + if (HasTypeFlag(TypeFlag::READONLY)) { + ss << "readonly "; + } + ss << "Array<"; + ElementType()->ToString(ss, precise); + ss << ">"; } } diff --git a/ets2panda/test/ast/compiler/ets/FixedArray/lambda_type_mismatch.ets b/ets2panda/test/ast/compiler/ets/FixedArray/lambda_type_mismatch.ets index 0a1736214bc11a78f8bd38b481a968a66f867cc8..f7e4961dcdb9b8ea852ca4950f38203106724f4b 100644 --- a/ets2panda/test/ast/compiler/ets/FixedArray/lambda_type_mismatch.ets +++ b/ets2panda/test/ast/compiler/ets/FixedArray/lambda_type_mismatch.ets @@ -19,6 +19,6 @@ let fob:(...args:FixedArray)=>number = (...args:FixedArray) =>{} let foc:(c:string, ...args:FixedArray)=>string = (c:number, ...args:FixedArray):string=>{} -/* @@? 16:56 Error TypeError: Type '(c: Double, ...args: FixedArray) => void' cannot be assigned to type '(c: String, ...args: FixedArray) => void' */ -/* @@? 18:48 Error TypeError: Type '(...args: FixedArray) => void' cannot be assigned to type '(...args: FixedArray) => Double' */ -/* @@? 20:58 Error TypeError: Type '(c: Double, ...args: FixedArray) => String' cannot be assigned to type '(c: String, ...args: FixedArray) => String' */ +/* @@? 16:56 Error TypeError: Type '(c: Double, ...args: FixedArray) => void' cannot be assigned to type '(c: String, ...args: FixedArray) => void' */ +/* @@? 18:48 Error TypeError: Type '(...args: FixedArray) => void' cannot be assigned to type '(...args: FixedArray) => Double' */ +/* @@? 20:58 Error TypeError: Type '(c: Double, ...args: FixedArray) => String' cannot be assigned to type '(c: String, ...args: FixedArray) => String' */ diff --git a/ets2panda/test/ast/compiler/ets/FixedArray/same_assembly_overload/callExpr_pos.ets b/ets2panda/test/ast/compiler/ets/FixedArray/same_assembly_overload/callExpr_pos.ets index c7bba38d497f81a3340b6442224a4d8456093eea..7e668cc079a46161f27219fea8fdd6c1684bb70f 100644 --- a/ets2panda/test/ast/compiler/ets/FixedArray/same_assembly_overload/callExpr_pos.ets +++ b/ets2panda/test/ast/compiler/ets/FixedArray/same_assembly_overload/callExpr_pos.ets @@ -25,6 +25,4 @@ foo(1,2) foo(1.1) -/* @@? 17:1 Warning Warning: Function foo with this assembly signature already declared. */ -/* @@? 23:1 Warning Warning: Detect duplicate signatures, use 'foo(..._: FixedArray<(Object|null|undefined)>): void' to replace */ /* @@? 23:5 Warning Warning: Variable 'b' is used before being assigned. */ diff --git a/ets2panda/test/ast/compiler/ets/FixedArray/spreadMultiArrayInTuple.ets b/ets2panda/test/ast/compiler/ets/FixedArray/spreadMultiArrayInTuple.ets index 7fa539e519cfdc81408461e08361ae31b45df3c2..de366a4ce9c8977af5dafbc712422a52ccb5c62b 100644 --- a/ets2panda/test/ast/compiler/ets/FixedArray/spreadMultiArrayInTuple.ets +++ b/ets2panda/test/ast/compiler/ets/FixedArray/spreadMultiArrayInTuple.ets @@ -22,8 +22,8 @@ function main() { } /* @@? 18:56 Error TypeError: Initializer has 2 elements, but tuple requires 4 */ -/* @@? 18:72 Error TypeError: '(Int|String)[]' cannot be spread in tuple. */ -/* @@? 18:94 Error TypeError: '(Int|String)[]' cannot be spread in tuple. */ +/* @@? 18:72 Error TypeError: 'Array' cannot be spread in tuple. */ +/* @@? 18:94 Error TypeError: 'Array' cannot be spread in tuple. */ /* @@? 21:61 Error TypeError: Initializer has 3 elements, but tuple requires 4 */ -/* @@? 21:83 Error TypeError: 'Double[]' cannot be spread in tuple. */ -/* @@? 21:105 Error TypeError: 'String[]' cannot be spread in tuple. */ +/* @@? 21:83 Error TypeError: 'Array' cannot be spread in tuple. */ +/* @@? 21:105 Error TypeError: 'Array' cannot be spread in tuple. */ diff --git a/ets2panda/test/ast/compiler/ets/annotation_tests/annotationDecl_bad_initializer08.ets b/ets2panda/test/ast/compiler/ets/annotation_tests/annotationDecl_bad_initializer08.ets index 23c49fd00f3806c29fe9c1e1d32bbf1ac93848ac..c335fe0f2846c1ea791650c37ac10398b1a8de88 100644 --- a/ets2panda/test/ast/compiler/ets/annotation_tests/annotationDecl_bad_initializer08.ets +++ b/ets2panda/test/ast/compiler/ets/annotation_tests/annotationDecl_bad_initializer08.ets @@ -26,8 +26,8 @@ enum Size{S, M, L, XL, XXL} /* @@? 20:29 Error TypeError: Type 'Int' cannot be assigned to type 'String' */ /* @@? 21:30 Error TypeError: Type '"false"' cannot be assigned to type 'Boolean' */ -/* @@? 22:39 Error TypeError: Array element at index 0 with type 'Double' is not compatible with the target array element type 'Int' */ -/* @@? 22:44 Error TypeError: Array element at index 1 with type 'Double' is not compatible with the target array element type 'Int' */ +/* @@? 22:29 Error TypeError: Array element at index 0 with type 'Double' is not compatible with the target array element type 'Int' */ +/* @@? 22:34 Error TypeError: Array element at index 1 with type 'Double' is not compatible with the target array element type 'Int' */ /* @@? 23:28 Error TypeError: Type 'Size' cannot be assigned to type 'Color' */ /* @@? 24:30 Error TypeError: Array element at index 0 with type 'Color' is not compatible with the target array element type 'Size' */ /* @@? 24:43 Error TypeError: Array element at index 1 with type 'Color' is not compatible with the target array element type 'Size' */ diff --git a/ets2panda/test/ast/compiler/ets/boxingConversion1.ets b/ets2panda/test/ast/compiler/ets/boxingConversion1.ets index 668502185abecff66deaa89bf2203e9d1d7153f7..c5c5ce87691625b1486707d3a06787a8e829e812 100644 --- a/ets2panda/test/ast/compiler/ets/boxingConversion1.ets +++ b/ets2panda/test/ast/compiler/ets/boxingConversion1.ets @@ -17,5 +17,3 @@ function main() : void { let a: Byte = 2; let b: Byte = /* @@ label */new Byte(2); } - -/* @@@ label Error TypeError: No matching construct signature for std.core.Byte(Int) */ diff --git a/ets2panda/test/ast/compiler/ets/boxingConversion4.ets b/ets2panda/test/ast/compiler/ets/boxingConversion4.ets index b26c8b8c527ab08929ea315ad36867a56075c86e..50def2dc84f19de1b19d2499f87ab1c307562419 100644 --- a/ets2panda/test/ast/compiler/ets/boxingConversion4.ets +++ b/ets2panda/test/ast/compiler/ets/boxingConversion4.ets @@ -23,6 +23,5 @@ function main() : void { refInt(b); // primitive widening before boxing is not allowed } -/* @@@ label Error TypeError: No matching construct signature for std.core.Short(Int) */ /* @@@ label1 Error TypeError: Type 'Int' cannot be assigned to type 'Short' */ /* @@@ label2 Error TypeError: Type 'Int' cannot be assigned to type 'Short' */ diff --git a/ets2panda/test/ast/compiler/ets/declareType_neg_2.ets b/ets2panda/test/ast/compiler/ets/declareType_neg_2.ets index 2a64b2993b798f8eb67ec9c00adf5d859d8cea94..ba03a78da1d25d035ed1071fe7ca7f1039c75d69 100644 --- a/ets2panda/test/ast/compiler/ets/declareType_neg_2.ets +++ b/ets2panda/test/ast/compiler/ets/declareType_neg_2.ets @@ -21,5 +21,4 @@ declare type type_utility = Partial; let a : type_utility = {description : 1234} -/* @@? 22:39 Error TypeError: Type 'int' is not compatible with type 'String|undefined' at property 'description' */ - +/* @@? 22:39 Error TypeError: Type 'Int' is not compatible with type 'String|undefined' at property 'description' */ diff --git a/ets2panda/test/ast/compiler/ets/enum-to-int-conversion.ets b/ets2panda/test/ast/compiler/ets/enum-to-int-conversion.ets index 1100d5c9d1088a68e7882e9905d32e1ec9bb46bf..6ee37e69b89d0af965dc5812b0b605d05995ce22 100644 --- a/ets2panda/test/ast/compiler/ets/enum-to-int-conversion.ets +++ b/ets2panda/test/ast/compiler/ets/enum-to-int-conversion.ets @@ -18,6 +18,6 @@ SECOND = 12345678910 } - let a: int = /* @@ label */E.FIRST + let a: int = E.FIRST - /* @@@ label Error TypeError: Type 'Long' cannot be assigned to type 'Int' */ \ No newline at end of file + /* @@? 16:2 Error TypeError: Type 'Long' cannot be assigned to type 'Int' */ diff --git a/ets2panda/test/ast/compiler/ets/explicit_cast_boxed_expressions.ets b/ets2panda/test/ast/compiler/ets/explicit_cast_boxed_expressions.ets index 45197e365f80ad1988b6fc601eff33d772cf3e6a..3a8115afd14f56e4b54424d27e0b76e15158a683 100644 --- a/ets2panda/test/ast/compiler/ets/explicit_cast_boxed_expressions.ets +++ b/ets2panda/test/ast/compiler/ets/explicit_cast_boxed_expressions.ets @@ -25,12 +25,12 @@ let testLongValue: Long = 9223372036854775807; function byte_test(): boolean { let Byte_: Byte = new Byte(42 as byte); // ? - let byte_short = Byte_ as Short; // ? - let byte_int = Byte_ as Int; // ? - let byte_long = Byte_ as Long; // ok - let byte_float = Byte_ as Float; // ok - let byte_double = Byte_ as Double; // ok - let byte_char = Byte_ as Char; // ok + let byte_short = Byte.toShort(Byte_); // ? + let byte_int = Byte.toInt(Byte_); // ? + let byte_long = Byte.toLong(Byte_); // ok + let byte_float = Byte.toFloat(Byte_); // ok + let byte_double = Byte.toDouble(Byte_); // ok + let byte_char = Byte.toChar(Byte_); // ok // true test Type speciefic operations { @@ -57,13 +57,13 @@ function short_test(): boolean { let Short_: Short = new Short(42 as short); - let short_byte = Short_ as Byte; - let short_short = Short_ as Short; - let short_char = Short_ as Char; - let short_int = Short_ as Int; - let short_long = Short_ as Long; - let short_float = Short_ as Float; - let short_double = Short_ as Double; + let short_byte = Short.toByte(Short_); + let short_short = Short.toShort(Short_); + let short_char = Short.toChar(Short_); + let short_int = Short.toInt(Short_); + let short_long = Short.toLong(Short_); + let short_float = Short.toFloat(Short_); + let short_double = Short.toDouble(Short_); // true test Type speciefic operations @@ -90,13 +90,13 @@ function short_test(): boolean { function char_test(): boolean { let Char_: Char = new Char(42 as char); - let char_byte = Char_ as Byte; - let char_short = Char_ as Short; - let char_char = Char_ as Char; - let char_int = Char_ as Int; - let char_long = Char_ as Long; - let char_float = Char_ as Float; - let char_double = Char_ as Double; + let char_byte = Char.toByte(Char_); + let char_short = Char.toShort(Char_); + let char_char = Char.toChar(Char_); + let char_int = Char.toInt(Char_); + let char_long = Char.toLong(Char_); + let char_float = Char.toFloat(Char_); + let char_double = Char.toDouble(Char_); // true test Type speciefic operations { @@ -123,13 +123,13 @@ function int_test(): boolean { let Int_: Int = new Int(42 as int); - let int_byte = Int_ as Byte; - let int_short = Int_ as Short; - let int_char = Int_ as Char; - let int_int = Int_ as Int; - let int_long = Int_ as Long; - let int_float = Int_ as Float; - let int_double = Int_ as Double; + let int_byte = Int.toByte(Int_); + let int_short = Int.toShort(Int_); + let int_char = Int.toChar(Int_); + let int_int = Int.toInt(Int_); + let int_long = Int.toLong(Int_); + let int_float = Int.toFloat(Int_); + let int_double = Int.toDouble(Int_); // true test Type speciefic operations { @@ -155,13 +155,13 @@ function int_test(): boolean { function long_test(): boolean { let Long_: Long = new Long(42 as long); - let long_byte = Long_ as Byte; - let long_short = Long_ as Short; - let long_char = Long_ as Char; - let long_int = Long_ as Int; - let long_long = Long_ as Long; - let long_float = Long_ as Float; - let long_double = Long_ as Double; + let long_byte = Long.toByte(Long_); + let long_short = Long.toShort(Long_); + let long_char = Long.toChar(Long_); + let long_int = Long.toInt(Long_); + let long_long = Long.toLong(Long_); + let long_float = Long.toFloat(Long_); + let long_double = Long.toDouble(Long_); // true test Type speciefic operations { @@ -187,13 +187,13 @@ function long_test(): boolean { function float_test(): boolean { let Float_: Float = new Float(42 as float); - let float_byte = Float_ as Byte; - let float_short = Float_ as Short; - let float_char = Float_ as Char; - let float_int = Float_ as Int; - let float_long = Float_ as Long; - let float_float = Float_ as Float; - let float_double = Float_ as Double; + let float_byte = Float.toByte(Float_); + let float_short = Float.toShort(Float_); + let float_char = Float.toChar(Float_); + let float_int = Float.toInt(Float_); + let float_long = Float.toLong(Float_); + let float_float = Float.toFloat(Float_); + let float_double = Float.toDouble(Float_); // true test Type speciefic operations { if (float_double.toExponential() != testDouble.toExponential()) { @@ -218,13 +218,13 @@ function float_test(): boolean { function double_test(): boolean { let Double_: Double = new Double(42 as double); - let double_byte = Double_ as Byte; - let double_short = Double_ as Short; - let double_char = Double_ as Char; - let double_int = Double_ as Int; - let double_long = Double_ as Long; - let double_float = Double_ as Float; - let double_double = Double_ as Double; + let double_byte = Double.toByte(Double_); + let double_short = Double.toShort(Double_); + let double_char = Double.toChar(Double_); + let double_int = Double.toInt(Double_); + let double_long = Double.toLong(Double_); + let double_float = Double.toFloat(Double_); + let double_double = Double.toDouble(Double_); // true test Type speciefic operations { if (double_double.toExponential() != testDouble.toExponential()) { diff --git a/ets2panda/test/ast/compiler/ets/greater_than_neg.ets b/ets2panda/test/ast/compiler/ets/greater_than_neg.ets index f674baea5f68e803a04ea85849a1cbd289bfe8c4..d69d4569f1b5f05b7e378f3d3551ec18ea961700 100644 --- a/ets2panda/test/ast/compiler/ets/greater_than_neg.ets +++ b/ets2panda/test/ast/compiler/ets/greater_than_neg.ets @@ -18,5 +18,3 @@ let b: Array>=2 /* @@? 16:21 Error SyntaxError: Unexpected token '>>='. */ /* @@? 17:21 Error SyntaxError: Unexpected token '>='. */ -/* @@? 17:21 Error TypeError: Bad operand type, the types of the operands must be numeric, same enumeration, or boolean type. */ - diff --git a/ets2panda/test/ast/compiler/ets/import_tests/import_distant_package/package_with_errors/package_with_errors_1.ets b/ets2panda/test/ast/compiler/ets/import_tests/import_distant_package/package_with_errors/package_with_errors_1.ets index 19bbeda4e072fd70e36a4bf1c9d2522ee06bb7f9..669d862fb13db1ac8374b462716fdcf2e835af6d 100644 --- a/ets2panda/test/ast/compiler/ets/import_tests/import_distant_package/package_with_errors/package_with_errors_1.ets +++ b/ets2panda/test/ast/compiler/ets/import_tests/import_distant_package/package_with_errors/package_with_errors_1.ets @@ -25,7 +25,7 @@ export let moreImportantInfo = importantInfo as number; /* @@? distant_package.ets:22:22 Error SyntaxError: Variable must be initialized or it's type must be declared. */ -/* @@? package_with_errors_1.ets:19:32 Error TypeError: Cannot cast type 'String' to 'double' */ +/* @@? package_with_errors_1.ets:19:32 Error TypeError: Cannot cast type 'String' to 'Double' */ /* @@? package_with_errors_2.ets:19:16 Error SyntaxError: Non-constant initializer of Package should be apply in Initializer Block. */ /* @@? package_with_errors_2.ets:19:16 Error TypeError: Unresolved reference foo */ diff --git a/ets2panda/test/ast/compiler/ets/import_tests/import_distant_package/package_with_errors/package_with_errors_2.ets b/ets2panda/test/ast/compiler/ets/import_tests/import_distant_package/package_with_errors/package_with_errors_2.ets index 99f6762f8c7d68cf8aff1d80d97863bfbc39a6f6..05bbddf58b233d9d5c5c2c787c9e23347d3ebaa0 100644 --- a/ets2panda/test/ast/compiler/ets/import_tests/import_distant_package/package_with_errors/package_with_errors_2.ets +++ b/ets2panda/test/ast/compiler/ets/import_tests/import_distant_package/package_with_errors/package_with_errors_2.ets @@ -27,7 +27,7 @@ export notInit /* @@? distant_package.ets:22:22 Error SyntaxError: Variable must be initialized or it's type must be declared. */ -/* @@? package_with_errors_1.ets:19:32 Error TypeError: Cannot cast type 'String' to 'double' */ +/* @@? package_with_errors_1.ets:19:32 Error TypeError: Cannot cast type 'String' to 'Double' */ /* @@? package_with_errors_2.ets:19:16 Error SyntaxError: Non-constant initializer of Package should be apply in Initializer Block. */ /* @@? package_with_errors_2.ets:19:16 Error TypeError: Unresolved reference foo */ diff --git a/ets2panda/test/ast/compiler/ets/inferTypeOfArrayNegative3.ets b/ets2panda/test/ast/compiler/ets/inferTypeOfArrayNegative3.ets index 5856063ea2e162016e81d70f12f2e953976bc615..21e23234298c137f967cf88d93e0e3e6fe8ba884 100644 --- a/ets2panda/test/ast/compiler/ets/inferTypeOfArrayNegative3.ets +++ b/ets2panda/test/ast/compiler/ets/inferTypeOfArrayNegative3.ets @@ -16,5 +16,5 @@ let a = [1, 2, 3] a[0] = /* @@ label */"1" -/* @@? 17:1 Error TypeError: No matching indexing signature for $_set(int, "1") */ +/* @@? 17:1 Error TypeError: No matching indexing signature for $_set(Double, "1") */ /* @@? 17:3 Error TypeError: Cannot find index access method with the required signature. */ diff --git a/ets2panda/test/ast/compiler/ets/infinityNarrowing.ets b/ets2panda/test/ast/compiler/ets/infinityNarrowing.ets index 2d98d9ee7385433f95468e8a97a7baa2c363327d..d885bc01afba2c67e281e33d493475b132b3f172 100644 --- a/ets2panda/test/ast/compiler/ets/infinityNarrowing.ets +++ b/ets2panda/test/ast/compiler/ets/infinityNarrowing.ets @@ -19,6 +19,7 @@ export const shortInf: short = /* @@ label1 */1.0 / 0.0 /* @@@ label Error TypeError: Type 'Double' cannot be assigned to type 'Byte' */ /* @@@ label1 Error TypeError: Type 'Double' cannot be assigned to type 'Short' */ +/* @@@ label2 Error TypeError: Type 'Double' cannot be assigned to type 'Float' */ /* @@@ label2 Error TypeError: Floating-point value cannot be converted */ /* @@@ label1 Error TypeError: Floating-point value cannot be converted */ /* @@@ label Error TypeError: Floating-point value cannot be converted */ diff --git a/ets2panda/test/ast/compiler/ets/method-resolution-class-and-interface-in-signatures_6.ets b/ets2panda/test/ast/compiler/ets/method-resolution-class-and-interface-in-signatures_6.ets index b1c80e1dbeaec4098d478db5ac9fcdb4f5251463..670b535d0dfbde90170c8bdfd09eb0d3b7271fb5 100644 --- a/ets2panda/test/ast/compiler/ets/method-resolution-class-and-interface-in-signatures_6.ets +++ b/ets2panda/test/ast/compiler/ets/method-resolution-class-and-interface-in-signatures_6.ets @@ -42,4 +42,6 @@ function main(): int { let asd5: double = /* @@ label */foo(new A(), 2.1); return 0; } +/* @@? 38:21 Error TypeError: Call to `foo` is ambiguous as `2` versions of `foo` are available: `foo(b: Int, a: I): Int` and `foo(d: Double, a: J): Double` */ +/* @@? 41:21 Error TypeError: Call to `foo` is ambiguous as `2` versions of `foo` are available: `foo(a: I, b: Int): Int` and `foo(a: J, d: Double): Double` */ /* @@@ label Error TypeError: Call to `foo` is ambiguous as `2` versions of `foo` are available: `foo(a: J, d: Double): Double` and `foo(a: I, d: Double): Double` */ diff --git a/ets2panda/test/ast/compiler/ets/n_assignGenericWithNullableTypeParamToNonNullable.ets b/ets2panda/test/ast/compiler/ets/n_assignGenericWithNullableTypeParamToNonNullable.ets index d2cac0dc0b4062d77984a6fb8dbd69dd8feaa9a6..7650215aa64b566b915174ad7903c0cc950b19fc 100644 --- a/ets2panda/test/ast/compiler/ets/n_assignGenericWithNullableTypeParamToNonNullable.ets +++ b/ets2panda/test/ast/compiler/ets/n_assignGenericWithNullableTypeParamToNonNullable.ets @@ -18,7 +18,8 @@ class B {} function main(): void { let abn : A = /* @@ label */new A(); // should not work: non nullable B is the subtype of nullable B, but T has no variance mark - let ab : A = abn; // should not work: nullable B (the type of abn) is not the subtype of non nullable B + let ab : A = /* @@ label1 */abn; // should not work: nullable B (the type of abn) is not the subtype of non nullable B } /* @@@ label Error TypeError: Type 'A' cannot be assigned to type 'A' */ +/* @@@ label1 Error TypeError: Type 'A' cannot be assigned to type 'A' */ diff --git a/ets2panda/test/ast/compiler/ets/package_invalid_initializer/P3/P3.ets b/ets2panda/test/ast/compiler/ets/package_invalid_initializer/P3/P3.ets index 3609cbb822433097e51adf6a68531a869e015874..809e03282c8d1daf2580a62df3f0c732f27b23b3 100644 --- a/ets2panda/test/ast/compiler/ets/package_invalid_initializer/P3/P3.ets +++ b/ets2panda/test/ast/compiler/ets/package_invalid_initializer/P3/P3.ets @@ -47,8 +47,8 @@ static { /* @@? P3.ets:29:14 Error SyntaxError: Missing initialization for const package property */ /* @@? P3.ets:29:18 Error SyntaxError: Variable must be initialized or it's type must be declared. */ /* @@? P3.ets:30:30 Error SyntaxError: Non-constant initializer of Package should be apply in Initializer Block. */ -/* @@? P3.ets:31:14 Error TypeError: Cannot reassign constant c_nn2 */ /* @@? P3.ets:32:6 Error SyntaxError: Non-constant initializer of Package should be apply in Initializer Block. */ /* @@? P3.ets:33:1 Error SyntaxError: Invalid package toplevel statement */ /* @@? P3.ets:34:1 Error SyntaxError: Invalid package toplevel statement */ +/* @@? P3.ets:36:5 Error TypeError: Invalid left-hand side of assignment expression */ /* @@? P3.ets:39:14 Error SyntaxError: Missing initialization for const package property */ diff --git a/ets2panda/test/ast/compiler/ets/recordWithLambdaFunction2.ets b/ets2panda/test/ast/compiler/ets/recordWithLambdaFunction2.ets index 799b915f1086b036a2c6992dd65f930e67813d79..662eea658f08e52b3c3d39396599106ae8fe53fb 100644 --- a/ets2panda/test/ast/compiler/ets/recordWithLambdaFunction2.ets +++ b/ets2panda/test/ast/compiler/ets/recordWithLambdaFunction2.ets @@ -23,6 +23,6 @@ function main(): void { handlerMap[2] = 1 } -/* @@? 23:5 Error TypeError: No matching indexing signature for $_set(int, int) */ +/* @@? 23:5 Error TypeError: No matching indexing signature for $_set(Int, Int) */ /* @@? 23:16 Error TypeError: Cannot find index access method with the required signature. */ -/* @@? 23:21 Error TypeError: Type 'int' is not compatible with type '(param: Double) => String' at index 2 */ +/* @@? 23:21 Error TypeError: Type 'Int' is not compatible with type '(param: Double) => String' at index 2 */ diff --git a/ets2panda/test/ast/compiler/ets/validate_signatures_throw_type_error.ets b/ets2panda/test/ast/compiler/ets/validate_signatures_throw_type_error.ets index 1563fd56e4aea8912774f88840de5d357931aa4a..a40a194427070a108fc96a3822d4953588a78be0 100644 --- a/ets2panda/test/ast/compiler/ets/validate_signatures_throw_type_error.ets +++ b/ets2panda/test/ast/compiler/ets/validate_signatures_throw_type_error.ets @@ -16,5 +16,3 @@ function main() : void { let a: Byte = /* @@ label */new Byte(2); } - -/* @@@ label Error TypeError: No matching construct signature for std.core.Byte(Int) */ diff --git a/ets2panda/test/ast/compiler/ets/voidTypeInBinaryOperation.ets b/ets2panda/test/ast/compiler/ets/voidTypeInBinaryOperation.ets index 37e9904ba69f70fb502942607b007edc6bc8d4cc..444e753ab6229ae9efa2eae5dccbf42c03c7f861 100644 --- a/ets2panda/test/ast/compiler/ets/voidTypeInBinaryOperation.ets +++ b/ets2panda/test/ast/compiler/ets/voidTypeInBinaryOperation.ets @@ -20,6 +20,6 @@ function main(): void { assertTrue(false || check()) } -/* @@? 20:3 Error TypeError: No matching call signature for assertTrue(void) */ +/* @@? 20:3 Error TypeError: No matching call signature for assertTrue(Boolean|void) */ +/* @@? 20:14 Error TypeError: Type 'Boolean|void' is not compatible with type 'Boolean' at index 1 */ /* @@? 20:23 Error TypeError: Cannot use type 'void' as value. */ -/* @@? 20:23 Error TypeError: Type 'void' is not compatible with type 'Boolean' at index 1 */ \ No newline at end of file diff --git a/ets2panda/test/ast/parser/ets/FixedArray/FunctionalTypeAsArrayElement.ets b/ets2panda/test/ast/parser/ets/FixedArray/FunctionalTypeAsArrayElement.ets index e6559e42e9ff6ba90dee5124c1222bc67a0ecfd8..8a366c6af3d6d0c024d56523d22573abc69418b2 100644 --- a/ets2panda/test/ast/parser/ets/FixedArray/FunctionalTypeAsArrayElement.ets +++ b/ets2panda/test/ast/parser/ets/FixedArray/FunctionalTypeAsArrayElement.ets @@ -19,4 +19,4 @@ function main(){ ] } -/* @@? 17:48 Error TypeError: Expected type for array literal should be an array type, got () => FixedArray */ +/* @@? 17:48 Error TypeError: Type 'Array<() => Int>' cannot be assigned to type '() => FixedArray' */ diff --git a/ets2panda/test/ast/parser/ets/FixedArray/n_arrayHoldingNullValue.ets b/ets2panda/test/ast/parser/ets/FixedArray/n_arrayHoldingNullValue.ets index 89238cd2b0e11ef99f20abce231316bb180c907f..3bf1015d7a8c86fcd55daca16a8fb31d0f4cc634 100644 --- a/ets2panda/test/ast/parser/ets/FixedArray/n_arrayHoldingNullValue.ets +++ b/ets2panda/test/ast/parser/ets/FixedArray/n_arrayHoldingNullValue.ets @@ -18,5 +18,5 @@ function main(): void { let d: FixedArray = /* @@ label1 */null; } -/* @@? 17:48 Error TypeError: Type 'null' cannot be assigned to type 'FixedArray' */ -/* @@? 18:46 Error TypeError: Type 'null' cannot be assigned to type 'FixedArray' */ +/* @@? 17:48 Error TypeError: Type 'null' cannot be assigned to type 'FixedArray' */ +/* @@? 18:46 Error TypeError: Type 'null' cannot be assigned to type 'FixedArray' */ diff --git a/ets2panda/test/ast/parser/ets/FixedArray/predefined_non_primitive_types.ets b/ets2panda/test/ast/parser/ets/FixedArray/predefined_non_primitive_types.ets index 010a140b3b22e95ce366797f6b259f8d0caa539b..e096d5945f662dcffe7e5732a142e313c2f2c66a 100644 --- a/ets2panda/test/ast/parser/ets/FixedArray/predefined_non_primitive_types.ets +++ b/ets2panda/test/ast/parser/ets/FixedArray/predefined_non_primitive_types.ets @@ -36,5 +36,6 @@ let s: String = "abc"; let a: FixedArray = new int[5]; /* @@@ label Error TypeError: Variable 'non_prim_b' has already been declared. */ +/* @@? 23:25 Error TypeError: Type 'Double' cannot be assigned to type 'Float' */ /* @@? 27:31 Error TypeError: Cannot find type 'Bool'. */ /* @@? 27:38 Error TypeError: Type 'Boolean' cannot be assigned to type 'Byte' */ diff --git a/ets2panda/test/ast/parser/ets/FixedArray/readonly-parameter-test/Readonly-with-ArrayType-test1.ets b/ets2panda/test/ast/parser/ets/FixedArray/readonly-parameter-test/Readonly-with-ArrayType-test1.ets index 2ca4a147db10bcc9a0838995452394b5d9056bfe..76821f2070cf19e0b4617b8ae47be6ce5d0c93ea 100644 --- a/ets2panda/test/ast/parser/ets/FixedArray/readonly-parameter-test/Readonly-with-ArrayType-test1.ets +++ b/ets2panda/test/ast/parser/ets/FixedArray/readonly-parameter-test/Readonly-with-ArrayType-test1.ets @@ -19,5 +19,5 @@ function foo (p: FixedArray) { let x: Readonly> = [] /* @@ label */foo(/* @@ label1 */x) -/* @@? 20:15 Error TypeError: No matching call signature for foo(readonly FixedArray) */ -/* @@? 20:34 Error TypeError: Type 'readonly FixedArray' is not compatible with type 'FixedArray' at index 1 */ +/* @@? 20:15 Error TypeError: No matching call signature for foo(readonly FixedArray) */ +/* @@? 20:34 Error TypeError: Type 'readonly FixedArray' is not compatible with type 'FixedArray' at index 1 */ diff --git a/ets2panda/test/ast/parser/ets/FixedArray/readonly-parameter-test/Readonly-with-ArrayType-test4.ets b/ets2panda/test/ast/parser/ets/FixedArray/readonly-parameter-test/Readonly-with-ArrayType-test4.ets index 4b0401da4408ab8d8146fd663d5641c0995539a4..516d11b4d23167c75db764dd596470bc71b98d7e 100644 --- a/ets2panda/test/ast/parser/ets/FixedArray/readonly-parameter-test/Readonly-with-ArrayType-test4.ets +++ b/ets2panda/test/ast/parser/ets/FixedArray/readonly-parameter-test/Readonly-with-ArrayType-test4.ets @@ -18,4 +18,4 @@ function foo (x: Readonly>) { let x1 : FixedArray x1 = /* @@ label */x } -/* @@? 19:24 Error TypeError: Type 'readonly FixedArray' cannot be assigned to type 'FixedArray' */ +/* @@? 19:24 Error TypeError: Type 'readonly FixedArray' cannot be assigned to type 'FixedArray' */ diff --git a/ets2panda/test/ast/parser/ets/FixedArray/tuple_type_2_neg.ets b/ets2panda/test/ast/parser/ets/FixedArray/tuple_type_2_neg.ets index a3ef77512e4ef0464551e16ff91dbb7fcf31ccc0..79438b73abdc162a001b3516c276938d221b54eb 100644 --- a/ets2panda/test/ast/parser/ets/FixedArray/tuple_type_2_neg.ets +++ b/ets2panda/test/ast/parser/ets/FixedArray/tuple_type_2_neg.ets @@ -21,7 +21,6 @@ let a: [number, FixedArray<...number>, number] = [1, 2, 3]; /* @@? 17:28 Error SyntaxError: Unexpected token '>'. */ /* @@? 17:28 Error SyntaxError: Unexpected token, expected ',' or ']'. */ /* @@? 17:28 Error SyntaxError: Invalid Type. */ -/* @@? 17:28 Error TypeError: Bad operand type, the types of the operands must be numeric, same enumeration, or boolean type. */ /* @@? 17:31 Error TypeError: Type name 'number' used in the wrong context */ /* @@? 17:38 Error SyntaxError: Unexpected token ','. */ /* @@? 17:40 Error TypeError: Type name 'number' used in the wrong context */ diff --git a/ets2panda/test/ast/parser/ets/FunctionalTypeAsArrayElement.ets b/ets2panda/test/ast/parser/ets/FunctionalTypeAsArrayElement.ets index 4e6298318b225a5247e2ccc51396fddc999dd435..d31642e769b87be22eb93ac64b491232cfce12f0 100644 --- a/ets2panda/test/ast/parser/ets/FunctionalTypeAsArrayElement.ets +++ b/ets2panda/test/ast/parser/ets/FunctionalTypeAsArrayElement.ets @@ -19,4 +19,4 @@ function main(){ ] } -/* @@? 17:38 Error TypeError: Expected type for array literal should be an array type, got () => Array */ +/* @@? 17:38 Error TypeError: Type 'Array<() => Int>' cannot be assigned to type '() => Array' */ diff --git a/ets2panda/test/ast/parser/ets/annotations_tests/annotationDecl_bad_initializer06.ets b/ets2panda/test/ast/parser/ets/annotations_tests/annotationDecl_bad_initializer06.ets index be2cfb7042f696fe921d00acfbcb17dd4c2e5d9e..f1e3bbdc40f04b9d2696fc2e936139672fcd38f2 100644 --- a/ets2panda/test/ast/parser/ets/annotations_tests/annotationDecl_bad_initializer06.ets +++ b/ets2panda/test/ast/parser/ets/annotations_tests/annotationDecl_bad_initializer06.ets @@ -20,4 +20,5 @@ class A{} } /* @@@ label Error SyntaxError: Invalid value for annotation field, expected a constant literal. */ +/* @@@ label Error TypeError: Invalid value for annotation field, expected a constant literal. */ /* @@? 19:43 Error TypeError: Type '(a: Int) => void' cannot be assigned to type 'String' */ diff --git a/ets2panda/test/ast/parser/ets/annotations_tests/annotationUsage_bad_param02.ets b/ets2panda/test/ast/parser/ets/annotations_tests/annotationUsage_bad_param02.ets index cbe206da4501889fc11d8d1278ed8f2380eb2644..4b52a661a36ab459713ce26f6f16e2ae3702fa83 100644 --- a/ets2panda/test/ast/parser/ets/annotations_tests/annotationUsage_bad_param02.ets +++ b/ets2panda/test/ast/parser/ets/annotations_tests/annotationUsage_bad_param02.ets @@ -23,4 +23,5 @@ class A{} class B{} /* @@@ label Error SyntaxError: Invalid value for annotation field, expected a constant literal. */ +/* @@@ label Error TypeError: Invalid value for annotation field, expected a constant literal. */ /* @@? 22:23 Error TypeError: Type 'A' cannot be assigned to type 'String' */ diff --git a/ets2panda/test/ast/parser/ets/annotations_tests/annotationUsage_bad_param04.ets b/ets2panda/test/ast/parser/ets/annotations_tests/annotationUsage_bad_param04.ets index 477f3727524461ce8a9fd59feadb12500c1e010b..578d3567c669a8cf51100074e9df5ec96711cc76 100644 --- a/ets2panda/test/ast/parser/ets/annotations_tests/annotationUsage_bad_param04.ets +++ b/ets2panda/test/ast/parser/ets/annotations_tests/annotationUsage_bad_param04.ets @@ -21,4 +21,5 @@ @MyAnno({testProperty1: "1", testProperty2: [1, 2, a]}) class B{} -/* @@? 21:45 Error TypeError: Expected type for array literal should be an array type, got Double */ +/* @@? 21:45 Error TypeError: Invalid value for annotation field, expected a constant literal. */ +/* @@? 21:52 Error TypeError: Unresolved reference a */ diff --git a/ets2panda/test/ast/parser/ets/annotations_tests/annotationUsage_bad_param05.ets b/ets2panda/test/ast/parser/ets/annotations_tests/annotationUsage_bad_param05.ets index 5a155bd89adda2a8dec9d079ef43ed0d8cd6f23d..c3539ceb56291b5366659216cb0654c3c263b06a 100644 --- a/ets2panda/test/ast/parser/ets/annotations_tests/annotationUsage_bad_param05.ets +++ b/ets2panda/test/ast/parser/ets/annotations_tests/annotationUsage_bad_param05.ets @@ -22,4 +22,5 @@ class B{} /* @@@ label Error SyntaxError: Invalid value for annotation field, expected a constant literal. */ +/* @@@ label Error TypeError: Invalid value for annotation field, expected a constant literal. */ /* @@? 21:40 Error TypeError: type String has no property named s */ diff --git a/ets2panda/test/ast/parser/ets/annotations_tests/annotationUsage_bad_param06.ets b/ets2panda/test/ast/parser/ets/annotations_tests/annotationUsage_bad_param06.ets index 9c370a5eb2d331e5ae72efffa39eb46e0102c42b..785dbfea7efe31217615a5b7f4a637f2d4b70a0d 100644 --- a/ets2panda/test/ast/parser/ets/annotations_tests/annotationUsage_bad_param06.ets +++ b/ets2panda/test/ast/parser/ets/annotations_tests/annotationUsage_bad_param06.ets @@ -22,3 +22,4 @@ class B{} /* @@@ label Error SyntaxError: Invalid value for annotation field, expected a constant literal. */ /* @@? 20:23 Error TypeError: Type '(a: Int) => void' cannot be assigned to type 'String' */ +/* @@? 20:23 Error TypeError: Invalid value for annotation field, expected a constant literal. */ diff --git a/ets2panda/test/ast/parser/ets/annotations_tests/annotationUsage_tmp.ets b/ets2panda/test/ast/parser/ets/annotations_tests/annotationUsage_tmp.ets index cbe206da4501889fc11d8d1278ed8f2380eb2644..7173d03c9b6bd42d7bd5f63767fa6e99bb266ed0 100644 --- a/ets2panda/test/ast/parser/ets/annotations_tests/annotationUsage_tmp.ets +++ b/ets2panda/test/ast/parser/ets/annotations_tests/annotationUsage_tmp.ets @@ -23,4 +23,5 @@ class A{} class B{} /* @@@ label Error SyntaxError: Invalid value for annotation field, expected a constant literal. */ -/* @@? 22:23 Error TypeError: Type 'A' cannot be assigned to type 'String' */ +/* @@@ label Error TypeError: Invalid value for annotation field, expected a constant literal. */ +/* @@@ label Error TypeError: Type 'A' cannot be assigned to type 'String' */ diff --git a/ets2panda/test/ast/parser/ets/constant_expression_divide_zero.ets b/ets2panda/test/ast/parser/ets/constant_expression_divide_zero.ets index 627345cdb3e23d9f1f22a5403522a3ff5c40d539..56d7728f427cc0275cd0fb1f19d53fc1e40b6134 100644 --- a/ets2panda/test/ast/parser/ets/constant_expression_divide_zero.ets +++ b/ets2panda/test/ast/parser/ets/constant_expression_divide_zero.ets @@ -25,5 +25,5 @@ enum Color { } -/* @@? 20:14 Error SyntaxError: Division by zero are not allowed. */ -/* @@? 24:11 Error SyntaxError: Division by zero are not allowed. */ +/* @@? 20:14 Error SyntaxError: Division by zero is not allowed. */ +/* @@? 24:11 Error SyntaxError: Division by zero is not allowed. */ diff --git a/ets2panda/test/ast/parser/ets/increment-on-nullish-type-undefined-invalid.ets b/ets2panda/test/ast/parser/ets/increment-on-nullish-type-undefined-invalid.ets index e3b52ed7aeb2e461a67468b93781a1b56ce68a38..19a718b9c640b37b4eef0d99ed81a490c1dbe523 100644 --- a/ets2panda/test/ast/parser/ets/increment-on-nullish-type-undefined-invalid.ets +++ b/ets2panda/test/ast/parser/ets/increment-on-nullish-type-undefined-invalid.ets @@ -14,9 +14,8 @@ */ function main(){ let a = 1; - a/* @@ label */~/* @@ label1 */!/* @@ label2 */; + a/* @@ label */~!/* @@ label2 */; } /* @@@ label Error SyntaxError: Unexpected token '~'. */ -/* @@@ label1 Error TypeError: Bad operand type, the type of the operand must be numeric type. */ /* @@@ label2 Error SyntaxError: Unexpected token ';'. */ /* @@@ label2 Error TypeError: Bad operand type, the type of the operand must be boolean type. */ diff --git a/ets2panda/test/ast/parser/ets/increment-on-nullish-type-undefined.ets b/ets2panda/test/ast/parser/ets/increment-on-nullish-type-undefined.ets index 975a0fe9468d1ec9432809dcf607e841c59d8adf..8ff53d347d508bb5812c2e703ff534e6949cbfe0 100644 --- a/ets2panda/test/ast/parser/ets/increment-on-nullish-type-undefined.ets +++ b/ets2panda/test/ast/parser/ets/increment-on-nullish-type-undefined.ets @@ -18,6 +18,4 @@ } /* @@? 17:3 Warning Warning: Bad operand type, the operand of the non-nullish expression is 'null' or 'undefined'. */ - /* @@? 17:3 Error TypeError: Cannot cast 'null' or 'undefined' to non-nullish type. */ /* @@? 17:3 Error TypeError: Type 'Double' cannot be assigned to type 'undefined' */ - diff --git a/ets2panda/test/ast/parser/ets/lambda-type-inference-overloaded-1.ets b/ets2panda/test/ast/parser/ets/lambda-type-inference-overloaded-1.ets index 8ab267434de4b279a18a4ac45f610e718e935e25..be682f7d2f1445a16670690f5652e3df7f3f69f3 100644 --- a/ets2panda/test/ast/parser/ets/lambda-type-inference-overloaded-1.ets +++ b/ets2panda/test/ast/parser/ets/lambda-type-inference-overloaded-1.ets @@ -36,3 +36,4 @@ function main(): void { /* @@@ label Error TypeError: Function foo with this assembly signature already declared. */ /* @@@ label1 Error TypeError: Type 'void' is not compatible with the enclosing method's return type 'Boolean' */ +/* @@? 28:9 Error TypeError: Type '(x: Double, y: String) => Boolean' is not compatible with type '(x: Int, y: String) => Boolean' at index 1 */ diff --git a/ets2panda/test/ast/parser/ets/readonly-parameter-test/Readonly-Array-test1.ets b/ets2panda/test/ast/parser/ets/readonly-parameter-test/Readonly-Array-test1.ets index 1b87bffb76dd983e1fb7db37f2d00945275475d8..a4cba4c0ae9bc6c2f4cdf283eca736656fa13703 100644 --- a/ets2panda/test/ast/parser/ets/readonly-parameter-test/Readonly-Array-test1.ets +++ b/ets2panda/test/ast/parser/ets/readonly-parameter-test/Readonly-Array-test1.ets @@ -19,4 +19,4 @@ function foo(x : readonly Array) let x1 : Array x1 = /* @@ label */x } -/* @@@ label Error TypeError: Type 'Readonly>' cannot be assigned to type 'Array' */ +/* @@@ label Error TypeError: Type 'readonly Array' cannot be assigned to type 'Array' */ diff --git a/ets2panda/test/ast/parser/ets/readonly-parameter-test/Readonly-Array-test3.ets b/ets2panda/test/ast/parser/ets/readonly-parameter-test/Readonly-Array-test3.ets index f7b0cff0a5a33d73103af7a07e0dd73fe8fc5398..2d5de9a3dfdfefd19b92b70c94fc8d0f0e302ac3 100644 --- a/ets2panda/test/ast/parser/ets/readonly-parameter-test/Readonly-Array-test3.ets +++ b/ets2panda/test/ast/parser/ets/readonly-parameter-test/Readonly-Array-test3.ets @@ -19,5 +19,5 @@ function foo (p: Array) { let x: readonly Array /* @@ label */foo(/* @@ label1 */x) -/* @@@ label Error TypeError: No matching call signature for foo(Readonly>) */ -/* @@@ label1 Error TypeError: Type 'Readonly>' is not compatible with type 'Array' at index 1 */ +/* @@@ label Error TypeError: No matching call signature for foo(readonly Array) */ +/* @@@ label1 Error TypeError: Type 'readonly Array' is not compatible with type 'Array' at index 1 */ diff --git a/ets2panda/test/ast/parser/ets/rest_parameter_07.ets b/ets2panda/test/ast/parser/ets/rest_parameter_07.ets index 450b5b113b129b6bb1c72e7cb91fda410b953a4d..bb610fd94a1ca494031f90c115e00146b7a20692 100644 --- a/ets2panda/test/ast/parser/ets/rest_parameter_07.ets +++ b/ets2panda/test/ast/parser/ets/rest_parameter_07.ets @@ -19,4 +19,4 @@ function sum(...numbers: [number, number, number]): number { /* @@ label1 */sum(10, 20, "one") -/* @@@ label1 Error TypeError: No matching call signature for sum(Int, Int, "one") */ +/* @@@ label1 Error TypeError: No matching call signature for sum(Double, Double, "one") */ diff --git a/ets2panda/test/ast/parser/ets/unexpected_token_22.ets b/ets2panda/test/ast/parser/ets/unexpected_token_22.ets index 156fad0c17fc3641010fbaf422355d0944cc7814..d6685631351c3f5cc95a16bd2df09d27473b6006 100644 --- a/ets2panda/test/ast/parser/ets/unexpected_token_22.ets +++ b/ets2panda/test/ast/parser/ets/unexpected_token_22.ets @@ -40,6 +40,3 @@ function main(): void { /* @@? 25:43 Error TypeError: Type '(_: Promise) => Promise' cannot be assigned to type '() => Promise' */ /* @@? 25:44 Error SyntaxError: Unexpected token, expected an identifier. */ /* @@? 25:60 Error SyntaxError: Unexpected token, expected ',' or ')'. */ -/* @@? 31:11 Error TypeError: Expected 1 arguments, got 0. */ -/* @@? 31:11 Error TypeError: No matching call signature */ -/* @@? 31:11 Error TypeError: 'await' expressions require Promise object as argument. */ diff --git a/ets2panda/test/compiler/ets/boxingConversion2-expected.txt b/ets2panda/test/compiler/ets/boxingConversion2-expected.txt index 0d27fe5b4d70065aba15396a4eed3df2bf54787d..24f3c862e0fe48b0ed989de377ab57bbe26c0755 100644 --- a/ets2panda/test/compiler/ets/boxingConversion2-expected.txt +++ b/ets2panda/test/compiler/ets/boxingConversion2-expected.txt @@ -2053,8 +2053,77 @@ } }, "init": { - "type": "NumberLiteral", - "value": 1, + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "Double", + "decorators": [], + "loc": { + "start": { + "line": 35, + "column": 20, + "program": "boxingConversion2.ets" + }, + "end": { + "line": 35, + "column": 26, + "program": "boxingConversion2.ets" + } + } + }, + "property": { + "type": "Identifier", + "name": "toFloat", + "decorators": [], + "loc": { + "start": { + "line": 35, + "column": 27, + "program": "boxingConversion2.ets" + }, + "end": { + "line": 35, + "column": 34, + "program": "boxingConversion2.ets" + } + } + }, + "computed": false, + "optional": false, + "loc": { + "start": { + "line": 35, + "column": 20, + "program": "boxingConversion2.ets" + }, + "end": { + "line": 35, + "column": 34, + "program": "boxingConversion2.ets" + } + } + }, + "arguments": [ + { + "type": "NumberLiteral", + "value": 1, + "loc": { + "start": { + "line": 35, + "column": 35, + "program": "boxingConversion2.ets" + }, + "end": { + "line": 35, + "column": 38, + "program": "boxingConversion2.ets" + } + } + } + ], + "optional": false, "loc": { "start": { "line": 35, @@ -2063,7 +2132,7 @@ }, "end": { "line": 35, - "column": 23, + "column": 39, "program": "boxingConversion2.ets" } } @@ -2076,7 +2145,7 @@ }, "end": { "line": 35, - "column": 23, + "column": 39, "program": "boxingConversion2.ets" } } @@ -2091,7 +2160,7 @@ }, "end": { "line": 35, - "column": 24, + "column": 40, "program": "boxingConversion2.ets" } } @@ -2166,8 +2235,77 @@ } }, "init": { - "type": "NumberLiteral", - "value": 1, + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "Double", + "decorators": [], + "loc": { + "start": { + "line": 36, + "column": 18, + "program": "boxingConversion2.ets" + }, + "end": { + "line": 36, + "column": 24, + "program": "boxingConversion2.ets" + } + } + }, + "property": { + "type": "Identifier", + "name": "toInt", + "decorators": [], + "loc": { + "start": { + "line": 36, + "column": 25, + "program": "boxingConversion2.ets" + }, + "end": { + "line": 36, + "column": 30, + "program": "boxingConversion2.ets" + } + } + }, + "computed": false, + "optional": false, + "loc": { + "start": { + "line": 36, + "column": 18, + "program": "boxingConversion2.ets" + }, + "end": { + "line": 36, + "column": 30, + "program": "boxingConversion2.ets" + } + } + }, + "arguments": [ + { + "type": "NumberLiteral", + "value": 1, + "loc": { + "start": { + "line": 36, + "column": 31, + "program": "boxingConversion2.ets" + }, + "end": { + "line": 36, + "column": 34, + "program": "boxingConversion2.ets" + } + } + } + ], + "optional": false, "loc": { "start": { "line": 36, @@ -2176,7 +2314,7 @@ }, "end": { "line": 36, - "column": 21, + "column": 35, "program": "boxingConversion2.ets" } } @@ -2189,7 +2327,7 @@ }, "end": { "line": 36, - "column": 21, + "column": 35, "program": "boxingConversion2.ets" } } @@ -2204,7 +2342,7 @@ }, "end": { "line": 36, - "column": 22, + "column": 36, "program": "boxingConversion2.ets" } } diff --git a/ets2panda/test/compiler/ets/boxingConversion2.ets b/ets2panda/test/compiler/ets/boxingConversion2.ets index 1da22d4fbd678783bd70795b7c07c05ae0c224b7..d7120fe162bb760b9d72ac1602b0246e878c1ae0 100644 --- a/ets2panda/test/compiler/ets/boxingConversion2.ets +++ b/ets2panda/test/compiler/ets/boxingConversion2.ets @@ -32,6 +32,6 @@ function main() : void { let p: Object = h; let q: Object = 8; let r: Object = 9.0; - let s: Float = 1.0; - let t: Int = 1.0; + let s: Float = Double.toFloat(1.0); + let t: Int = Double.toInt(1.0); } diff --git a/ets2panda/test/compiler/ets/conversion_w_functions-expected.txt b/ets2panda/test/compiler/ets/conversion_w_functions-expected.txt index af3444cb50f2d749ddc9c6836d7c16855a24c43c..561d477e9a47b2280a5dd46ce9276742c4f84457 100644 --- a/ets2panda/test/compiler/ets/conversion_w_functions-expected.txt +++ b/ets2panda/test/compiler/ets/conversion_w_functions-expected.txt @@ -636,13 +636,47 @@ { "type": "ReturnStatement", "argument": { - "type": "TSAsExpression", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "getI", - "decorators": [], + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "CallExpression", + "callee": { + "type": "Identifier", + "name": "getI", + "decorators": [], + "loc": { + "start": { + "line": 25, + "column": 12, + "program": "conversion_w_functions.ets" + }, + "end": { + "line": 25, + "column": 16, + "program": "conversion_w_functions.ets" + } + } + }, + "arguments": [ + { + "type": "NumberLiteral", + "value": 0, + "loc": { + "start": { + "line": 25, + "column": 17, + "program": "conversion_w_functions.ets" + }, + "end": { + "line": 25, + "column": 18, + "program": "conversion_w_functions.ets" + } + } + } + ], + "optional": false, "loc": { "start": { "line": 25, @@ -651,29 +685,29 @@ }, "end": { "line": 25, - "column": 16, + "column": 19, "program": "conversion_w_functions.ets" } } }, - "arguments": [ - { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 25, - "column": 17, - "program": "conversion_w_functions.ets" - }, - "end": { - "line": 25, - "column": 18, - "program": "conversion_w_functions.ets" - } + "property": { + "type": "Identifier", + "name": "toByte", + "decorators": [], + "loc": { + "start": { + "line": 25, + "column": 20, + "program": "conversion_w_functions.ets" + }, + "end": { + "line": 25, + "column": 26, + "program": "conversion_w_functions.ets" } } - ], + }, + "computed": false, "optional": false, "loc": { "start": { @@ -683,26 +717,13 @@ }, "end": { "line": 25, - "column": 19, - "program": "conversion_w_functions.ets" - } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 25, - "column": 23, - "program": "conversion_w_functions.ets" - }, - "end": { - "line": 25, - "column": 27, + "column": 26, "program": "conversion_w_functions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 25, @@ -711,7 +732,7 @@ }, "end": { "line": 25, - "column": 19, + "column": 28, "program": "conversion_w_functions.ets" } } @@ -724,7 +745,7 @@ }, "end": { "line": 25, - "column": 28, + "column": 29, "program": "conversion_w_functions.ets" } } @@ -886,13 +907,47 @@ { "type": "ReturnStatement", "argument": { - "type": "TSAsExpression", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "getI", - "decorators": [], + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "CallExpression", + "callee": { + "type": "Identifier", + "name": "getI", + "decorators": [], + "loc": { + "start": { + "line": 29, + "column": 12, + "program": "conversion_w_functions.ets" + }, + "end": { + "line": 29, + "column": 16, + "program": "conversion_w_functions.ets" + } + } + }, + "arguments": [ + { + "type": "NumberLiteral", + "value": 1, + "loc": { + "start": { + "line": 29, + "column": 17, + "program": "conversion_w_functions.ets" + }, + "end": { + "line": 29, + "column": 18, + "program": "conversion_w_functions.ets" + } + } + } + ], + "optional": false, "loc": { "start": { "line": 29, @@ -901,29 +956,29 @@ }, "end": { "line": 29, - "column": 16, + "column": 19, "program": "conversion_w_functions.ets" } } }, - "arguments": [ - { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 29, - "column": 17, - "program": "conversion_w_functions.ets" - }, - "end": { - "line": 29, - "column": 18, - "program": "conversion_w_functions.ets" - } + "property": { + "type": "Identifier", + "name": "toShort", + "decorators": [], + "loc": { + "start": { + "line": 29, + "column": 20, + "program": "conversion_w_functions.ets" + }, + "end": { + "line": 29, + "column": 27, + "program": "conversion_w_functions.ets" } } - ], + }, + "computed": false, "optional": false, "loc": { "start": { @@ -933,26 +988,13 @@ }, "end": { "line": 29, - "column": 19, - "program": "conversion_w_functions.ets" - } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 29, - "column": 23, - "program": "conversion_w_functions.ets" - }, - "end": { - "line": 29, - "column": 28, + "column": 27, "program": "conversion_w_functions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 29, @@ -961,7 +1003,7 @@ }, "end": { "line": 29, - "column": 19, + "column": 29, "program": "conversion_w_functions.ets" } } @@ -974,7 +1016,7 @@ }, "end": { "line": 29, - "column": 29, + "column": 30, "program": "conversion_w_functions.ets" } } @@ -1136,13 +1178,47 @@ { "type": "ReturnStatement", "argument": { - "type": "TSAsExpression", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "getI", - "decorators": [], + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "CallExpression", + "callee": { + "type": "Identifier", + "name": "getI", + "decorators": [], + "loc": { + "start": { + "line": 33, + "column": 12, + "program": "conversion_w_functions.ets" + }, + "end": { + "line": 33, + "column": 16, + "program": "conversion_w_functions.ets" + } + } + }, + "arguments": [ + { + "type": "NumberLiteral", + "value": 2, + "loc": { + "start": { + "line": 33, + "column": 17, + "program": "conversion_w_functions.ets" + }, + "end": { + "line": 33, + "column": 18, + "program": "conversion_w_functions.ets" + } + } + } + ], + "optional": false, "loc": { "start": { "line": 33, @@ -1151,29 +1227,29 @@ }, "end": { "line": 33, - "column": 16, + "column": 19, "program": "conversion_w_functions.ets" } } }, - "arguments": [ - { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 33, - "column": 17, - "program": "conversion_w_functions.ets" - }, - "end": { - "line": 33, - "column": 18, - "program": "conversion_w_functions.ets" - } + "property": { + "type": "Identifier", + "name": "toInt", + "decorators": [], + "loc": { + "start": { + "line": 33, + "column": 20, + "program": "conversion_w_functions.ets" + }, + "end": { + "line": 33, + "column": 25, + "program": "conversion_w_functions.ets" } } - ], + }, + "computed": false, "optional": false, "loc": { "start": { @@ -1183,26 +1259,13 @@ }, "end": { "line": 33, - "column": 19, - "program": "conversion_w_functions.ets" - } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 33, - "column": 23, - "program": "conversion_w_functions.ets" - }, - "end": { - "line": 33, - "column": 26, + "column": 25, "program": "conversion_w_functions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 33, @@ -1211,7 +1274,7 @@ }, "end": { "line": 33, - "column": 19, + "column": 27, "program": "conversion_w_functions.ets" } } @@ -1224,7 +1287,7 @@ }, "end": { "line": 33, - "column": 27, + "column": 28, "program": "conversion_w_functions.ets" } } @@ -1386,13 +1449,47 @@ { "type": "ReturnStatement", "argument": { - "type": "TSAsExpression", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "getI", - "decorators": [], + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "CallExpression", + "callee": { + "type": "Identifier", + "name": "getI", + "decorators": [], + "loc": { + "start": { + "line": 37, + "column": 12, + "program": "conversion_w_functions.ets" + }, + "end": { + "line": 37, + "column": 16, + "program": "conversion_w_functions.ets" + } + } + }, + "arguments": [ + { + "type": "NumberLiteral", + "value": 3, + "loc": { + "start": { + "line": 37, + "column": 17, + "program": "conversion_w_functions.ets" + }, + "end": { + "line": 37, + "column": 18, + "program": "conversion_w_functions.ets" + } + } + } + ], + "optional": false, "loc": { "start": { "line": 37, @@ -1401,29 +1498,29 @@ }, "end": { "line": 37, - "column": 16, + "column": 19, "program": "conversion_w_functions.ets" } } }, - "arguments": [ - { - "type": "NumberLiteral", - "value": 3, - "loc": { - "start": { - "line": 37, - "column": 17, - "program": "conversion_w_functions.ets" - }, - "end": { - "line": 37, - "column": 18, - "program": "conversion_w_functions.ets" - } + "property": { + "type": "Identifier", + "name": "toLong", + "decorators": [], + "loc": { + "start": { + "line": 37, + "column": 20, + "program": "conversion_w_functions.ets" + }, + "end": { + "line": 37, + "column": 26, + "program": "conversion_w_functions.ets" } } - ], + }, + "computed": false, "optional": false, "loc": { "start": { @@ -1433,26 +1530,13 @@ }, "end": { "line": 37, - "column": 19, - "program": "conversion_w_functions.ets" - } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 37, - "column": 23, - "program": "conversion_w_functions.ets" - }, - "end": { - "line": 37, - "column": 27, + "column": 26, "program": "conversion_w_functions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 37, @@ -1461,7 +1545,7 @@ }, "end": { "line": 37, - "column": 19, + "column": 28, "program": "conversion_w_functions.ets" } } @@ -1474,7 +1558,7 @@ }, "end": { "line": 37, - "column": 28, + "column": 29, "program": "conversion_w_functions.ets" } } @@ -1636,13 +1720,47 @@ { "type": "ReturnStatement", "argument": { - "type": "TSAsExpression", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "getI", - "decorators": [], + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "CallExpression", + "callee": { + "type": "Identifier", + "name": "getI", + "decorators": [], + "loc": { + "start": { + "line": 41, + "column": 12, + "program": "conversion_w_functions.ets" + }, + "end": { + "line": 41, + "column": 16, + "program": "conversion_w_functions.ets" + } + } + }, + "arguments": [ + { + "type": "NumberLiteral", + "value": 4, + "loc": { + "start": { + "line": 41, + "column": 17, + "program": "conversion_w_functions.ets" + }, + "end": { + "line": 41, + "column": 18, + "program": "conversion_w_functions.ets" + } + } + } + ], + "optional": false, "loc": { "start": { "line": 41, @@ -1651,29 +1769,29 @@ }, "end": { "line": 41, - "column": 16, + "column": 19, "program": "conversion_w_functions.ets" } } }, - "arguments": [ - { - "type": "NumberLiteral", - "value": 4, - "loc": { - "start": { - "line": 41, - "column": 17, - "program": "conversion_w_functions.ets" - }, - "end": { - "line": 41, - "column": 18, - "program": "conversion_w_functions.ets" - } + "property": { + "type": "Identifier", + "name": "toFloat", + "decorators": [], + "loc": { + "start": { + "line": 41, + "column": 20, + "program": "conversion_w_functions.ets" + }, + "end": { + "line": 41, + "column": 27, + "program": "conversion_w_functions.ets" } } - ], + }, + "computed": false, "optional": false, "loc": { "start": { @@ -1683,26 +1801,13 @@ }, "end": { "line": 41, - "column": 19, - "program": "conversion_w_functions.ets" - } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 41, - "column": 23, - "program": "conversion_w_functions.ets" - }, - "end": { - "line": 41, - "column": 28, + "column": 27, "program": "conversion_w_functions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 41, @@ -1711,7 +1816,7 @@ }, "end": { "line": 41, - "column": 19, + "column": 29, "program": "conversion_w_functions.ets" } } @@ -1724,7 +1829,7 @@ }, "end": { "line": 41, - "column": 29, + "column": 30, "program": "conversion_w_functions.ets" } } @@ -1886,13 +1991,47 @@ { "type": "ReturnStatement", "argument": { - "type": "TSAsExpression", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "getD", - "decorators": [], + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "CallExpression", + "callee": { + "type": "Identifier", + "name": "getD", + "decorators": [], + "loc": { + "start": { + "line": 45, + "column": 12, + "program": "conversion_w_functions.ets" + }, + "end": { + "line": 45, + "column": 16, + "program": "conversion_w_functions.ets" + } + } + }, + "arguments": [ + { + "type": "NumberLiteral", + "value": 4, + "loc": { + "start": { + "line": 45, + "column": 17, + "program": "conversion_w_functions.ets" + }, + "end": { + "line": 45, + "column": 20, + "program": "conversion_w_functions.ets" + } + } + } + ], + "optional": false, "loc": { "start": { "line": 45, @@ -1901,29 +2040,29 @@ }, "end": { "line": 45, - "column": 16, + "column": 21, "program": "conversion_w_functions.ets" } } }, - "arguments": [ - { - "type": "NumberLiteral", - "value": 4, - "loc": { - "start": { - "line": 45, - "column": 17, - "program": "conversion_w_functions.ets" - }, - "end": { - "line": 45, - "column": 20, - "program": "conversion_w_functions.ets" - } + "property": { + "type": "Identifier", + "name": "toFloat", + "decorators": [], + "loc": { + "start": { + "line": 45, + "column": 22, + "program": "conversion_w_functions.ets" + }, + "end": { + "line": 45, + "column": 29, + "program": "conversion_w_functions.ets" } } - ], + }, + "computed": false, "optional": false, "loc": { "start": { @@ -1933,26 +2072,13 @@ }, "end": { "line": 45, - "column": 21, - "program": "conversion_w_functions.ets" - } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 45, - "column": 25, - "program": "conversion_w_functions.ets" - }, - "end": { - "line": 45, - "column": 30, + "column": 29, "program": "conversion_w_functions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 45, @@ -1961,7 +2087,7 @@ }, "end": { "line": 45, - "column": 21, + "column": 31, "program": "conversion_w_functions.ets" } } @@ -1974,7 +2100,7 @@ }, "end": { "line": 45, - "column": 31, + "column": 32, "program": "conversion_w_functions.ets" } } @@ -2136,13 +2262,47 @@ { "type": "ReturnStatement", "argument": { - "type": "TSAsExpression", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "getI", - "decorators": [], + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "CallExpression", + "callee": { + "type": "Identifier", + "name": "getI", + "decorators": [], + "loc": { + "start": { + "line": 49, + "column": 12, + "program": "conversion_w_functions.ets" + }, + "end": { + "line": 49, + "column": 16, + "program": "conversion_w_functions.ets" + } + } + }, + "arguments": [ + { + "type": "NumberLiteral", + "value": 5, + "loc": { + "start": { + "line": 49, + "column": 17, + "program": "conversion_w_functions.ets" + }, + "end": { + "line": 49, + "column": 18, + "program": "conversion_w_functions.ets" + } + } + } + ], + "optional": false, "loc": { "start": { "line": 49, @@ -2151,29 +2311,29 @@ }, "end": { "line": 49, - "column": 16, + "column": 19, "program": "conversion_w_functions.ets" } } }, - "arguments": [ - { - "type": "NumberLiteral", - "value": 5, - "loc": { - "start": { - "line": 49, - "column": 17, - "program": "conversion_w_functions.ets" - }, - "end": { - "line": 49, - "column": 18, - "program": "conversion_w_functions.ets" - } + "property": { + "type": "Identifier", + "name": "toDouble", + "decorators": [], + "loc": { + "start": { + "line": 49, + "column": 20, + "program": "conversion_w_functions.ets" + }, + "end": { + "line": 49, + "column": 28, + "program": "conversion_w_functions.ets" } } - ], + }, + "computed": false, "optional": false, "loc": { "start": { @@ -2183,26 +2343,13 @@ }, "end": { "line": 49, - "column": 19, - "program": "conversion_w_functions.ets" - } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 49, - "column": 23, - "program": "conversion_w_functions.ets" - }, - "end": { - "line": 49, - "column": 29, + "column": 28, "program": "conversion_w_functions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 49, @@ -2211,7 +2358,7 @@ }, "end": { "line": 49, - "column": 19, + "column": 30, "program": "conversion_w_functions.ets" } } @@ -2224,7 +2371,7 @@ }, "end": { "line": 49, - "column": 30, + "column": 31, "program": "conversion_w_functions.ets" } } @@ -2386,13 +2533,47 @@ { "type": "ReturnStatement", "argument": { - "type": "TSAsExpression", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "getD", - "decorators": [], + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "CallExpression", + "callee": { + "type": "Identifier", + "name": "getD", + "decorators": [], + "loc": { + "start": { + "line": 53, + "column": 12, + "program": "conversion_w_functions.ets" + }, + "end": { + "line": 53, + "column": 16, + "program": "conversion_w_functions.ets" + } + } + }, + "arguments": [ + { + "type": "NumberLiteral", + "value": 5, + "loc": { + "start": { + "line": 53, + "column": 17, + "program": "conversion_w_functions.ets" + }, + "end": { + "line": 53, + "column": 20, + "program": "conversion_w_functions.ets" + } + } + } + ], + "optional": false, "loc": { "start": { "line": 53, @@ -2401,29 +2582,29 @@ }, "end": { "line": 53, - "column": 16, + "column": 21, "program": "conversion_w_functions.ets" } } }, - "arguments": [ - { - "type": "NumberLiteral", - "value": 5, - "loc": { - "start": { - "line": 53, - "column": 17, - "program": "conversion_w_functions.ets" - }, - "end": { - "line": 53, - "column": 20, - "program": "conversion_w_functions.ets" - } + "property": { + "type": "Identifier", + "name": "toDouble", + "decorators": [], + "loc": { + "start": { + "line": 53, + "column": 22, + "program": "conversion_w_functions.ets" + }, + "end": { + "line": 53, + "column": 30, + "program": "conversion_w_functions.ets" } } - ], + }, + "computed": false, "optional": false, "loc": { "start": { @@ -2433,26 +2614,13 @@ }, "end": { "line": 53, - "column": 21, - "program": "conversion_w_functions.ets" - } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 53, - "column": 25, - "program": "conversion_w_functions.ets" - }, - "end": { - "line": 53, - "column": 31, + "column": 30, "program": "conversion_w_functions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 53, @@ -2461,7 +2629,7 @@ }, "end": { "line": 53, - "column": 21, + "column": 32, "program": "conversion_w_functions.ets" } } @@ -2474,7 +2642,7 @@ }, "end": { "line": 53, - "column": 32, + "column": 33, "program": "conversion_w_functions.ets" } } @@ -2636,13 +2804,47 @@ { "type": "ReturnStatement", "argument": { - "type": "TSAsExpression", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "getI", - "decorators": [], + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "CallExpression", + "callee": { + "type": "Identifier", + "name": "getI", + "decorators": [], + "loc": { + "start": { + "line": 57, + "column": 12, + "program": "conversion_w_functions.ets" + }, + "end": { + "line": 57, + "column": 16, + "program": "conversion_w_functions.ets" + } + } + }, + "arguments": [ + { + "type": "NumberLiteral", + "value": 65, + "loc": { + "start": { + "line": 57, + "column": 17, + "program": "conversion_w_functions.ets" + }, + "end": { + "line": 57, + "column": 19, + "program": "conversion_w_functions.ets" + } + } + } + ], + "optional": false, "loc": { "start": { "line": 57, @@ -2651,29 +2853,29 @@ }, "end": { "line": 57, - "column": 16, + "column": 20, "program": "conversion_w_functions.ets" } } }, - "arguments": [ - { - "type": "NumberLiteral", - "value": 65, - "loc": { - "start": { - "line": 57, - "column": 17, - "program": "conversion_w_functions.ets" - }, - "end": { - "line": 57, - "column": 19, - "program": "conversion_w_functions.ets" - } + "property": { + "type": "Identifier", + "name": "toChar", + "decorators": [], + "loc": { + "start": { + "line": 57, + "column": 21, + "program": "conversion_w_functions.ets" + }, + "end": { + "line": 57, + "column": 27, + "program": "conversion_w_functions.ets" } } - ], + }, + "computed": false, "optional": false, "loc": { "start": { @@ -2683,26 +2885,13 @@ }, "end": { "line": 57, - "column": 20, - "program": "conversion_w_functions.ets" - } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 57, - "column": 24, - "program": "conversion_w_functions.ets" - }, - "end": { - "line": 57, - "column": 28, + "column": 27, "program": "conversion_w_functions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 57, @@ -2711,7 +2900,7 @@ }, "end": { "line": 57, - "column": 20, + "column": 29, "program": "conversion_w_functions.ets" } } @@ -2724,7 +2913,7 @@ }, "end": { "line": 57, - "column": 29, + "column": 30, "program": "conversion_w_functions.ets" } } @@ -2886,13 +3075,47 @@ { "type": "ReturnStatement", "argument": { - "type": "TSAsExpression", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "getD", - "decorators": [], + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "CallExpression", + "callee": { + "type": "Identifier", + "name": "getD", + "decorators": [], + "loc": { + "start": { + "line": 61, + "column": 12, + "program": "conversion_w_functions.ets" + }, + "end": { + "line": 61, + "column": 16, + "program": "conversion_w_functions.ets" + } + } + }, + "arguments": [ + { + "type": "NumberLiteral", + "value": 1, + "loc": { + "start": { + "line": 61, + "column": 17, + "program": "conversion_w_functions.ets" + }, + "end": { + "line": 61, + "column": 20, + "program": "conversion_w_functions.ets" + } + } + } + ], + "optional": false, "loc": { "start": { "line": 61, @@ -2901,29 +3124,29 @@ }, "end": { "line": 61, - "column": 16, + "column": 21, "program": "conversion_w_functions.ets" } } }, - "arguments": [ - { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 61, - "column": 17, - "program": "conversion_w_functions.ets" - }, - "end": { - "line": 61, - "column": 20, - "program": "conversion_w_functions.ets" - } + "property": { + "type": "Identifier", + "name": "toShort", + "decorators": [], + "loc": { + "start": { + "line": 61, + "column": 22, + "program": "conversion_w_functions.ets" + }, + "end": { + "line": 61, + "column": 29, + "program": "conversion_w_functions.ets" } } - ], + }, + "computed": false, "optional": false, "loc": { "start": { @@ -2933,26 +3156,13 @@ }, "end": { "line": 61, - "column": 21, - "program": "conversion_w_functions.ets" - } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 61, - "column": 25, - "program": "conversion_w_functions.ets" - }, - "end": { - "line": 61, - "column": 30, + "column": 29, "program": "conversion_w_functions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 61, @@ -2961,7 +3171,7 @@ }, "end": { "line": 61, - "column": 21, + "column": 31, "program": "conversion_w_functions.ets" } } @@ -2974,7 +3184,7 @@ }, "end": { "line": 61, - "column": 31, + "column": 32, "program": "conversion_w_functions.ets" } } @@ -3136,13 +3346,47 @@ { "type": "ReturnStatement", "argument": { - "type": "TSAsExpression", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "getD", - "decorators": [], + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "CallExpression", + "callee": { + "type": "Identifier", + "name": "getD", + "decorators": [], + "loc": { + "start": { + "line": 65, + "column": 12, + "program": "conversion_w_functions.ets" + }, + "end": { + "line": 65, + "column": 16, + "program": "conversion_w_functions.ets" + } + } + }, + "arguments": [ + { + "type": "NumberLiteral", + "value": 2, + "loc": { + "start": { + "line": 65, + "column": 17, + "program": "conversion_w_functions.ets" + }, + "end": { + "line": 65, + "column": 20, + "program": "conversion_w_functions.ets" + } + } + } + ], + "optional": false, "loc": { "start": { "line": 65, @@ -3151,29 +3395,29 @@ }, "end": { "line": 65, - "column": 16, + "column": 21, "program": "conversion_w_functions.ets" } } }, - "arguments": [ - { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 65, - "column": 17, - "program": "conversion_w_functions.ets" - }, - "end": { - "line": 65, - "column": 20, - "program": "conversion_w_functions.ets" - } + "property": { + "type": "Identifier", + "name": "toInt", + "decorators": [], + "loc": { + "start": { + "line": 65, + "column": 22, + "program": "conversion_w_functions.ets" + }, + "end": { + "line": 65, + "column": 27, + "program": "conversion_w_functions.ets" } } - ], + }, + "computed": false, "optional": false, "loc": { "start": { @@ -3183,26 +3427,13 @@ }, "end": { "line": 65, - "column": 21, - "program": "conversion_w_functions.ets" - } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 65, - "column": 25, - "program": "conversion_w_functions.ets" - }, - "end": { - "line": 65, - "column": 28, + "column": 27, "program": "conversion_w_functions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 65, @@ -3211,7 +3442,7 @@ }, "end": { "line": 65, - "column": 21, + "column": 29, "program": "conversion_w_functions.ets" } } @@ -3224,7 +3455,7 @@ }, "end": { "line": 65, - "column": 29, + "column": 30, "program": "conversion_w_functions.ets" } } @@ -3386,13 +3617,47 @@ { "type": "ReturnStatement", "argument": { - "type": "TSAsExpression", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "getD", - "decorators": [], + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "CallExpression", + "callee": { + "type": "Identifier", + "name": "getD", + "decorators": [], + "loc": { + "start": { + "line": 69, + "column": 12, + "program": "conversion_w_functions.ets" + }, + "end": { + "line": 69, + "column": 16, + "program": "conversion_w_functions.ets" + } + } + }, + "arguments": [ + { + "type": "NumberLiteral", + "value": 3, + "loc": { + "start": { + "line": 69, + "column": 17, + "program": "conversion_w_functions.ets" + }, + "end": { + "line": 69, + "column": 20, + "program": "conversion_w_functions.ets" + } + } + } + ], + "optional": false, "loc": { "start": { "line": 69, @@ -3401,29 +3666,29 @@ }, "end": { "line": 69, - "column": 16, + "column": 21, "program": "conversion_w_functions.ets" } } }, - "arguments": [ - { - "type": "NumberLiteral", - "value": 3, - "loc": { - "start": { - "line": 69, - "column": 17, - "program": "conversion_w_functions.ets" - }, - "end": { - "line": 69, - "column": 20, - "program": "conversion_w_functions.ets" - } + "property": { + "type": "Identifier", + "name": "toLong", + "decorators": [], + "loc": { + "start": { + "line": 69, + "column": 22, + "program": "conversion_w_functions.ets" + }, + "end": { + "line": 69, + "column": 28, + "program": "conversion_w_functions.ets" } } - ], + }, + "computed": false, "optional": false, "loc": { "start": { @@ -3433,26 +3698,13 @@ }, "end": { "line": 69, - "column": 21, - "program": "conversion_w_functions.ets" - } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 69, - "column": 25, - "program": "conversion_w_functions.ets" - }, - "end": { - "line": 69, - "column": 29, + "column": 28, "program": "conversion_w_functions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 69, @@ -3461,7 +3713,7 @@ }, "end": { "line": 69, - "column": 21, + "column": 30, "program": "conversion_w_functions.ets" } } @@ -3474,7 +3726,7 @@ }, "end": { "line": 69, - "column": 30, + "column": 31, "program": "conversion_w_functions.ets" } } @@ -3636,13 +3888,47 @@ { "type": "ReturnStatement", "argument": { - "type": "TSAsExpression", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "getD", - "decorators": [], + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "CallExpression", + "callee": { + "type": "Identifier", + "name": "getD", + "decorators": [], + "loc": { + "start": { + "line": 73, + "column": 12, + "program": "conversion_w_functions.ets" + }, + "end": { + "line": 73, + "column": 16, + "program": "conversion_w_functions.ets" + } + } + }, + "arguments": [ + { + "type": "NumberLiteral", + "value": 65, + "loc": { + "start": { + "line": 73, + "column": 17, + "program": "conversion_w_functions.ets" + }, + "end": { + "line": 73, + "column": 21, + "program": "conversion_w_functions.ets" + } + } + } + ], + "optional": false, "loc": { "start": { "line": 73, @@ -3651,29 +3937,29 @@ }, "end": { "line": 73, - "column": 16, + "column": 22, "program": "conversion_w_functions.ets" } } }, - "arguments": [ - { - "type": "NumberLiteral", - "value": 65, - "loc": { - "start": { - "line": 73, - "column": 17, - "program": "conversion_w_functions.ets" - }, - "end": { - "line": 73, - "column": 21, - "program": "conversion_w_functions.ets" - } + "property": { + "type": "Identifier", + "name": "toChar", + "decorators": [], + "loc": { + "start": { + "line": 73, + "column": 23, + "program": "conversion_w_functions.ets" + }, + "end": { + "line": 73, + "column": 29, + "program": "conversion_w_functions.ets" } } - ], + }, + "computed": false, "optional": false, "loc": { "start": { @@ -3683,26 +3969,13 @@ }, "end": { "line": 73, - "column": 22, - "program": "conversion_w_functions.ets" - } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 73, - "column": 26, - "program": "conversion_w_functions.ets" - }, - "end": { - "line": 73, - "column": 30, + "column": 29, "program": "conversion_w_functions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 73, @@ -3711,7 +3984,7 @@ }, "end": { "line": 73, - "column": 22, + "column": 31, "program": "conversion_w_functions.ets" } } @@ -3724,7 +3997,7 @@ }, "end": { "line": 73, - "column": 31, + "column": 32, "program": "conversion_w_functions.ets" } } diff --git a/ets2panda/test/compiler/ets/conversion_w_functions.ets b/ets2panda/test/compiler/ets/conversion_w_functions.ets index bd0c38e4e96ce4088acf8fb407d7d96d66cd1911..0cb8cddda395a74a36d2a3b171a17fd45459e0d3 100644 --- a/ets2panda/test/compiler/ets/conversion_w_functions.ets +++ b/ets2panda/test/compiler/ets/conversion_w_functions.ets @@ -22,55 +22,55 @@ function getD(d : double): double { } function apple(): Byte { - return getI(0) as byte; + return getI(0).toByte(); } function banana(): Short { - return getI(1) as short; + return getI(1).toShort(); } function cherry(): Int { - return getI(2) as int; + return getI(2).toInt(); } function date(): Long { - return getI(3) as long; + return getI(3).toLong(); } function elderberry(): Float { - return getI(4) as float; + return getI(4).toFloat(); } function fig(): Float { - return getD(4.0) as float; + return getD(4.0).toFloat(); } function grape(): Double { - return getI(5) as double; + return getI(5).toDouble(); } function honeydewmelon(): Double { - return getD(5.0) as double; + return getD(5.0).toDouble(); } function indian_fig(): Char { - return getI(65) as char; + return getI(65).toChar(); } function raspberry(): Short { - return getD(1.0) as short; + return getD(1.0).toShort(); } function strawberry(): Int { - return getD(2.0) as int; + return getD(2.0).toInt(); } function tomato(): Long { - return getD(3.0) as long; + return getD(3.0).toLong(); } function uglifruit(): Char { - return getD(65.0) as char; + return getD(65.0).toChar(); } function main(): void {} diff --git a/ets2panda/test/compiler/ets/generic_arrayaslist-expected.txt b/ets2panda/test/compiler/ets/generic_arrayaslist-expected.txt index cade2472970f5eaff18a86a2af7106fcd3cda443..19c0a2013938e6fe2f6334cb0c4d395889526f84 100644 --- a/ets2panda/test/compiler/ets/generic_arrayaslist-expected.txt +++ b/ets2panda/test/compiler/ets/generic_arrayaslist-expected.txt @@ -7791,13 +7791,47 @@ }, "arguments": [ { - "type": "TSAsExpression", - "expression": { + "type": "CallExpression", + "callee": { "type": "MemberExpression", "object": { "type": "MemberExpression", "object": { - "type": "ThisExpression", + "type": "MemberExpression", + "object": { + "type": "ThisExpression", + "loc": { + "start": { + "line": 82, + "column": 59, + "program": "generic_arrayaslist.ets" + }, + "end": { + "line": 82, + "column": 63, + "program": "generic_arrayaslist.ets" + } + } + }, + "property": { + "type": "Identifier", + "name": "data", + "decorators": [], + "loc": { + "start": { + "line": 82, + "column": 64, + "program": "generic_arrayaslist.ets" + }, + "end": { + "line": 82, + "column": 68, + "program": "generic_arrayaslist.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 82, @@ -7806,24 +7840,24 @@ }, "end": { "line": 82, - "column": 63, + "column": 68, "program": "generic_arrayaslist.ets" } } }, "property": { "type": "Identifier", - "name": "data", + "name": "length", "decorators": [], "loc": { "start": { "line": 82, - "column": 64, + "column": 69, "program": "generic_arrayaslist.ets" }, "end": { "line": 82, - "column": 68, + "column": 75, "program": "generic_arrayaslist.ets" } } @@ -7838,24 +7872,24 @@ }, "end": { "line": 82, - "column": 68, + "column": 75, "program": "generic_arrayaslist.ets" } } }, "property": { "type": "Identifier", - "name": "length", + "name": "toInt", "decorators": [], "loc": { "start": { "line": 82, - "column": 69, + "column": 76, "program": "generic_arrayaslist.ets" }, "end": { "line": 82, - "column": 75, + "column": 81, "program": "generic_arrayaslist.ets" } } @@ -7870,26 +7904,13 @@ }, "end": { "line": 82, - "column": 75, - "program": "generic_arrayaslist.ets" - } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 82, - "column": 79, - "program": "generic_arrayaslist.ets" - }, - "end": { - "line": 82, - "column": 82, + "column": 81, "program": "generic_arrayaslist.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 82, @@ -7898,7 +7919,7 @@ }, "end": { "line": 82, - "column": 75, + "column": 83, "program": "generic_arrayaslist.ets" } } @@ -7913,7 +7934,7 @@ }, "end": { "line": 82, - "column": 83, + "column": 84, "program": "generic_arrayaslist.ets" } } @@ -7926,7 +7947,7 @@ }, "end": { "line": 82, - "column": 84, + "column": 85, "program": "generic_arrayaslist.ets" } } @@ -7939,7 +7960,7 @@ }, "end": { "line": 82, - "column": 84, + "column": 85, "program": "generic_arrayaslist.ets" } } @@ -7952,7 +7973,7 @@ }, "end": { "line": 82, - "column": 85, + "column": 86, "program": "generic_arrayaslist.ets" } } @@ -10297,13 +10318,47 @@ }, "arguments": [ { - "type": "TSAsExpression", - "expression": { + "type": "CallExpression", + "callee": { "type": "MemberExpression", "object": { "type": "MemberExpression", "object": { - "type": "ThisExpression", + "type": "MemberExpression", + "object": { + "type": "ThisExpression", + "loc": { + "start": { + "line": 104, + "column": 67, + "program": "generic_arrayaslist.ets" + }, + "end": { + "line": 104, + "column": 71, + "program": "generic_arrayaslist.ets" + } + } + }, + "property": { + "type": "Identifier", + "name": "data", + "decorators": [], + "loc": { + "start": { + "line": 104, + "column": 72, + "program": "generic_arrayaslist.ets" + }, + "end": { + "line": 104, + "column": 76, + "program": "generic_arrayaslist.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 104, @@ -10312,24 +10367,24 @@ }, "end": { "line": 104, - "column": 71, + "column": 76, "program": "generic_arrayaslist.ets" } } }, "property": { "type": "Identifier", - "name": "data", + "name": "length", "decorators": [], "loc": { "start": { "line": 104, - "column": 72, + "column": 77, "program": "generic_arrayaslist.ets" }, "end": { "line": 104, - "column": 76, + "column": 83, "program": "generic_arrayaslist.ets" } } @@ -10344,24 +10399,24 @@ }, "end": { "line": 104, - "column": 76, + "column": 83, "program": "generic_arrayaslist.ets" } } }, "property": { "type": "Identifier", - "name": "length", + "name": "toInt", "decorators": [], "loc": { "start": { "line": 104, - "column": 77, + "column": 84, "program": "generic_arrayaslist.ets" }, "end": { "line": 104, - "column": 83, + "column": 89, "program": "generic_arrayaslist.ets" } } @@ -10376,26 +10431,13 @@ }, "end": { "line": 104, - "column": 83, - "program": "generic_arrayaslist.ets" - } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 104, - "column": 87, - "program": "generic_arrayaslist.ets" - }, - "end": { - "line": 104, - "column": 90, + "column": 89, "program": "generic_arrayaslist.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 104, @@ -10404,7 +10446,7 @@ }, "end": { "line": 104, - "column": 83, + "column": 91, "program": "generic_arrayaslist.ets" } } @@ -10419,7 +10461,7 @@ }, "end": { "line": 104, - "column": 91, + "column": 92, "program": "generic_arrayaslist.ets" } } @@ -10432,7 +10474,7 @@ }, "end": { "line": 104, - "column": 92, + "column": 93, "program": "generic_arrayaslist.ets" } } @@ -10445,7 +10487,7 @@ }, "end": { "line": 104, - "column": 92, + "column": 93, "program": "generic_arrayaslist.ets" } } @@ -10460,7 +10502,7 @@ }, "end": { "line": 104, - "column": 93, + "column": 94, "program": "generic_arrayaslist.ets" } } diff --git a/ets2panda/test/compiler/ets/generic_arrayaslist.ets b/ets2panda/test/compiler/ets/generic_arrayaslist.ets index 22de891fc37989db27984bc51878bd6d951c1610..b3bad0b348f756090c03315994b04b98a3d85ad2 100644 --- a/ets2panda/test/compiler/ets/generic_arrayaslist.ets +++ b/ets2panda/test/compiler/ets/generic_arrayaslist.ets @@ -79,7 +79,7 @@ class ArrayAsListt implements Listt { public override pushFront(e: T): void { let dst = this.data; if (this.curSize == this.data.length) { - dst = new (T | undefined)[this.getNewCapacity(this.data.length as int)]; + dst = new (T | undefined)[this.getNewCapacity(this.data.length.toInt())]; } for (let i = this.curSize; i != 0; --i) { dst[i] = this.data[i-1]; @@ -101,7 +101,7 @@ class ArrayAsListt implements Listt { public override pushBack(e: T): void { if (this.curSize == this.data.length) { - let newData = new (T | undefined)[this.getNewCapacity(this.data.length as int)]; + let newData = new (T | undefined)[this.getNewCapacity(this.data.length.toInt())]; for (let i = 0; i < this.curSize; ++i) { newData[i] = this.data[i]; } diff --git a/ets2panda/test/compiler/ets/implicit-conversion-expected.txt b/ets2panda/test/compiler/ets/implicit-conversion-expected.txt index 9c26969875912c82348538395eb802f53cc679b7..6ec3601199214bc6ce6380b03c92c6cb6e0a275c 100644 --- a/ets2panda/test/compiler/ets/implicit-conversion-expected.txt +++ b/ets2panda/test/compiler/ets/implicit-conversion-expected.txt @@ -606,8 +606,77 @@ } }, "init": { - "type": "NumberLiteral", - "value": 3, + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "Double", + "decorators": [], + "loc": { + "start": { + "line": 20, + "column": 23, + "program": "implicit-conversion.ets" + }, + "end": { + "line": 20, + "column": 29, + "program": "implicit-conversion.ets" + } + } + }, + "property": { + "type": "Identifier", + "name": "toLong", + "decorators": [], + "loc": { + "start": { + "line": 20, + "column": 30, + "program": "implicit-conversion.ets" + }, + "end": { + "line": 20, + "column": 36, + "program": "implicit-conversion.ets" + } + } + }, + "computed": false, + "optional": false, + "loc": { + "start": { + "line": 20, + "column": 23, + "program": "implicit-conversion.ets" + }, + "end": { + "line": 20, + "column": 36, + "program": "implicit-conversion.ets" + } + } + }, + "arguments": [ + { + "type": "NumberLiteral", + "value": 3, + "loc": { + "start": { + "line": 20, + "column": 37, + "program": "implicit-conversion.ets" + }, + "end": { + "line": 20, + "column": 40, + "program": "implicit-conversion.ets" + } + } + } + ], + "optional": false, "loc": { "start": { "line": 20, @@ -616,7 +685,7 @@ }, "end": { "line": 20, - "column": 26, + "column": 41, "program": "implicit-conversion.ets" } } @@ -629,7 +698,7 @@ }, "end": { "line": 20, - "column": 26, + "column": 41, "program": "implicit-conversion.ets" } } @@ -644,7 +713,7 @@ }, "end": { "line": 20, - "column": 27, + "column": 42, "program": "implicit-conversion.ets" } } @@ -719,8 +788,77 @@ } }, "init": { - "type": "NumberLiteral", - "value": 4, + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "Double", + "decorators": [], + "loc": { + "start": { + "line": 21, + "column": 30, + "program": "implicit-conversion.ets" + }, + "end": { + "line": 21, + "column": 36, + "program": "implicit-conversion.ets" + } + } + }, + "property": { + "type": "Identifier", + "name": "toFloat", + "decorators": [], + "loc": { + "start": { + "line": 21, + "column": 37, + "program": "implicit-conversion.ets" + }, + "end": { + "line": 21, + "column": 44, + "program": "implicit-conversion.ets" + } + } + }, + "computed": false, + "optional": false, + "loc": { + "start": { + "line": 21, + "column": 30, + "program": "implicit-conversion.ets" + }, + "end": { + "line": 21, + "column": 44, + "program": "implicit-conversion.ets" + } + } + }, + "arguments": [ + { + "type": "NumberLiteral", + "value": 4, + "loc": { + "start": { + "line": 21, + "column": 45, + "program": "implicit-conversion.ets" + }, + "end": { + "line": 21, + "column": 48, + "program": "implicit-conversion.ets" + } + } + } + ], + "optional": false, "loc": { "start": { "line": 21, @@ -729,7 +867,7 @@ }, "end": { "line": 21, - "column": 33, + "column": 49, "program": "implicit-conversion.ets" } } @@ -742,7 +880,7 @@ }, "end": { "line": 21, - "column": 33, + "column": 49, "program": "implicit-conversion.ets" } } @@ -757,7 +895,7 @@ }, "end": { "line": 21, - "column": 34, + "column": 50, "program": "implicit-conversion.ets" } } @@ -832,8 +970,77 @@ } }, "init": { - "type": "NumberLiteral", - "value": 4, + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "Double", + "decorators": [], + "loc": { + "start": { + "line": 22, + "column": 23, + "program": "implicit-conversion.ets" + }, + "end": { + "line": 22, + "column": 29, + "program": "implicit-conversion.ets" + } + } + }, + "property": { + "type": "Identifier", + "name": "toFloat", + "decorators": [], + "loc": { + "start": { + "line": 22, + "column": 30, + "program": "implicit-conversion.ets" + }, + "end": { + "line": 22, + "column": 37, + "program": "implicit-conversion.ets" + } + } + }, + "computed": false, + "optional": false, + "loc": { + "start": { + "line": 22, + "column": 23, + "program": "implicit-conversion.ets" + }, + "end": { + "line": 22, + "column": 37, + "program": "implicit-conversion.ets" + } + } + }, + "arguments": [ + { + "type": "NumberLiteral", + "value": 4, + "loc": { + "start": { + "line": 22, + "column": 38, + "program": "implicit-conversion.ets" + }, + "end": { + "line": 22, + "column": 41, + "program": "implicit-conversion.ets" + } + } + } + ], + "optional": false, "loc": { "start": { "line": 22, @@ -842,7 +1049,7 @@ }, "end": { "line": 22, - "column": 26, + "column": 42, "program": "implicit-conversion.ets" } } @@ -855,7 +1062,7 @@ }, "end": { "line": 22, - "column": 26, + "column": 42, "program": "implicit-conversion.ets" } } @@ -870,7 +1077,7 @@ }, "end": { "line": 22, - "column": 27, + "column": 43, "program": "implicit-conversion.ets" } } @@ -1284,8 +1491,77 @@ } }, "init": { - "type": "NumberLiteral", - "value": 1, + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "Double", + "decorators": [], + "loc": { + "start": { + "line": 28, + "column": 29, + "program": "implicit-conversion.ets" + }, + "end": { + "line": 28, + "column": 35, + "program": "implicit-conversion.ets" + } + } + }, + "property": { + "type": "Identifier", + "name": "toShort", + "decorators": [], + "loc": { + "start": { + "line": 28, + "column": 36, + "program": "implicit-conversion.ets" + }, + "end": { + "line": 28, + "column": 43, + "program": "implicit-conversion.ets" + } + } + }, + "computed": false, + "optional": false, + "loc": { + "start": { + "line": 28, + "column": 29, + "program": "implicit-conversion.ets" + }, + "end": { + "line": 28, + "column": 43, + "program": "implicit-conversion.ets" + } + } + }, + "arguments": [ + { + "type": "NumberLiteral", + "value": 1, + "loc": { + "start": { + "line": 28, + "column": 44, + "program": "implicit-conversion.ets" + }, + "end": { + "line": 28, + "column": 47, + "program": "implicit-conversion.ets" + } + } + } + ], + "optional": false, "loc": { "start": { "line": 28, @@ -1294,7 +1570,7 @@ }, "end": { "line": 28, - "column": 32, + "column": 48, "program": "implicit-conversion.ets" } } @@ -1307,7 +1583,7 @@ }, "end": { "line": 28, - "column": 32, + "column": 48, "program": "implicit-conversion.ets" } } @@ -1322,7 +1598,7 @@ }, "end": { "line": 28, - "column": 33, + "column": 49, "program": "implicit-conversion.ets" } } @@ -1397,8 +1673,77 @@ } }, "init": { - "type": "NumberLiteral", - "value": 2, + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "Double", + "decorators": [], + "loc": { + "start": { + "line": 29, + "column": 28, + "program": "implicit-conversion.ets" + }, + "end": { + "line": 29, + "column": 34, + "program": "implicit-conversion.ets" + } + } + }, + "property": { + "type": "Identifier", + "name": "toInt", + "decorators": [], + "loc": { + "start": { + "line": 29, + "column": 35, + "program": "implicit-conversion.ets" + }, + "end": { + "line": 29, + "column": 40, + "program": "implicit-conversion.ets" + } + } + }, + "computed": false, + "optional": false, + "loc": { + "start": { + "line": 29, + "column": 28, + "program": "implicit-conversion.ets" + }, + "end": { + "line": 29, + "column": 40, + "program": "implicit-conversion.ets" + } + } + }, + "arguments": [ + { + "type": "NumberLiteral", + "value": 2, + "loc": { + "start": { + "line": 29, + "column": 41, + "program": "implicit-conversion.ets" + }, + "end": { + "line": 29, + "column": 44, + "program": "implicit-conversion.ets" + } + } + } + ], + "optional": false, "loc": { "start": { "line": 29, @@ -1407,7 +1752,7 @@ }, "end": { "line": 29, - "column": 31, + "column": 45, "program": "implicit-conversion.ets" } } @@ -1420,7 +1765,7 @@ }, "end": { "line": 29, - "column": 31, + "column": 45, "program": "implicit-conversion.ets" } } @@ -1435,7 +1780,7 @@ }, "end": { "line": 29, - "column": 32, + "column": 46, "program": "implicit-conversion.ets" } } @@ -1510,8 +1855,77 @@ } }, "init": { - "type": "NumberLiteral", - "value": 3, + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "Double", + "decorators": [], + "loc": { + "start": { + "line": 30, + "column": 25, + "program": "implicit-conversion.ets" + }, + "end": { + "line": 30, + "column": 31, + "program": "implicit-conversion.ets" + } + } + }, + "property": { + "type": "Identifier", + "name": "toLong", + "decorators": [], + "loc": { + "start": { + "line": 30, + "column": 32, + "program": "implicit-conversion.ets" + }, + "end": { + "line": 30, + "column": 38, + "program": "implicit-conversion.ets" + } + } + }, + "computed": false, + "optional": false, + "loc": { + "start": { + "line": 30, + "column": 25, + "program": "implicit-conversion.ets" + }, + "end": { + "line": 30, + "column": 38, + "program": "implicit-conversion.ets" + } + } + }, + "arguments": [ + { + "type": "NumberLiteral", + "value": 3, + "loc": { + "start": { + "line": 30, + "column": 39, + "program": "implicit-conversion.ets" + }, + "end": { + "line": 30, + "column": 42, + "program": "implicit-conversion.ets" + } + } + } + ], + "optional": false, "loc": { "start": { "line": 30, @@ -1520,7 +1934,7 @@ }, "end": { "line": 30, - "column": 28, + "column": 43, "program": "implicit-conversion.ets" } } @@ -1533,7 +1947,7 @@ }, "end": { "line": 30, - "column": 28, + "column": 43, "program": "implicit-conversion.ets" } } @@ -1548,7 +1962,7 @@ }, "end": { "line": 30, - "column": 29, + "column": 44, "program": "implicit-conversion.ets" } } @@ -1623,8 +2037,77 @@ } }, "init": { - "type": "NumberLiteral", - "value": 65, + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "Double", + "decorators": [], + "loc": { + "start": { + "line": 31, + "column": 28, + "program": "implicit-conversion.ets" + }, + "end": { + "line": 31, + "column": 34, + "program": "implicit-conversion.ets" + } + } + }, + "property": { + "type": "Identifier", + "name": "toChar", + "decorators": [], + "loc": { + "start": { + "line": 31, + "column": 35, + "program": "implicit-conversion.ets" + }, + "end": { + "line": 31, + "column": 41, + "program": "implicit-conversion.ets" + } + } + }, + "computed": false, + "optional": false, + "loc": { + "start": { + "line": 31, + "column": 28, + "program": "implicit-conversion.ets" + }, + "end": { + "line": 31, + "column": 41, + "program": "implicit-conversion.ets" + } + } + }, + "arguments": [ + { + "type": "NumberLiteral", + "value": 65, + "loc": { + "start": { + "line": 31, + "column": 42, + "program": "implicit-conversion.ets" + }, + "end": { + "line": 31, + "column": 46, + "program": "implicit-conversion.ets" + } + } + } + ], + "optional": false, "loc": { "start": { "line": 31, @@ -1633,7 +2116,7 @@ }, "end": { "line": 31, - "column": 32, + "column": 47, "program": "implicit-conversion.ets" } } @@ -1646,7 +2129,7 @@ }, "end": { "line": 31, - "column": 32, + "column": 47, "program": "implicit-conversion.ets" } } @@ -1661,7 +2144,7 @@ }, "end": { "line": 31, - "column": 33, + "column": 48, "program": "implicit-conversion.ets" } } diff --git a/ets2panda/test/compiler/ets/implicit-conversion.ets b/ets2panda/test/compiler/ets/implicit-conversion.ets index cd25af09f446c50f7bbe6e5a11fd6de8691047e6..9b6aedc3a39db153eb35129a326a74590552605a 100644 --- a/ets2panda/test/compiler/ets/implicit-conversion.ets +++ b/ets2panda/test/compiler/ets/implicit-conversion.ets @@ -17,18 +17,18 @@ function main(): void { let apple : Byte = 0; let banana : Short = 1; let cherry : Int = 2; - let date : Long = 3.0; - let elderberry : Float = 4.0; - let fig : Float = 4.0; + let date : Long = Double.toLong(3.0); + let elderberry : Float = Double.toFloat(4.0); + let fig : Float = Double.toFloat(4.0); let grape : Double = -5.0; let honeydewmelon : Double = 5.0; let indian_fig : Char = 65; - let raspberry : Short = 1.0; - let strawberry : Int = 2.0; - let tomato : Long = 3.0; - let uglifruit : Char = 65.0; + let raspberry : Short = Double.toShort(1.0); + let strawberry : Int = Double.toInt(2.0); + let tomato : Long = Double.toLong(3.0); + let uglifruit : Char = Double.toChar(65.0); return; } diff --git a/ets2panda/test/compiler/ets/lambda_unresolved_ref_1-expected.txt b/ets2panda/test/compiler/ets/lambda_unresolved_ref_1-expected.txt index a2c1ec433988affa5f2ae2385a900a1b3a38a172..798ebcd03794685f7aea651f67ec00907072d2d1 100644 --- a/ets2panda/test/compiler/ets/lambda_unresolved_ref_1-expected.txt +++ b/ets2panda/test/compiler/ets/lambda_unresolved_ref_1-expected.txt @@ -2813,43 +2813,77 @@ } }, "right": { - "type": "TSAsExpression", - "expression": { - "type": "BinaryExpression", - "operator": "+", - "left": { - "type": "Identifier", - "name": "v", - "decorators": [], + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "BinaryExpression", + "operator": "+", + "left": { + "type": "Identifier", + "name": "v", + "decorators": [], + "loc": { + "start": { + "line": 42, + "column": 19, + "program": "lambda_unresolved_ref_1.ets" + }, + "end": { + "line": 42, + "column": 20, + "program": "lambda_unresolved_ref_1.ets" + } + } + }, + "right": { + "type": "NumberLiteral", + "value": 1, + "loc": { + "start": { + "line": 42, + "column": 23, + "program": "lambda_unresolved_ref_1.ets" + }, + "end": { + "line": 42, + "column": 24, + "program": "lambda_unresolved_ref_1.ets" + } + } + }, "loc": { "start": { "line": 42, - "column": 19, + "column": 18, "program": "lambda_unresolved_ref_1.ets" }, "end": { "line": 42, - "column": 20, + "column": 25, "program": "lambda_unresolved_ref_1.ets" } } }, - "right": { - "type": "NumberLiteral", - "value": 1, + "property": { + "type": "Identifier", + "name": "toShort", + "decorators": [], "loc": { "start": { "line": 42, - "column": 23, + "column": 26, "program": "lambda_unresolved_ref_1.ets" }, "end": { "line": 42, - "column": 24, + "column": 33, "program": "lambda_unresolved_ref_1.ets" } } }, + "computed": false, + "optional": false, "loc": { "start": { "line": 42, @@ -2858,26 +2892,13 @@ }, "end": { "line": 42, - "column": 25, - "program": "lambda_unresolved_ref_1.ets" - } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 42, - "column": 29, - "program": "lambda_unresolved_ref_1.ets" - }, - "end": { - "line": 42, - "column": 34, + "column": 33, "program": "lambda_unresolved_ref_1.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 42, @@ -2886,7 +2907,7 @@ }, "end": { "line": 42, - "column": 25, + "column": 35, "program": "lambda_unresolved_ref_1.ets" } } @@ -2899,7 +2920,7 @@ }, "end": { "line": 42, - "column": 25, + "column": 35, "program": "lambda_unresolved_ref_1.ets" } } @@ -2912,7 +2933,7 @@ }, "end": { "line": 42, - "column": 35, + "column": 36, "program": "lambda_unresolved_ref_1.ets" } } @@ -3795,43 +3816,77 @@ } }, "right": { - "type": "TSAsExpression", - "expression": { - "type": "BinaryExpression", - "operator": "+", - "left": { - "type": "Identifier", - "name": "v", - "decorators": [], + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "BinaryExpression", + "operator": "+", + "left": { + "type": "Identifier", + "name": "v", + "decorators": [], + "loc": { + "start": { + "line": 53, + "column": 19, + "program": "lambda_unresolved_ref_1.ets" + }, + "end": { + "line": 53, + "column": 20, + "program": "lambda_unresolved_ref_1.ets" + } + } + }, + "right": { + "type": "NumberLiteral", + "value": 1, + "loc": { + "start": { + "line": 53, + "column": 23, + "program": "lambda_unresolved_ref_1.ets" + }, + "end": { + "line": 53, + "column": 24, + "program": "lambda_unresolved_ref_1.ets" + } + } + }, "loc": { "start": { "line": 53, - "column": 19, + "column": 18, "program": "lambda_unresolved_ref_1.ets" }, "end": { "line": 53, - "column": 20, + "column": 25, "program": "lambda_unresolved_ref_1.ets" } } }, - "right": { - "type": "NumberLiteral", - "value": 1, + "property": { + "type": "Identifier", + "name": "toShort", + "decorators": [], "loc": { "start": { "line": 53, - "column": 23, + "column": 26, "program": "lambda_unresolved_ref_1.ets" }, "end": { "line": 53, - "column": 24, + "column": 33, "program": "lambda_unresolved_ref_1.ets" } } }, + "computed": false, + "optional": false, "loc": { "start": { "line": 53, @@ -3840,26 +3895,13 @@ }, "end": { "line": 53, - "column": 25, - "program": "lambda_unresolved_ref_1.ets" - } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 53, - "column": 29, - "program": "lambda_unresolved_ref_1.ets" - }, - "end": { - "line": 53, - "column": 34, + "column": 33, "program": "lambda_unresolved_ref_1.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 53, @@ -3868,7 +3910,7 @@ }, "end": { "line": 53, - "column": 25, + "column": 35, "program": "lambda_unresolved_ref_1.ets" } } @@ -3881,7 +3923,7 @@ }, "end": { "line": 53, - "column": 25, + "column": 35, "program": "lambda_unresolved_ref_1.ets" } } @@ -3894,7 +3936,7 @@ }, "end": { "line": 53, - "column": 35, + "column": 36, "program": "lambda_unresolved_ref_1.ets" } } diff --git a/ets2panda/test/compiler/ets/lambda_unresolved_ref_1.ets b/ets2panda/test/compiler/ets/lambda_unresolved_ref_1.ets index 77bfd3af41edc99184413b9277097f329ba596ce..ea4d2663c9826e8d07956307a3489a23083db3c7 100644 --- a/ets2panda/test/compiler/ets/lambda_unresolved_ref_1.ets +++ b/ets2panda/test/compiler/ets/lambda_unresolved_ref_1.ets @@ -39,7 +39,7 @@ function foo2(arr: Object[]): void { function bar(): void { let arr: short[] = [1,2,3,4] let fn: (v: short) => void = (v: short): void => { - arr[0] = (v + 1) as short; + arr[0] = (v + 1).toShort(); } for (let arr = 0; arr < 4; ++arr) { } arr = [3]; @@ -50,7 +50,7 @@ function bar(): void { function main() { let arr: short[] = [1,2,3,4] let fn: (v: short) => void = (v: short): void => { - arr[0] = (v + 1) as short; + arr[0] = (v + 1).toShort(); } for (let i = 0; i < 4; ++i) { } } diff --git a/ets2panda/test/compiler/ets/launch_expression-expected.txt b/ets2panda/test/compiler/ets/launch_expression-expected.txt index 8c8e6cf95172948c5faee77b8330f5ce4c5dccdd..fd80bda1792350308bd5eda705414625ae3cdebd 100644 --- a/ets2panda/test/compiler/ets/launch_expression-expected.txt +++ b/ets2panda/test/compiler/ets/launch_expression-expected.txt @@ -1447,7 +1447,7 @@ "loc": { "start": { "line": 27, - "column": 21, + "column": 60, "program": "launch_expression.ets" }, "end": { @@ -1902,7 +1902,7 @@ "loc": { "start": { "line": 31, - "column": 9, + "column": 14, "program": "launch_expression.ets" }, "end": { @@ -2569,7 +2569,7 @@ "loc": { "start": { "line": 36, - "column": 51, + "column": 53, "program": "launch_expression.ets" }, "end": { @@ -3644,7 +3644,7 @@ "loc": { "start": { "line": 45, - "column": 9, + "column": 14, "program": "launch_expression.ets" }, "end": { @@ -4109,7 +4109,7 @@ "loc": { "start": { "line": 50, - "column": 36, + "column": 38, "program": "launch_expression.ets" }, "end": { diff --git a/ets2panda/test/compiler/ets/override16-expected.txt b/ets2panda/test/compiler/ets/override16-expected.txt index 5947eedf223d866e65b73c2079992200fc0bfeec..3032322afa62b34cf771fba75688d959d1eef349 100644 --- a/ets2panda/test/compiler/ets/override16-expected.txt +++ b/ets2panda/test/compiler/ets/override16-expected.txt @@ -448,8 +448,77 @@ { "type": "ReturnStatement", "argument": { - "type": "NumberLiteral", - "value": 1, + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "Double", + "decorators": [], + "loc": { + "start": { + "line": 24, + "column": 12, + "program": "override16.ets" + }, + "end": { + "line": 24, + "column": 18, + "program": "override16.ets" + } + } + }, + "property": { + "type": "Identifier", + "name": "toFloat", + "decorators": [], + "loc": { + "start": { + "line": 24, + "column": 19, + "program": "override16.ets" + }, + "end": { + "line": 24, + "column": 26, + "program": "override16.ets" + } + } + }, + "computed": false, + "optional": false, + "loc": { + "start": { + "line": 24, + "column": 12, + "program": "override16.ets" + }, + "end": { + "line": 24, + "column": 26, + "program": "override16.ets" + } + } + }, + "arguments": [ + { + "type": "NumberLiteral", + "value": 1, + "loc": { + "start": { + "line": 24, + "column": 27, + "program": "override16.ets" + }, + "end": { + "line": 24, + "column": 30, + "program": "override16.ets" + } + } + } + ], + "optional": false, "loc": { "start": { "line": 24, @@ -458,7 +527,7 @@ }, "end": { "line": 24, - "column": 15, + "column": 31, "program": "override16.ets" } } @@ -471,7 +540,7 @@ }, "end": { "line": 24, - "column": 16, + "column": 32, "program": "override16.ets" } } diff --git a/ets2panda/test/compiler/ets/override16.ets b/ets2panda/test/compiler/ets/override16.ets index b497db15d0b38f72bc3261845ae3bfcd8804dd49..9c6d91c759642839f4de38435bc629039b147f9a 100644 --- a/ets2panda/test/compiler/ets/override16.ets +++ b/ets2panda/test/compiler/ets/override16.ets @@ -21,6 +21,6 @@ class A { class B extends A { fn(): float { - return 1.0; + return Double.toFloat(1.0); } } diff --git a/ets2panda/test/compiler/ets/override17-expected.txt b/ets2panda/test/compiler/ets/override17-expected.txt index fd757fd65555e44ce435fb917aa63bd85412b98b..bdf99d6d06e72500d298e55ce9f546ae035bd379 100644 --- a/ets2panda/test/compiler/ets/override17-expected.txt +++ b/ets2panda/test/compiler/ets/override17-expected.txt @@ -448,8 +448,77 @@ { "type": "ReturnStatement", "argument": { - "type": "NumberLiteral", - "value": 1, + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "Double", + "decorators": [], + "loc": { + "start": { + "line": 24, + "column": 12, + "program": "override17.ets" + }, + "end": { + "line": 24, + "column": 18, + "program": "override17.ets" + } + } + }, + "property": { + "type": "Identifier", + "name": "toFloat", + "decorators": [], + "loc": { + "start": { + "line": 24, + "column": 19, + "program": "override17.ets" + }, + "end": { + "line": 24, + "column": 26, + "program": "override17.ets" + } + } + }, + "computed": false, + "optional": false, + "loc": { + "start": { + "line": 24, + "column": 12, + "program": "override17.ets" + }, + "end": { + "line": 24, + "column": 26, + "program": "override17.ets" + } + } + }, + "arguments": [ + { + "type": "NumberLiteral", + "value": 1, + "loc": { + "start": { + "line": 24, + "column": 27, + "program": "override17.ets" + }, + "end": { + "line": 24, + "column": 30, + "program": "override17.ets" + } + } + } + ], + "optional": false, "loc": { "start": { "line": 24, @@ -458,7 +527,7 @@ }, "end": { "line": 24, - "column": 15, + "column": 31, "program": "override17.ets" } } @@ -471,7 +540,7 @@ }, "end": { "line": 24, - "column": 16, + "column": 32, "program": "override17.ets" } } diff --git a/ets2panda/test/compiler/ets/override17.ets b/ets2panda/test/compiler/ets/override17.ets index 1212c96bcf3538157691ae7e3db1816e5b41d2cb..8e9e61a926431aeb13eb4d05257679553c4288ed 100644 --- a/ets2panda/test/compiler/ets/override17.ets +++ b/ets2panda/test/compiler/ets/override17.ets @@ -21,6 +21,6 @@ class A { class B extends A { static fn(): float { - return 1.0; + return Double.toFloat(1.0); } } diff --git a/ets2panda/test/parser/ets/AccessNBody-expected.txt b/ets2panda/test/parser/ets/AccessNBody-expected.txt index c3bb92a60e7edbebc90b84ca8652fb5186f62780..83b4155c9916a209df937ae675e73704c31960fa 100644 --- a/ets2panda/test/parser/ets/AccessNBody-expected.txt +++ b/ets2panda/test/parser/ets/AccessNBody-expected.txt @@ -3382,13 +3382,47 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { + "type": "CallExpression", + "callee": { "type": "MemberExpression", "object": { "type": "MemberExpression", "object": { - "type": "ThisExpression", + "type": "MemberExpression", + "object": { + "type": "ThisExpression", + "loc": { + "start": { + "line": 53, + "column": 27, + "program": "AccessNBody.ets" + }, + "end": { + "line": 53, + "column": 31, + "program": "AccessNBody.ets" + } + } + }, + "property": { + "type": "Identifier", + "name": "bodies", + "decorators": [], + "loc": { + "start": { + "line": 53, + "column": 32, + "program": "AccessNBody.ets" + }, + "end": { + "line": 53, + "column": 38, + "program": "AccessNBody.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 53, @@ -3397,24 +3431,24 @@ }, "end": { "line": 53, - "column": 31, + "column": 38, "program": "AccessNBody.ets" } } }, "property": { "type": "Identifier", - "name": "bodies", + "name": "length", "decorators": [], "loc": { "start": { "line": 53, - "column": 32, + "column": 39, "program": "AccessNBody.ets" }, "end": { "line": 53, - "column": 38, + "column": 45, "program": "AccessNBody.ets" } } @@ -3429,24 +3463,24 @@ }, "end": { "line": 53, - "column": 38, + "column": 45, "program": "AccessNBody.ets" } } }, "property": { "type": "Identifier", - "name": "length", + "name": "toInt", "decorators": [], "loc": { "start": { "line": 53, - "column": 39, + "column": 46, "program": "AccessNBody.ets" }, "end": { "line": 53, - "column": 45, + "column": 51, "program": "AccessNBody.ets" } } @@ -3461,26 +3495,13 @@ }, "end": { "line": 53, - "column": 45, - "program": "AccessNBody.ets" - } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 53, - "column": 49, - "program": "AccessNBody.ets" - }, - "end": { - "line": 53, - "column": 52, + "column": 51, "program": "AccessNBody.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 53, @@ -3489,7 +3510,7 @@ }, "end": { "line": 53, - "column": 45, + "column": 53, "program": "AccessNBody.ets" } } @@ -3502,7 +3523,7 @@ }, "end": { "line": 53, - "column": 45, + "column": 53, "program": "AccessNBody.ets" } } @@ -3517,7 +3538,7 @@ }, "end": { "line": 53, - "column": 53, + "column": 54, "program": "AccessNBody.ets" } } @@ -5149,13 +5170,47 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { + "type": "CallExpression", + "callee": { "type": "MemberExpression", "object": { "type": "MemberExpression", "object": { - "type": "ThisExpression", + "type": "MemberExpression", + "object": { + "type": "ThisExpression", + "loc": { + "start": { + "line": 70, + "column": 27, + "program": "AccessNBody.ets" + }, + "end": { + "line": 70, + "column": 31, + "program": "AccessNBody.ets" + } + } + }, + "property": { + "type": "Identifier", + "name": "bodies", + "decorators": [], + "loc": { + "start": { + "line": 70, + "column": 32, + "program": "AccessNBody.ets" + }, + "end": { + "line": 70, + "column": 38, + "program": "AccessNBody.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 70, @@ -5164,24 +5219,24 @@ }, "end": { "line": 70, - "column": 31, + "column": 38, "program": "AccessNBody.ets" } } }, "property": { "type": "Identifier", - "name": "bodies", + "name": "length", "decorators": [], "loc": { "start": { "line": 70, - "column": 32, + "column": 39, "program": "AccessNBody.ets" }, "end": { "line": 70, - "column": 38, + "column": 45, "program": "AccessNBody.ets" } } @@ -5196,24 +5251,24 @@ }, "end": { "line": 70, - "column": 38, + "column": 45, "program": "AccessNBody.ets" } } }, "property": { "type": "Identifier", - "name": "length", + "name": "toInt", "decorators": [], "loc": { "start": { "line": 70, - "column": 39, + "column": 46, "program": "AccessNBody.ets" }, "end": { "line": 70, - "column": 45, + "column": 51, "program": "AccessNBody.ets" } } @@ -5228,26 +5283,13 @@ }, "end": { "line": 70, - "column": 45, - "program": "AccessNBody.ets" - } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 70, - "column": 49, - "program": "AccessNBody.ets" - }, - "end": { - "line": 70, - "column": 52, + "column": 51, "program": "AccessNBody.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 70, @@ -5256,7 +5298,7 @@ }, "end": { "line": 70, - "column": 45, + "column": 53, "program": "AccessNBody.ets" } } @@ -5269,7 +5311,7 @@ }, "end": { "line": 70, - "column": 45, + "column": 53, "program": "AccessNBody.ets" } } @@ -5284,7 +5326,7 @@ }, "end": { "line": 70, - "column": 53, + "column": 54, "program": "AccessNBody.ets" } } @@ -9577,13 +9619,47 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { + "type": "CallExpression", + "callee": { "type": "MemberExpression", "object": { "type": "MemberExpression", "object": { - "type": "ThisExpression", + "type": "MemberExpression", + "object": { + "type": "ThisExpression", + "loc": { + "start": { + "line": 101, + "column": 27, + "program": "AccessNBody.ets" + }, + "end": { + "line": 101, + "column": 31, + "program": "AccessNBody.ets" + } + } + }, + "property": { + "type": "Identifier", + "name": "bodies", + "decorators": [], + "loc": { + "start": { + "line": 101, + "column": 32, + "program": "AccessNBody.ets" + }, + "end": { + "line": 101, + "column": 38, + "program": "AccessNBody.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 101, @@ -9592,24 +9668,24 @@ }, "end": { "line": 101, - "column": 31, + "column": 38, "program": "AccessNBody.ets" } } }, "property": { "type": "Identifier", - "name": "bodies", + "name": "length", "decorators": [], "loc": { "start": { "line": 101, - "column": 32, + "column": 39, "program": "AccessNBody.ets" }, "end": { "line": 101, - "column": 38, + "column": 45, "program": "AccessNBody.ets" } } @@ -9624,24 +9700,24 @@ }, "end": { "line": 101, - "column": 38, + "column": 45, "program": "AccessNBody.ets" } } }, "property": { "type": "Identifier", - "name": "length", + "name": "toInt", "decorators": [], "loc": { "start": { "line": 101, - "column": 39, + "column": 46, "program": "AccessNBody.ets" }, "end": { "line": 101, - "column": 45, + "column": 51, "program": "AccessNBody.ets" } } @@ -9656,26 +9732,13 @@ }, "end": { "line": 101, - "column": 45, - "program": "AccessNBody.ets" - } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 101, - "column": 49, - "program": "AccessNBody.ets" - }, - "end": { - "line": 101, - "column": 52, + "column": 51, "program": "AccessNBody.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 101, @@ -9684,7 +9747,7 @@ }, "end": { "line": 101, - "column": 45, + "column": 53, "program": "AccessNBody.ets" } } @@ -9697,7 +9760,7 @@ }, "end": { "line": 101, - "column": 45, + "column": 53, "program": "AccessNBody.ets" } } @@ -9712,7 +9775,7 @@ }, "end": { "line": 101, - "column": 53, + "column": 54, "program": "AccessNBody.ets" } } diff --git a/ets2panda/test/parser/ets/AccessNBody.ets b/ets2panda/test/parser/ets/AccessNBody.ets index 8a8f4db207439314f7cb1478ea3ed8780202614f..301cc6c5523deebd675f3b1511f9b9384467fcb1 100644 --- a/ets2panda/test/parser/ets/AccessNBody.ets +++ b/ets2panda/test/parser/ets/AccessNBody.ets @@ -50,7 +50,7 @@ class NBodySystem { let px : double = 0.0; let py : double = 0.0; let pz : double = 0.0; - let size : int = this.bodies.length as int; + let size : int = this.bodies.length.toInt(); for (let i : int = 0; i < size; i++) { let b : Body = this.bodies[i]; let m : double = b.mass; @@ -67,7 +67,7 @@ class NBodySystem { let dz : double ; let distance : double ; let mag : double ; - let size : int = this.bodies.length as int; + let size : int = this.bodies.length.toInt(); for (let i : int = 0; i < size; i++) { let bodyi : Body = this.bodies[i]; for (let j : int = i + 1; j < size; j++) { @@ -98,7 +98,7 @@ class NBodySystem { let dz : double ; let distance : double ; let e : double = 0.0; - let size : int = this.bodies.length as int; + let size : int = this.bodies.length.toInt(); for (let i : int = 0; i < size; i++) { let bodyi : Body = this.bodies[i]; e += 0.5 * bodyi.mass * (bodyi.vx * bodyi.vx + bodyi.vy * bodyi.vy + bodyi.vz * bodyi.vz); diff --git a/ets2panda/test/parser/ets/MathCordic-expected.txt b/ets2panda/test/parser/ets/MathCordic-expected.txt index 24aa1ecc1730b94e251c4f20df0bfc1d46d5a8a6..254da34932b405bbf8ec87ec0cdc141884f9712e 100644 --- a/ets2panda/test/parser/ets/MathCordic-expected.txt +++ b/ets2panda/test/parser/ets/MathCordic-expected.txt @@ -3243,39 +3243,60 @@ "type": "BinaryExpression", "operator": ">>", "left": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "y", - "decorators": [], - "loc": { - "start": { - "line": 45, - "column": 29, - "program": "MathCordic.ets" - }, - "end": { - "line": 45, - "column": 30, - "program": "MathCordic.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "y", + "decorators": [], + "loc": { + "start": { + "line": 45, + "column": 29, + "program": "MathCordic.ets" + }, + "end": { + "line": 45, + "column": 30, + "program": "MathCordic.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toInt", + "decorators": [], + "loc": { + "start": { + "line": 45, + "column": 31, + "program": "MathCordic.ets" + }, + "end": { + "line": 45, + "column": 36, + "program": "MathCordic.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 45, - "column": 34, + "column": 29, "program": "MathCordic.ets" }, "end": { "line": 45, - "column": 37, + "column": 36, "program": "MathCordic.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 45, @@ -3284,7 +3305,7 @@ }, "end": { "line": 45, - "column": 30, + "column": 38, "program": "MathCordic.ets" } } @@ -3296,12 +3317,12 @@ "loc": { "start": { "line": 45, - "column": 41, + "column": 42, "program": "MathCordic.ets" }, "end": { "line": 45, - "column": 45, + "column": 46, "program": "MathCordic.ets" } } @@ -3314,7 +3335,7 @@ }, "end": { "line": 45, - "column": 46, + "column": 47, "program": "MathCordic.ets" } } @@ -3327,7 +3348,7 @@ }, "end": { "line": 45, - "column": 46, + "column": 47, "program": "MathCordic.ets" } } @@ -3340,7 +3361,7 @@ }, "end": { "line": 45, - "column": 46, + "column": 47, "program": "MathCordic.ets" } } @@ -3353,7 +3374,7 @@ }, "end": { "line": 45, - "column": 47, + "column": 48, "program": "MathCordic.ets" } } @@ -3387,39 +3408,60 @@ "type": "BinaryExpression", "operator": ">>", "left": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "x", - "decorators": [], - "loc": { - "start": { - "line": 46, - "column": 22, - "program": "MathCordic.ets" - }, - "end": { - "line": 46, - "column": 23, - "program": "MathCordic.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "x", + "decorators": [], + "loc": { + "start": { + "line": 46, + "column": 22, + "program": "MathCordic.ets" + }, + "end": { + "line": 46, + "column": 23, + "program": "MathCordic.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toInt", + "decorators": [], + "loc": { + "start": { + "line": 46, + "column": 24, + "program": "MathCordic.ets" + }, + "end": { + "line": 46, + "column": 29, + "program": "MathCordic.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 46, - "column": 27, + "column": 22, "program": "MathCordic.ets" }, "end": { "line": 46, - "column": 30, + "column": 29, "program": "MathCordic.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 46, @@ -3428,7 +3470,7 @@ }, "end": { "line": 46, - "column": 23, + "column": 31, "program": "MathCordic.ets" } } @@ -3440,12 +3482,12 @@ "loc": { "start": { "line": 46, - "column": 34, + "column": 35, "program": "MathCordic.ets" }, "end": { "line": 46, - "column": 38, + "column": 39, "program": "MathCordic.ets" } } @@ -3458,7 +3500,7 @@ }, "end": { "line": 46, - "column": 39, + "column": 40, "program": "MathCordic.ets" } } @@ -3470,12 +3512,12 @@ "loc": { "start": { "line": 46, - "column": 42, + "column": 43, "program": "MathCordic.ets" }, "end": { "line": 46, - "column": 43, + "column": 44, "program": "MathCordic.ets" } } @@ -3488,7 +3530,7 @@ }, "end": { "line": 46, - "column": 43, + "column": 44, "program": "MathCordic.ets" } } @@ -3501,7 +3543,7 @@ }, "end": { "line": 46, - "column": 43, + "column": 44, "program": "MathCordic.ets" } } @@ -3514,7 +3556,7 @@ }, "end": { "line": 46, - "column": 44, + "column": 45, "program": "MathCordic.ets" } } @@ -3780,39 +3822,60 @@ "type": "BinaryExpression", "operator": ">>", "left": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "y", - "decorators": [], - "loc": { - "start": { - "line": 51, - "column": 29, - "program": "MathCordic.ets" - }, - "end": { - "line": 51, - "column": 30, - "program": "MathCordic.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "y", + "decorators": [], + "loc": { + "start": { + "line": 51, + "column": 29, + "program": "MathCordic.ets" + }, + "end": { + "line": 51, + "column": 30, + "program": "MathCordic.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toInt", + "decorators": [], + "loc": { + "start": { + "line": 51, + "column": 31, + "program": "MathCordic.ets" + }, + "end": { + "line": 51, + "column": 36, + "program": "MathCordic.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 51, - "column": 34, + "column": 29, "program": "MathCordic.ets" }, "end": { "line": 51, - "column": 37, + "column": 36, "program": "MathCordic.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 51, @@ -3821,7 +3884,7 @@ }, "end": { "line": 51, - "column": 30, + "column": 38, "program": "MathCordic.ets" } } @@ -3833,12 +3896,12 @@ "loc": { "start": { "line": 51, - "column": 41, + "column": 42, "program": "MathCordic.ets" }, "end": { "line": 51, - "column": 45, + "column": 46, "program": "MathCordic.ets" } } @@ -3851,7 +3914,7 @@ }, "end": { "line": 51, - "column": 46, + "column": 47, "program": "MathCordic.ets" } } @@ -3864,7 +3927,7 @@ }, "end": { "line": 51, - "column": 46, + "column": 47, "program": "MathCordic.ets" } } @@ -3877,7 +3940,7 @@ }, "end": { "line": 51, - "column": 46, + "column": 47, "program": "MathCordic.ets" } } @@ -3890,7 +3953,7 @@ }, "end": { "line": 51, - "column": 47, + "column": 48, "program": "MathCordic.ets" } } @@ -3928,39 +3991,60 @@ "type": "BinaryExpression", "operator": ">>", "left": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "x", - "decorators": [], - "loc": { - "start": { - "line": 52, - "column": 23, - "program": "MathCordic.ets" - }, - "end": { - "line": 52, - "column": 24, - "program": "MathCordic.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "x", + "decorators": [], + "loc": { + "start": { + "line": 52, + "column": 23, + "program": "MathCordic.ets" + }, + "end": { + "line": 52, + "column": 24, + "program": "MathCordic.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toInt", + "decorators": [], + "loc": { + "start": { + "line": 52, + "column": 25, + "program": "MathCordic.ets" + }, + "end": { + "line": 52, + "column": 30, + "program": "MathCordic.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 52, - "column": 28, + "column": 23, "program": "MathCordic.ets" }, "end": { "line": 52, - "column": 31, + "column": 30, "program": "MathCordic.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 52, @@ -3969,7 +4053,7 @@ }, "end": { "line": 52, - "column": 24, + "column": 32, "program": "MathCordic.ets" } } @@ -3981,12 +4065,12 @@ "loc": { "start": { "line": 52, - "column": 35, + "column": 36, "program": "MathCordic.ets" }, "end": { "line": 52, - "column": 39, + "column": 40, "program": "MathCordic.ets" } } @@ -3999,7 +4083,7 @@ }, "end": { "line": 52, - "column": 40, + "column": 41, "program": "MathCordic.ets" } } @@ -4012,7 +4096,7 @@ }, "end": { "line": 52, - "column": 40, + "column": 41, "program": "MathCordic.ets" } } @@ -4024,12 +4108,12 @@ "loc": { "start": { "line": 52, - "column": 43, + "column": 44, "program": "MathCordic.ets" }, "end": { "line": 52, - "column": 44, + "column": 45, "program": "MathCordic.ets" } } @@ -4042,7 +4126,7 @@ }, "end": { "line": 52, - "column": 44, + "column": 45, "program": "MathCordic.ets" } } @@ -4055,7 +4139,7 @@ }, "end": { "line": 52, - "column": 44, + "column": 45, "program": "MathCordic.ets" } } @@ -4068,7 +4152,7 @@ }, "end": { "line": 52, - "column": 45, + "column": 46, "program": "MathCordic.ets" } } diff --git a/ets2panda/test/parser/ets/MathCordic.ets b/ets2panda/test/parser/ets/MathCordic.ets index d220821ffce2cbbb79b12156e01d4c60ad6ff48b..bc078eaca7edcd4820222f8b0e7157509371a0ed 100644 --- a/ets2panda/test/parser/ets/MathCordic.ets +++ b/ets2panda/test/parser/ets/MathCordic.ets @@ -42,14 +42,14 @@ export class MathCordic { for (step = 0; step < 12; step++) { let newX : double ; if (targetAngle > currAngle) { - newX = x - (y as int >> step); - y = (x as int >> step) + y; + newX = x - (y.toInt() >> step); + y = (x.toInt() >> step) + y; x = newX; currAngle += MathCordic.ANGLES[step]; } else { - newX = x + (y as int >> step); - y = -(x as int >> step) + y; + newX = x + (y.toInt() >> step); + y = -(x.toInt() >> step) + y; x = newX; currAngle -= MathCordic.ANGLES[step]; } diff --git a/ets2panda/test/parser/ets/StringBase64-expected.txt b/ets2panda/test/parser/ets/StringBase64-expected.txt index 62d180759b1b224050cac0ace120ec3f5dec44eb..2c100f3ec5ea219789e95966a939c973106db905 100644 --- a/ets2panda/test/parser/ets/StringBase64-expected.txt +++ b/ets2panda/test/parser/ets/StringBase64-expected.txt @@ -2759,13 +2759,47 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { + "type": "CallExpression", + "callee": { "type": "MemberExpression", "object": { - "type": "Identifier", - "name": "data", - "decorators": [], + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "data", + "decorators": [], + "loc": { + "start": { + "line": 22, + "column": 28, + "program": "StringBase64.ets" + }, + "end": { + "line": 22, + "column": 32, + "program": "StringBase64.ets" + } + } + }, + "property": { + "type": "Identifier", + "name": "length", + "decorators": [], + "loc": { + "start": { + "line": 22, + "column": 33, + "program": "StringBase64.ets" + }, + "end": { + "line": 22, + "column": 39, + "program": "StringBase64.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 22, @@ -2774,24 +2808,24 @@ }, "end": { "line": 22, - "column": 32, + "column": 39, "program": "StringBase64.ets" } } }, "property": { "type": "Identifier", - "name": "length", + "name": "toInt", "decorators": [], "loc": { "start": { "line": 22, - "column": 33, + "column": 40, "program": "StringBase64.ets" }, "end": { "line": 22, - "column": 39, + "column": 45, "program": "StringBase64.ets" } } @@ -2806,26 +2840,13 @@ }, "end": { "line": 22, - "column": 39, - "program": "StringBase64.ets" - } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 22, - "column": 43, - "program": "StringBase64.ets" - }, - "end": { - "line": 22, - "column": 46, + "column": 45, "program": "StringBase64.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 22, @@ -2834,7 +2855,7 @@ }, "end": { "line": 22, - "column": 39, + "column": 47, "program": "StringBase64.ets" } } @@ -2847,7 +2868,7 @@ }, "end": { "line": 22, - "column": 39, + "column": 47, "program": "StringBase64.ets" } } @@ -2862,7 +2883,7 @@ }, "end": { "line": 22, - "column": 47, + "column": 48, "program": "StringBase64.ets" } } @@ -8516,43 +8537,74 @@ }, "arguments": [ { - "type": "TSAsExpression", - "expression": { - "type": "BinaryExpression", - "operator": "&", - "left": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { "type": "BinaryExpression", - "operator": ">>", + "operator": "&", "left": { - "type": "Identifier", - "name": "leftdata", - "decorators": [], + "type": "BinaryExpression", + "operator": ">>", + "left": { + "type": "Identifier", + "name": "leftdata", + "decorators": [], + "loc": { + "start": { + "line": 61, + "column": 37, + "program": "StringBase64.ets" + }, + "end": { + "line": 61, + "column": 45, + "program": "StringBase64.ets" + } + } + }, + "right": { + "type": "Identifier", + "name": "leftbits", + "decorators": [], + "loc": { + "start": { + "line": 61, + "column": 49, + "program": "StringBase64.ets" + }, + "end": { + "line": 61, + "column": 57, + "program": "StringBase64.ets" + } + } + }, "loc": { "start": { "line": 61, - "column": 37, + "column": 36, "program": "StringBase64.ets" }, "end": { "line": 61, - "column": 45, + "column": 58, "program": "StringBase64.ets" } } }, "right": { - "type": "Identifier", - "name": "leftbits", - "decorators": [], + "type": "NumberLiteral", + "value": 255, "loc": { "start": { "line": 61, - "column": 49, + "column": 61, "program": "StringBase64.ets" }, "end": { "line": 61, - "column": 57, + "column": 65, "program": "StringBase64.ets" } } @@ -8560,32 +8612,35 @@ "loc": { "start": { "line": 61, - "column": 36, + "column": 35, "program": "StringBase64.ets" }, "end": { "line": 61, - "column": 58, + "column": 66, "program": "StringBase64.ets" } } }, - "right": { - "type": "NumberLiteral", - "value": 255, + "property": { + "type": "Identifier", + "name": "toChar", + "decorators": [], "loc": { "start": { "line": 61, - "column": 61, + "column": 67, "program": "StringBase64.ets" }, "end": { "line": 61, - "column": 65, + "column": 73, "program": "StringBase64.ets" } } }, + "computed": false, + "optional": false, "loc": { "start": { "line": 61, @@ -8594,26 +8649,13 @@ }, "end": { "line": 61, - "column": 66, - "program": "StringBase64.ets" - } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 61, - "column": 70, - "program": "StringBase64.ets" - }, - "end": { - "line": 61, - "column": 74, + "column": 73, "program": "StringBase64.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 61, @@ -8622,7 +8664,7 @@ }, "end": { "line": 61, - "column": 66, + "column": 75, "program": "StringBase64.ets" } } @@ -8637,7 +8679,7 @@ }, "end": { "line": 61, - "column": 75, + "column": 76, "program": "StringBase64.ets" } } @@ -8650,7 +8692,7 @@ }, "end": { "line": 61, - "column": 76, + "column": 77, "program": "StringBase64.ets" } } @@ -9633,35 +9675,52 @@ } }, "right": { - "type": "TSAsExpression", - "expression": { - "type": "BinaryExpression", - "operator": "+", - "left": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { "type": "BinaryExpression", - "operator": "*", + "operator": "+", "left": { - "type": "NumberLiteral", - "value": 25, - "loc": { - "start": { - "line": 75, - "column": 22, - "program": "StringBase64.ets" - }, - "end": { - "line": 75, - "column": 24, - "program": "StringBase64.ets" + "type": "BinaryExpression", + "operator": "*", + "left": { + "type": "NumberLiteral", + "value": 25, + "loc": { + "start": { + "line": 75, + "column": 22, + "program": "StringBase64.ets" + }, + "end": { + "line": 75, + "column": 24, + "program": "StringBase64.ets" + } } - } - }, - "right": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "random", - "decorators": [], + }, + "right": { + "type": "CallExpression", + "callee": { + "type": "Identifier", + "name": "random", + "decorators": [], + "loc": { + "start": { + "line": 75, + "column": 27, + "program": "StringBase64.ets" + }, + "end": { + "line": 75, + "column": 33, + "program": "StringBase64.ets" + } + } + }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 75, @@ -9670,22 +9729,36 @@ }, "end": { "line": 75, - "column": 33, + "column": 35, "program": "StringBase64.ets" } } }, - "arguments": [], - "optional": false, "loc": { "start": { "line": 75, - "column": 27, + "column": 21, "program": "StringBase64.ets" }, "end": { "line": 75, - "column": 35, + "column": 36, + "program": "StringBase64.ets" + } + } + }, + "right": { + "type": "NumberLiteral", + "value": 97, + "loc": { + "start": { + "line": 75, + "column": 39, + "program": "StringBase64.ets" + }, + "end": { + "line": 75, + "column": 41, "program": "StringBase64.ets" } } @@ -9693,32 +9766,35 @@ "loc": { "start": { "line": 75, - "column": 21, + "column": 20, "program": "StringBase64.ets" }, "end": { "line": 75, - "column": 36, + "column": 42, "program": "StringBase64.ets" } } }, - "right": { - "type": "NumberLiteral", - "value": 97, + "property": { + "type": "Identifier", + "name": "toChar", + "decorators": [], "loc": { "start": { "line": 75, - "column": 39, + "column": 43, "program": "StringBase64.ets" }, "end": { "line": 75, - "column": 41, + "column": 49, "program": "StringBase64.ets" } } }, + "computed": false, + "optional": false, "loc": { "start": { "line": 75, @@ -9727,26 +9803,13 @@ }, "end": { "line": 75, - "column": 42, - "program": "StringBase64.ets" - } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 75, - "column": 46, - "program": "StringBase64.ets" - }, - "end": { - "line": 75, - "column": 50, + "column": 49, "program": "StringBase64.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 75, @@ -9755,7 +9818,7 @@ }, "end": { "line": 75, - "column": 42, + "column": 51, "program": "StringBase64.ets" } } @@ -9768,7 +9831,7 @@ }, "end": { "line": 75, - "column": 42, + "column": 51, "program": "StringBase64.ets" } } @@ -9781,7 +9844,7 @@ }, "end": { "line": 75, - "column": 51, + "column": 52, "program": "StringBase64.ets" } } diff --git a/ets2panda/test/parser/ets/StringBase64.ets b/ets2panda/test/parser/ets/StringBase64.ets index 7503ead1b9ee36ce93ad4d19e0e5fc3f71f0c223..ef1feaad3dd93e98d5df26041320a32c0a45f36c 100644 --- a/ets2panda/test/parser/ets/StringBase64.ets +++ b/ets2panda/test/parser/ets/StringBase64.ets @@ -19,7 +19,7 @@ export class StringBase64 { static readonly TO_BINARY_TABLE : int[] = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, 0, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1]; toBase64(data : String): String { let result : StringBuilder = new StringBuilder(); - let length : int = data.length as int; + let length : int = data.length.toInt(); let i : int ; for (i = 0; i < (length - 2); i += 3) { result.append(StringBase64.TO_BASE64_TABLE.charAt(data.charAt(i) >> 2)); @@ -58,7 +58,7 @@ export class StringBase64 { if (leftbits >= 8) { leftbits -= 8; if (!padding) { - result.append(((leftdata >> leftbits) & 0xff) as char); + result.append(((leftdata >> leftbits) & 0xff).toChar()); } leftdata &= (1 << leftbits) - 1; } @@ -72,7 +72,7 @@ export class StringBase64 { public run(): void { let str : String = ""; for (let i : int = 0; i < this.n1; i++) { - str += ((25 * random()) + 97) as char; + str += ((25 * random()) + 97).toChar(); } for (let i : int = this.n1; i <= this.n2; i *= 2) { let base64 : String = this.toBase64(str); diff --git a/ets2panda/test/parser/ets/cast_expressions-expected.txt b/ets2panda/test/parser/ets/cast_expressions-expected.txt index 6d76a9e8a4ff35ac8f8733737ca3da3d0781804e..eee5871349102a44856fa47675c02f2297180862 100644 --- a/ets2panda/test/parser/ets/cast_expressions-expected.txt +++ b/ets2panda/test/parser/ets/cast_expressions-expected.txt @@ -587,39 +587,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "byte_", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 23, - "program": "cast_expressions.ets" - }, - "end": { - "line": 22, - "column": 28, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "byte_", + "decorators": [], + "loc": { + "start": { + "line": 22, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 22, + "column": 28, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toByte", + "decorators": [], + "loc": { + "start": { + "line": 22, + "column": 29, + "program": "cast_expressions.ets" + }, + "end": { + "line": 22, + "column": 35, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 22, - "column": 32, + "column": 23, "program": "cast_expressions.ets" }, "end": { "line": 22, - "column": 36, + "column": 35, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 22, @@ -628,7 +649,7 @@ }, "end": { "line": 22, - "column": 28, + "column": 37, "program": "cast_expressions.ets" } } @@ -641,7 +662,7 @@ }, "end": { "line": 22, - "column": 28, + "column": 37, "program": "cast_expressions.ets" } } @@ -656,7 +677,7 @@ }, "end": { "line": 22, - "column": 37, + "column": 38, "program": "cast_expressions.ets" } } @@ -684,39 +705,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "byte_", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 23, - "program": "cast_expressions.ets" - }, - "end": { - "line": 23, - "column": 28, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "byte_", + "decorators": [], + "loc": { + "start": { + "line": 23, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 23, + "column": 28, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toShort", + "decorators": [], + "loc": { + "start": { + "line": 23, + "column": 29, + "program": "cast_expressions.ets" + }, + "end": { + "line": 23, + "column": 36, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 23, - "column": 32, + "column": 23, "program": "cast_expressions.ets" }, "end": { "line": 23, - "column": 37, + "column": 36, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 23, @@ -725,7 +767,7 @@ }, "end": { "line": 23, - "column": 28, + "column": 38, "program": "cast_expressions.ets" } } @@ -738,7 +780,7 @@ }, "end": { "line": 23, - "column": 28, + "column": 38, "program": "cast_expressions.ets" } } @@ -753,7 +795,7 @@ }, "end": { "line": 23, - "column": 38, + "column": 39, "program": "cast_expressions.ets" } } @@ -781,39 +823,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "byte_", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 23, - "program": "cast_expressions.ets" - }, - "end": { - "line": 24, - "column": 28, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "byte_", + "decorators": [], + "loc": { + "start": { + "line": 24, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 24, + "column": 28, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toChar", + "decorators": [], + "loc": { + "start": { + "line": 24, + "column": 29, + "program": "cast_expressions.ets" + }, + "end": { + "line": 24, + "column": 35, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 24, - "column": 32, + "column": 23, "program": "cast_expressions.ets" }, "end": { "line": 24, - "column": 36, + "column": 35, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 24, @@ -822,7 +885,7 @@ }, "end": { "line": 24, - "column": 28, + "column": 37, "program": "cast_expressions.ets" } } @@ -835,7 +898,7 @@ }, "end": { "line": 24, - "column": 28, + "column": 37, "program": "cast_expressions.ets" } } @@ -850,7 +913,7 @@ }, "end": { "line": 24, - "column": 37, + "column": 38, "program": "cast_expressions.ets" } } @@ -878,39 +941,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "byte_", - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 23, - "program": "cast_expressions.ets" - }, - "end": { - "line": 25, - "column": 28, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "byte_", + "decorators": [], + "loc": { + "start": { + "line": 25, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 25, + "column": 28, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toInt", + "decorators": [], + "loc": { + "start": { + "line": 25, + "column": 29, + "program": "cast_expressions.ets" + }, + "end": { + "line": 25, + "column": 34, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 25, - "column": 32, + "column": 23, "program": "cast_expressions.ets" }, "end": { "line": 25, - "column": 35, + "column": 34, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 25, @@ -919,7 +1003,7 @@ }, "end": { "line": 25, - "column": 28, + "column": 36, "program": "cast_expressions.ets" } } @@ -932,7 +1016,7 @@ }, "end": { "line": 25, - "column": 28, + "column": 36, "program": "cast_expressions.ets" } } @@ -947,7 +1031,7 @@ }, "end": { "line": 25, - "column": 36, + "column": 37, "program": "cast_expressions.ets" } } @@ -975,39 +1059,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "byte_", - "decorators": [], - "loc": { - "start": { - "line": 26, - "column": 23, - "program": "cast_expressions.ets" - }, - "end": { - "line": 26, - "column": 28, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "byte_", + "decorators": [], + "loc": { + "start": { + "line": 26, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 26, + "column": 28, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toLong", + "decorators": [], + "loc": { + "start": { + "line": 26, + "column": 29, + "program": "cast_expressions.ets" + }, + "end": { + "line": 26, + "column": 35, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 26, - "column": 32, + "column": 23, "program": "cast_expressions.ets" }, "end": { "line": 26, - "column": 36, + "column": 35, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 26, @@ -1016,7 +1121,7 @@ }, "end": { "line": 26, - "column": 28, + "column": 37, "program": "cast_expressions.ets" } } @@ -1029,7 +1134,7 @@ }, "end": { "line": 26, - "column": 28, + "column": 37, "program": "cast_expressions.ets" } } @@ -1044,7 +1149,7 @@ }, "end": { "line": 26, - "column": 37, + "column": 38, "program": "cast_expressions.ets" } } @@ -1072,11 +1177,45 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "byte_", - "decorators": [], + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "byte_", + "decorators": [], + "loc": { + "start": { + "line": 27, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 27, + "column": 28, + "program": "cast_expressions.ets" + } + } + }, + "property": { + "type": "Identifier", + "name": "toFloat", + "decorators": [], + "loc": { + "start": { + "line": 27, + "column": 29, + "program": "cast_expressions.ets" + }, + "end": { + "line": 27, + "column": 36, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 27, @@ -1085,26 +1224,13 @@ }, "end": { "line": 27, - "column": 28, - "program": "cast_expressions.ets" - } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 27, - "column": 32, - "program": "cast_expressions.ets" - }, - "end": { - "line": 27, - "column": 37, + "column": 36, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 27, @@ -1113,7 +1239,7 @@ }, "end": { "line": 27, - "column": 28, + "column": 38, "program": "cast_expressions.ets" } } @@ -1126,7 +1252,7 @@ }, "end": { "line": 27, - "column": 28, + "column": 38, "program": "cast_expressions.ets" } } @@ -1141,7 +1267,7 @@ }, "end": { "line": 27, - "column": 38, + "column": 39, "program": "cast_expressions.ets" } } @@ -1169,39 +1295,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "byte_", - "decorators": [], - "loc": { - "start": { - "line": 28, - "column": 23, - "program": "cast_expressions.ets" - }, - "end": { - "line": 28, - "column": 28, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "byte_", + "decorators": [], + "loc": { + "start": { + "line": 28, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 28, + "column": 28, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toDouble", + "decorators": [], + "loc": { + "start": { + "line": 28, + "column": 29, + "program": "cast_expressions.ets" + }, + "end": { + "line": 28, + "column": 37, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 28, - "column": 32, + "column": 23, "program": "cast_expressions.ets" }, "end": { "line": 28, - "column": 38, + "column": 37, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 28, @@ -1210,7 +1357,7 @@ }, "end": { "line": 28, - "column": 28, + "column": 39, "program": "cast_expressions.ets" } } @@ -1223,7 +1370,7 @@ }, "end": { "line": 28, - "column": 28, + "column": 39, "program": "cast_expressions.ets" } } @@ -1238,7 +1385,7 @@ }, "end": { "line": 28, - "column": 39, + "column": 40, "program": "cast_expressions.ets" } } @@ -1266,39 +1413,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "Byte_", - "decorators": [], - "loc": { - "start": { - "line": 30, - "column": 23, - "program": "cast_expressions.ets" - }, - "end": { - "line": 30, - "column": 28, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "Byte_", + "decorators": [], + "loc": { + "start": { + "line": 30, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 30, + "column": 28, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toByte", + "decorators": [], + "loc": { + "start": { + "line": 30, + "column": 29, + "program": "cast_expressions.ets" + }, + "end": { + "line": 30, + "column": 35, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 30, - "column": 32, + "column": 23, "program": "cast_expressions.ets" }, "end": { "line": 30, - "column": 36, + "column": 35, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 30, @@ -1307,7 +1475,7 @@ }, "end": { "line": 30, - "column": 28, + "column": 37, "program": "cast_expressions.ets" } } @@ -1320,7 +1488,7 @@ }, "end": { "line": 30, - "column": 28, + "column": 37, "program": "cast_expressions.ets" } } @@ -1335,7 +1503,7 @@ }, "end": { "line": 30, - "column": 37, + "column": 38, "program": "cast_expressions.ets" } } @@ -1363,39 +1531,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "Byte_", - "decorators": [], - "loc": { - "start": { - "line": 31, - "column": 23, - "program": "cast_expressions.ets" - }, - "end": { - "line": 31, - "column": 28, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "Byte_", + "decorators": [], + "loc": { + "start": { + "line": 31, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 31, + "column": 28, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toShort", + "decorators": [], + "loc": { + "start": { + "line": 31, + "column": 29, + "program": "cast_expressions.ets" + }, + "end": { + "line": 31, + "column": 36, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 31, - "column": 32, + "column": 23, "program": "cast_expressions.ets" }, "end": { "line": 31, - "column": 37, + "column": 36, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 31, @@ -1404,7 +1593,7 @@ }, "end": { "line": 31, - "column": 28, + "column": 38, "program": "cast_expressions.ets" } } @@ -1417,7 +1606,7 @@ }, "end": { "line": 31, - "column": 28, + "column": 38, "program": "cast_expressions.ets" } } @@ -1432,7 +1621,7 @@ }, "end": { "line": 31, - "column": 38, + "column": 39, "program": "cast_expressions.ets" } } @@ -1460,39 +1649,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "Byte_", - "decorators": [], - "loc": { - "start": { - "line": 32, - "column": 23, - "program": "cast_expressions.ets" - }, - "end": { - "line": 32, - "column": 28, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "Byte_", + "decorators": [], + "loc": { + "start": { + "line": 32, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 32, + "column": 28, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toInt", + "decorators": [], + "loc": { + "start": { + "line": 32, + "column": 29, + "program": "cast_expressions.ets" + }, + "end": { + "line": 32, + "column": 34, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 32, - "column": 32, + "column": 23, "program": "cast_expressions.ets" }, "end": { "line": 32, - "column": 35, + "column": 34, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 32, @@ -1501,7 +1711,7 @@ }, "end": { "line": 32, - "column": 28, + "column": 36, "program": "cast_expressions.ets" } } @@ -1514,7 +1724,7 @@ }, "end": { "line": 32, - "column": 28, + "column": 36, "program": "cast_expressions.ets" } } @@ -1529,7 +1739,7 @@ }, "end": { "line": 32, - "column": 36, + "column": 37, "program": "cast_expressions.ets" } } @@ -1557,39 +1767,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "Byte_", - "decorators": [], - "loc": { - "start": { - "line": 33, - "column": 23, - "program": "cast_expressions.ets" - }, - "end": { - "line": 33, - "column": 28, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "Byte_", + "decorators": [], + "loc": { + "start": { + "line": 33, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 33, + "column": 28, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toLong", + "decorators": [], + "loc": { + "start": { + "line": 33, + "column": 29, + "program": "cast_expressions.ets" + }, + "end": { + "line": 33, + "column": 35, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 33, - "column": 32, + "column": 23, "program": "cast_expressions.ets" }, "end": { "line": 33, - "column": 36, + "column": 35, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 33, @@ -1598,7 +1829,7 @@ }, "end": { "line": 33, - "column": 28, + "column": 37, "program": "cast_expressions.ets" } } @@ -1611,7 +1842,7 @@ }, "end": { "line": 33, - "column": 28, + "column": 37, "program": "cast_expressions.ets" } } @@ -1626,7 +1857,7 @@ }, "end": { "line": 33, - "column": 37, + "column": 38, "program": "cast_expressions.ets" } } @@ -1654,39 +1885,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "Byte_", - "decorators": [], - "loc": { - "start": { - "line": 34, - "column": 23, - "program": "cast_expressions.ets" - }, - "end": { - "line": 34, - "column": 28, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "Byte_", + "decorators": [], + "loc": { + "start": { + "line": 34, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 34, + "column": 28, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toFloat", + "decorators": [], + "loc": { + "start": { + "line": 34, + "column": 29, + "program": "cast_expressions.ets" + }, + "end": { + "line": 34, + "column": 36, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 34, - "column": 32, + "column": 23, "program": "cast_expressions.ets" }, "end": { "line": 34, - "column": 37, + "column": 36, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 34, @@ -1695,7 +1947,7 @@ }, "end": { "line": 34, - "column": 28, + "column": 38, "program": "cast_expressions.ets" } } @@ -1708,7 +1960,7 @@ }, "end": { "line": 34, - "column": 28, + "column": 38, "program": "cast_expressions.ets" } } @@ -1723,7 +1975,7 @@ }, "end": { "line": 34, - "column": 38, + "column": 39, "program": "cast_expressions.ets" } } @@ -1751,39 +2003,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "Byte_", - "decorators": [], - "loc": { - "start": { - "line": 35, - "column": 23, - "program": "cast_expressions.ets" - }, - "end": { - "line": 35, - "column": 28, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "Byte_", + "decorators": [], + "loc": { + "start": { + "line": 35, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 35, + "column": 28, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toDouble", + "decorators": [], + "loc": { + "start": { + "line": 35, + "column": 29, + "program": "cast_expressions.ets" + }, + "end": { + "line": 35, + "column": 37, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 35, - "column": 32, + "column": 23, "program": "cast_expressions.ets" }, "end": { "line": 35, - "column": 38, + "column": 37, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 35, @@ -1792,7 +2065,7 @@ }, "end": { "line": 35, - "column": 28, + "column": 39, "program": "cast_expressions.ets" } } @@ -1805,7 +2078,7 @@ }, "end": { "line": 35, - "column": 28, + "column": 39, "program": "cast_expressions.ets" } } @@ -1820,7 +2093,7 @@ }, "end": { "line": 35, - "column": 39, + "column": 40, "program": "cast_expressions.ets" } } @@ -2649,39 +2922,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "short_", - "decorators": [], - "loc": { - "start": { - "line": 52, - "column": 24, - "program": "cast_expressions.ets" - }, - "end": { - "line": 52, - "column": 30, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "short_", + "decorators": [], + "loc": { + "start": { + "line": 52, + "column": 24, + "program": "cast_expressions.ets" + }, + "end": { + "line": 52, + "column": 30, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toByte", + "decorators": [], + "loc": { + "start": { + "line": 52, + "column": 31, + "program": "cast_expressions.ets" + }, + "end": { + "line": 52, + "column": 37, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 52, - "column": 34, + "column": 24, "program": "cast_expressions.ets" }, "end": { "line": 52, - "column": 38, + "column": 37, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 52, @@ -2690,7 +2984,7 @@ }, "end": { "line": 52, - "column": 30, + "column": 39, "program": "cast_expressions.ets" } } @@ -2703,7 +2997,7 @@ }, "end": { "line": 52, - "column": 30, + "column": 39, "program": "cast_expressions.ets" } } @@ -2718,7 +3012,7 @@ }, "end": { "line": 52, - "column": 39, + "column": 40, "program": "cast_expressions.ets" } } @@ -2746,39 +3040,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "short_", - "decorators": [], - "loc": { - "start": { - "line": 53, - "column": 24, - "program": "cast_expressions.ets" - }, - "end": { - "line": 53, - "column": 30, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "short_", + "decorators": [], + "loc": { + "start": { + "line": 53, + "column": 24, + "program": "cast_expressions.ets" + }, + "end": { + "line": 53, + "column": 30, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toShort", + "decorators": [], + "loc": { + "start": { + "line": 53, + "column": 31, + "program": "cast_expressions.ets" + }, + "end": { + "line": 53, + "column": 38, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 53, - "column": 34, + "column": 24, "program": "cast_expressions.ets" }, "end": { "line": 53, - "column": 39, + "column": 38, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 53, @@ -2787,7 +3102,7 @@ }, "end": { "line": 53, - "column": 30, + "column": 40, "program": "cast_expressions.ets" } } @@ -2800,7 +3115,7 @@ }, "end": { "line": 53, - "column": 30, + "column": 40, "program": "cast_expressions.ets" } } @@ -2815,7 +3130,7 @@ }, "end": { "line": 53, - "column": 40, + "column": 41, "program": "cast_expressions.ets" } } @@ -2843,39 +3158,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "short_", - "decorators": [], - "loc": { - "start": { - "line": 54, - "column": 24, - "program": "cast_expressions.ets" - }, - "end": { - "line": 54, - "column": 30, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "short_", + "decorators": [], + "loc": { + "start": { + "line": 54, + "column": 24, + "program": "cast_expressions.ets" + }, + "end": { + "line": 54, + "column": 30, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toChar", + "decorators": [], + "loc": { + "start": { + "line": 54, + "column": 31, + "program": "cast_expressions.ets" + }, + "end": { + "line": 54, + "column": 37, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 54, - "column": 34, + "column": 24, "program": "cast_expressions.ets" }, "end": { "line": 54, - "column": 38, + "column": 37, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 54, @@ -2884,7 +3220,7 @@ }, "end": { "line": 54, - "column": 30, + "column": 39, "program": "cast_expressions.ets" } } @@ -2897,7 +3233,7 @@ }, "end": { "line": 54, - "column": 30, + "column": 39, "program": "cast_expressions.ets" } } @@ -2912,7 +3248,7 @@ }, "end": { "line": 54, - "column": 39, + "column": 40, "program": "cast_expressions.ets" } } @@ -2940,11 +3276,45 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "short_", - "decorators": [], + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "short_", + "decorators": [], + "loc": { + "start": { + "line": 55, + "column": 24, + "program": "cast_expressions.ets" + }, + "end": { + "line": 55, + "column": 30, + "program": "cast_expressions.ets" + } + } + }, + "property": { + "type": "Identifier", + "name": "toInt", + "decorators": [], + "loc": { + "start": { + "line": 55, + "column": 31, + "program": "cast_expressions.ets" + }, + "end": { + "line": 55, + "column": 36, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 55, @@ -2953,26 +3323,13 @@ }, "end": { "line": 55, - "column": 30, - "program": "cast_expressions.ets" - } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 55, - "column": 34, - "program": "cast_expressions.ets" - }, - "end": { - "line": 55, - "column": 37, + "column": 36, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 55, @@ -2981,7 +3338,7 @@ }, "end": { "line": 55, - "column": 30, + "column": 38, "program": "cast_expressions.ets" } } @@ -2994,7 +3351,7 @@ }, "end": { "line": 55, - "column": 30, + "column": 38, "program": "cast_expressions.ets" } } @@ -3009,7 +3366,7 @@ }, "end": { "line": 55, - "column": 38, + "column": 39, "program": "cast_expressions.ets" } } @@ -3037,39 +3394,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "short_", - "decorators": [], - "loc": { - "start": { - "line": 56, - "column": 24, - "program": "cast_expressions.ets" - }, - "end": { - "line": 56, - "column": 30, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "short_", + "decorators": [], + "loc": { + "start": { + "line": 56, + "column": 24, + "program": "cast_expressions.ets" + }, + "end": { + "line": 56, + "column": 30, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toLong", + "decorators": [], + "loc": { + "start": { + "line": 56, + "column": 31, + "program": "cast_expressions.ets" + }, + "end": { + "line": 56, + "column": 37, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 56, - "column": 34, + "column": 24, "program": "cast_expressions.ets" }, "end": { "line": 56, - "column": 38, + "column": 37, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 56, @@ -3078,7 +3456,7 @@ }, "end": { "line": 56, - "column": 30, + "column": 39, "program": "cast_expressions.ets" } } @@ -3091,7 +3469,7 @@ }, "end": { "line": 56, - "column": 30, + "column": 39, "program": "cast_expressions.ets" } } @@ -3106,7 +3484,7 @@ }, "end": { "line": 56, - "column": 39, + "column": 40, "program": "cast_expressions.ets" } } @@ -3134,39 +3512,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "short_", - "decorators": [], - "loc": { - "start": { - "line": 57, - "column": 24, - "program": "cast_expressions.ets" - }, - "end": { - "line": 57, - "column": 30, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "short_", + "decorators": [], + "loc": { + "start": { + "line": 57, + "column": 24, + "program": "cast_expressions.ets" + }, + "end": { + "line": 57, + "column": 30, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toFloat", + "decorators": [], + "loc": { + "start": { + "line": 57, + "column": 31, + "program": "cast_expressions.ets" + }, + "end": { + "line": 57, + "column": 38, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 57, - "column": 34, + "column": 24, "program": "cast_expressions.ets" }, "end": { "line": 57, - "column": 39, + "column": 38, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 57, @@ -3175,7 +3574,7 @@ }, "end": { "line": 57, - "column": 30, + "column": 40, "program": "cast_expressions.ets" } } @@ -3188,7 +3587,7 @@ }, "end": { "line": 57, - "column": 30, + "column": 40, "program": "cast_expressions.ets" } } @@ -3203,7 +3602,7 @@ }, "end": { "line": 57, - "column": 40, + "column": 41, "program": "cast_expressions.ets" } } @@ -3231,39 +3630,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "short_", - "decorators": [], - "loc": { - "start": { - "line": 58, - "column": 24, - "program": "cast_expressions.ets" - }, - "end": { - "line": 58, - "column": 30, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "short_", + "decorators": [], + "loc": { + "start": { + "line": 58, + "column": 24, + "program": "cast_expressions.ets" + }, + "end": { + "line": 58, + "column": 30, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toDouble", + "decorators": [], + "loc": { + "start": { + "line": 58, + "column": 31, + "program": "cast_expressions.ets" + }, + "end": { + "line": 58, + "column": 39, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 58, - "column": 34, + "column": 24, "program": "cast_expressions.ets" }, "end": { "line": 58, - "column": 40, + "column": 39, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 58, @@ -3272,7 +3692,7 @@ }, "end": { "line": 58, - "column": 30, + "column": 41, "program": "cast_expressions.ets" } } @@ -3285,7 +3705,7 @@ }, "end": { "line": 58, - "column": 30, + "column": 41, "program": "cast_expressions.ets" } } @@ -3300,7 +3720,7 @@ }, "end": { "line": 58, - "column": 41, + "column": 42, "program": "cast_expressions.ets" } } @@ -3328,39 +3748,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "Short_", - "decorators": [], - "loc": { - "start": { - "line": 60, - "column": 24, - "program": "cast_expressions.ets" - }, - "end": { - "line": 60, - "column": 30, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "Short_", + "decorators": [], + "loc": { + "start": { + "line": 60, + "column": 24, + "program": "cast_expressions.ets" + }, + "end": { + "line": 60, + "column": 30, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toShort", + "decorators": [], + "loc": { + "start": { + "line": 60, + "column": 31, + "program": "cast_expressions.ets" + }, + "end": { + "line": 60, + "column": 38, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 60, - "column": 34, + "column": 24, "program": "cast_expressions.ets" }, "end": { "line": 60, - "column": 39, + "column": 38, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 60, @@ -3369,7 +3810,7 @@ }, "end": { "line": 60, - "column": 30, + "column": 40, "program": "cast_expressions.ets" } } @@ -3382,7 +3823,7 @@ }, "end": { "line": 60, - "column": 30, + "column": 40, "program": "cast_expressions.ets" } } @@ -3397,7 +3838,7 @@ }, "end": { "line": 60, - "column": 40, + "column": 41, "program": "cast_expressions.ets" } } @@ -3425,39 +3866,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "Short_", - "decorators": [], - "loc": { - "start": { - "line": 61, - "column": 24, - "program": "cast_expressions.ets" - }, - "end": { - "line": 61, - "column": 30, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "Short_", + "decorators": [], + "loc": { + "start": { + "line": 61, + "column": 24, + "program": "cast_expressions.ets" + }, + "end": { + "line": 61, + "column": 30, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toInt", + "decorators": [], + "loc": { + "start": { + "line": 61, + "column": 31, + "program": "cast_expressions.ets" + }, + "end": { + "line": 61, + "column": 36, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 61, - "column": 34, + "column": 24, "program": "cast_expressions.ets" }, "end": { "line": 61, - "column": 37, + "column": 36, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 61, @@ -3466,7 +3928,7 @@ }, "end": { "line": 61, - "column": 30, + "column": 38, "program": "cast_expressions.ets" } } @@ -3479,7 +3941,7 @@ }, "end": { "line": 61, - "column": 30, + "column": 38, "program": "cast_expressions.ets" } } @@ -3494,7 +3956,7 @@ }, "end": { "line": 61, - "column": 38, + "column": 39, "program": "cast_expressions.ets" } } @@ -3522,39 +3984,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "Short_", - "decorators": [], - "loc": { - "start": { - "line": 62, - "column": 24, - "program": "cast_expressions.ets" - }, - "end": { - "line": 62, - "column": 30, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "Short_", + "decorators": [], + "loc": { + "start": { + "line": 62, + "column": 24, + "program": "cast_expressions.ets" + }, + "end": { + "line": 62, + "column": 30, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toLong", + "decorators": [], + "loc": { + "start": { + "line": 62, + "column": 31, + "program": "cast_expressions.ets" + }, + "end": { + "line": 62, + "column": 37, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 62, - "column": 34, + "column": 24, "program": "cast_expressions.ets" }, "end": { "line": 62, - "column": 38, + "column": 37, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 62, @@ -3563,7 +4046,7 @@ }, "end": { "line": 62, - "column": 30, + "column": 39, "program": "cast_expressions.ets" } } @@ -3576,7 +4059,7 @@ }, "end": { "line": 62, - "column": 30, + "column": 39, "program": "cast_expressions.ets" } } @@ -3591,7 +4074,7 @@ }, "end": { "line": 62, - "column": 39, + "column": 40, "program": "cast_expressions.ets" } } @@ -3619,39 +4102,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "Short_", - "decorators": [], - "loc": { - "start": { - "line": 63, - "column": 24, - "program": "cast_expressions.ets" - }, - "end": { - "line": 63, - "column": 30, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "Short_", + "decorators": [], + "loc": { + "start": { + "line": 63, + "column": 24, + "program": "cast_expressions.ets" + }, + "end": { + "line": 63, + "column": 30, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toFloat", + "decorators": [], + "loc": { + "start": { + "line": 63, + "column": 31, + "program": "cast_expressions.ets" + }, + "end": { + "line": 63, + "column": 38, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 63, - "column": 34, + "column": 24, "program": "cast_expressions.ets" }, "end": { "line": 63, - "column": 39, + "column": 38, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 63, @@ -3660,7 +4164,7 @@ }, "end": { "line": 63, - "column": 30, + "column": 40, "program": "cast_expressions.ets" } } @@ -3673,7 +4177,7 @@ }, "end": { "line": 63, - "column": 30, + "column": 40, "program": "cast_expressions.ets" } } @@ -3688,7 +4192,7 @@ }, "end": { "line": 63, - "column": 40, + "column": 41, "program": "cast_expressions.ets" } } @@ -3716,39 +4220,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "Short_", - "decorators": [], - "loc": { - "start": { - "line": 64, - "column": 24, - "program": "cast_expressions.ets" - }, - "end": { - "line": 64, - "column": 30, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "Short_", + "decorators": [], + "loc": { + "start": { + "line": 64, + "column": 24, + "program": "cast_expressions.ets" + }, + "end": { + "line": 64, + "column": 30, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toDouble", + "decorators": [], + "loc": { + "start": { + "line": 64, + "column": 31, + "program": "cast_expressions.ets" + }, + "end": { + "line": 64, + "column": 39, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 64, - "column": 34, + "column": 24, "program": "cast_expressions.ets" }, "end": { "line": 64, - "column": 40, + "column": 39, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 64, @@ -3757,7 +4282,7 @@ }, "end": { "line": 64, - "column": 30, + "column": 41, "program": "cast_expressions.ets" } } @@ -3770,7 +4295,7 @@ }, "end": { "line": 64, - "column": 30, + "column": 41, "program": "cast_expressions.ets" } } @@ -3785,7 +4310,7 @@ }, "end": { "line": 64, - "column": 41, + "column": 42, "program": "cast_expressions.ets" } } @@ -4614,39 +5139,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "char_", - "decorators": [], - "loc": { - "start": { - "line": 81, - "column": 23, - "program": "cast_expressions.ets" - }, - "end": { - "line": 81, - "column": 28, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "char_", + "decorators": [], + "loc": { + "start": { + "line": 81, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 81, + "column": 28, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toByte", + "decorators": [], + "loc": { + "start": { + "line": 81, + "column": 29, + "program": "cast_expressions.ets" + }, + "end": { + "line": 81, + "column": 35, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 81, - "column": 32, + "column": 23, "program": "cast_expressions.ets" }, "end": { "line": 81, - "column": 36, + "column": 35, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 81, @@ -4655,7 +5201,7 @@ }, "end": { "line": 81, - "column": 28, + "column": 37, "program": "cast_expressions.ets" } } @@ -4668,7 +5214,7 @@ }, "end": { "line": 81, - "column": 28, + "column": 37, "program": "cast_expressions.ets" } } @@ -4683,7 +5229,7 @@ }, "end": { "line": 81, - "column": 37, + "column": 38, "program": "cast_expressions.ets" } } @@ -4711,39 +5257,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "char_", - "decorators": [], - "loc": { - "start": { - "line": 82, - "column": 23, - "program": "cast_expressions.ets" - }, - "end": { - "line": 82, - "column": 28, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "char_", + "decorators": [], + "loc": { + "start": { + "line": 82, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 82, + "column": 28, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toShort", + "decorators": [], + "loc": { + "start": { + "line": 82, + "column": 29, + "program": "cast_expressions.ets" + }, + "end": { + "line": 82, + "column": 36, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 82, - "column": 32, + "column": 23, "program": "cast_expressions.ets" }, "end": { "line": 82, - "column": 37, + "column": 36, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 82, @@ -4752,7 +5319,7 @@ }, "end": { "line": 82, - "column": 28, + "column": 38, "program": "cast_expressions.ets" } } @@ -4765,7 +5332,7 @@ }, "end": { "line": 82, - "column": 28, + "column": 38, "program": "cast_expressions.ets" } } @@ -4780,7 +5347,7 @@ }, "end": { "line": 82, - "column": 38, + "column": 39, "program": "cast_expressions.ets" } } @@ -4808,39 +5375,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "char_", - "decorators": [], - "loc": { - "start": { - "line": 83, - "column": 23, - "program": "cast_expressions.ets" - }, - "end": { - "line": 83, - "column": 28, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "char_", + "decorators": [], + "loc": { + "start": { + "line": 83, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 83, + "column": 28, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toChar", + "decorators": [], + "loc": { + "start": { + "line": 83, + "column": 29, + "program": "cast_expressions.ets" + }, + "end": { + "line": 83, + "column": 35, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 83, - "column": 32, + "column": 23, "program": "cast_expressions.ets" }, "end": { "line": 83, - "column": 36, + "column": 35, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 83, @@ -4849,7 +5437,7 @@ }, "end": { "line": 83, - "column": 28, + "column": 37, "program": "cast_expressions.ets" } } @@ -4862,7 +5450,7 @@ }, "end": { "line": 83, - "column": 28, + "column": 37, "program": "cast_expressions.ets" } } @@ -4877,7 +5465,7 @@ }, "end": { "line": 83, - "column": 37, + "column": 38, "program": "cast_expressions.ets" } } @@ -4905,39 +5493,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "char_", - "decorators": [], - "loc": { - "start": { - "line": 84, - "column": 23, - "program": "cast_expressions.ets" - }, - "end": { - "line": 84, - "column": 28, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "char_", + "decorators": [], + "loc": { + "start": { + "line": 84, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 84, + "column": 28, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toInt", + "decorators": [], + "loc": { + "start": { + "line": 84, + "column": 29, + "program": "cast_expressions.ets" + }, + "end": { + "line": 84, + "column": 34, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 84, - "column": 32, + "column": 23, "program": "cast_expressions.ets" }, "end": { "line": 84, - "column": 35, + "column": 34, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 84, @@ -4946,7 +5555,7 @@ }, "end": { "line": 84, - "column": 28, + "column": 36, "program": "cast_expressions.ets" } } @@ -4959,7 +5568,7 @@ }, "end": { "line": 84, - "column": 28, + "column": 36, "program": "cast_expressions.ets" } } @@ -4974,7 +5583,7 @@ }, "end": { "line": 84, - "column": 36, + "column": 37, "program": "cast_expressions.ets" } } @@ -5002,39 +5611,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "char_", - "decorators": [], - "loc": { - "start": { - "line": 85, - "column": 23, - "program": "cast_expressions.ets" - }, - "end": { - "line": 85, - "column": 28, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "char_", + "decorators": [], + "loc": { + "start": { + "line": 85, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 85, + "column": 28, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toLong", + "decorators": [], + "loc": { + "start": { + "line": 85, + "column": 29, + "program": "cast_expressions.ets" + }, + "end": { + "line": 85, + "column": 35, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 85, - "column": 32, + "column": 23, "program": "cast_expressions.ets" }, "end": { "line": 85, - "column": 36, + "column": 35, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 85, @@ -5043,7 +5673,7 @@ }, "end": { "line": 85, - "column": 28, + "column": 37, "program": "cast_expressions.ets" } } @@ -5056,7 +5686,7 @@ }, "end": { "line": 85, - "column": 28, + "column": 37, "program": "cast_expressions.ets" } } @@ -5071,7 +5701,7 @@ }, "end": { "line": 85, - "column": 37, + "column": 38, "program": "cast_expressions.ets" } } @@ -5099,39 +5729,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "char_", - "decorators": [], - "loc": { - "start": { - "line": 86, - "column": 23, - "program": "cast_expressions.ets" - }, - "end": { - "line": 86, - "column": 28, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "char_", + "decorators": [], + "loc": { + "start": { + "line": 86, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 86, + "column": 28, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toFloat", + "decorators": [], + "loc": { + "start": { + "line": 86, + "column": 29, + "program": "cast_expressions.ets" + }, + "end": { + "line": 86, + "column": 36, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 86, - "column": 32, + "column": 23, "program": "cast_expressions.ets" }, "end": { "line": 86, - "column": 37, + "column": 36, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 86, @@ -5140,7 +5791,7 @@ }, "end": { "line": 86, - "column": 28, + "column": 38, "program": "cast_expressions.ets" } } @@ -5153,7 +5804,7 @@ }, "end": { "line": 86, - "column": 28, + "column": 38, "program": "cast_expressions.ets" } } @@ -5168,7 +5819,7 @@ }, "end": { "line": 86, - "column": 38, + "column": 39, "program": "cast_expressions.ets" } } @@ -5196,39 +5847,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "char_", - "decorators": [], - "loc": { - "start": { - "line": 87, - "column": 23, - "program": "cast_expressions.ets" - }, - "end": { - "line": 87, - "column": 28, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "char_", + "decorators": [], + "loc": { + "start": { + "line": 87, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 87, + "column": 28, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toDouble", + "decorators": [], + "loc": { + "start": { + "line": 87, + "column": 29, + "program": "cast_expressions.ets" + }, + "end": { + "line": 87, + "column": 37, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 87, - "column": 32, + "column": 23, "program": "cast_expressions.ets" }, "end": { "line": 87, - "column": 38, + "column": 37, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 87, @@ -5237,7 +5909,7 @@ }, "end": { "line": 87, - "column": 28, + "column": 39, "program": "cast_expressions.ets" } } @@ -5250,7 +5922,7 @@ }, "end": { "line": 87, - "column": 28, + "column": 39, "program": "cast_expressions.ets" } } @@ -5265,7 +5937,7 @@ }, "end": { "line": 87, - "column": 39, + "column": 40, "program": "cast_expressions.ets" } } @@ -5293,39 +5965,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "Char_", - "decorators": [], - "loc": { - "start": { - "line": 89, - "column": 23, - "program": "cast_expressions.ets" - }, - "end": { - "line": 89, - "column": 28, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "Char_", + "decorators": [], + "loc": { + "start": { + "line": 89, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 89, + "column": 28, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toChar", + "decorators": [], + "loc": { + "start": { + "line": 89, + "column": 29, + "program": "cast_expressions.ets" + }, + "end": { + "line": 89, + "column": 35, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 89, - "column": 32, + "column": 23, "program": "cast_expressions.ets" }, "end": { "line": 89, - "column": 36, + "column": 35, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 89, @@ -5334,7 +6027,7 @@ }, "end": { "line": 89, - "column": 28, + "column": 37, "program": "cast_expressions.ets" } } @@ -5347,7 +6040,7 @@ }, "end": { "line": 89, - "column": 28, + "column": 37, "program": "cast_expressions.ets" } } @@ -5362,7 +6055,7 @@ }, "end": { "line": 89, - "column": 37, + "column": 38, "program": "cast_expressions.ets" } } @@ -5390,11 +6083,45 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "Char_", - "decorators": [], + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "Char_", + "decorators": [], + "loc": { + "start": { + "line": 90, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 90, + "column": 28, + "program": "cast_expressions.ets" + } + } + }, + "property": { + "type": "Identifier", + "name": "toInt", + "decorators": [], + "loc": { + "start": { + "line": 90, + "column": 29, + "program": "cast_expressions.ets" + }, + "end": { + "line": 90, + "column": 34, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 90, @@ -5403,26 +6130,13 @@ }, "end": { "line": 90, - "column": 28, - "program": "cast_expressions.ets" - } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 90, - "column": 32, - "program": "cast_expressions.ets" - }, - "end": { - "line": 90, - "column": 35, + "column": 34, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 90, @@ -5431,7 +6145,7 @@ }, "end": { "line": 90, - "column": 28, + "column": 36, "program": "cast_expressions.ets" } } @@ -5444,7 +6158,7 @@ }, "end": { "line": 90, - "column": 28, + "column": 36, "program": "cast_expressions.ets" } } @@ -5459,7 +6173,7 @@ }, "end": { "line": 90, - "column": 36, + "column": 37, "program": "cast_expressions.ets" } } @@ -5487,39 +6201,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "Char_", - "decorators": [], - "loc": { - "start": { - "line": 91, - "column": 23, - "program": "cast_expressions.ets" - }, - "end": { - "line": 91, - "column": 28, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "Char_", + "decorators": [], + "loc": { + "start": { + "line": 91, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 91, + "column": 28, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toLong", + "decorators": [], + "loc": { + "start": { + "line": 91, + "column": 29, + "program": "cast_expressions.ets" + }, + "end": { + "line": 91, + "column": 35, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 91, - "column": 32, + "column": 23, "program": "cast_expressions.ets" }, "end": { "line": 91, - "column": 36, + "column": 35, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 91, @@ -5528,7 +6263,7 @@ }, "end": { "line": 91, - "column": 28, + "column": 37, "program": "cast_expressions.ets" } } @@ -5541,7 +6276,7 @@ }, "end": { "line": 91, - "column": 28, + "column": 37, "program": "cast_expressions.ets" } } @@ -5556,7 +6291,7 @@ }, "end": { "line": 91, - "column": 37, + "column": 38, "program": "cast_expressions.ets" } } @@ -5584,39 +6319,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "Char_", - "decorators": [], - "loc": { - "start": { - "line": 92, - "column": 23, - "program": "cast_expressions.ets" - }, - "end": { - "line": 92, - "column": 28, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "Char_", + "decorators": [], + "loc": { + "start": { + "line": 92, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 92, + "column": 28, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toFloat", + "decorators": [], + "loc": { + "start": { + "line": 92, + "column": 29, + "program": "cast_expressions.ets" + }, + "end": { + "line": 92, + "column": 36, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 92, - "column": 32, + "column": 23, "program": "cast_expressions.ets" }, "end": { "line": 92, - "column": 37, + "column": 36, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 92, @@ -5625,7 +6381,7 @@ }, "end": { "line": 92, - "column": 28, + "column": 38, "program": "cast_expressions.ets" } } @@ -5638,7 +6394,7 @@ }, "end": { "line": 92, - "column": 28, + "column": 38, "program": "cast_expressions.ets" } } @@ -5653,7 +6409,7 @@ }, "end": { "line": 92, - "column": 38, + "column": 39, "program": "cast_expressions.ets" } } @@ -5681,39 +6437,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "Char_", - "decorators": [], - "loc": { - "start": { - "line": 93, - "column": 23, - "program": "cast_expressions.ets" - }, - "end": { - "line": 93, - "column": 28, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "Char_", + "decorators": [], + "loc": { + "start": { + "line": 93, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 93, + "column": 28, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toDouble", + "decorators": [], + "loc": { + "start": { + "line": 93, + "column": 29, + "program": "cast_expressions.ets" + }, + "end": { + "line": 93, + "column": 37, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 93, - "column": 32, + "column": 23, "program": "cast_expressions.ets" }, "end": { "line": 93, - "column": 38, + "column": 37, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 93, @@ -5722,7 +6499,7 @@ }, "end": { "line": 93, - "column": 28, + "column": 39, "program": "cast_expressions.ets" } } @@ -5735,7 +6512,7 @@ }, "end": { "line": 93, - "column": 28, + "column": 39, "program": "cast_expressions.ets" } } @@ -5750,7 +6527,7 @@ }, "end": { "line": 93, - "column": 39, + "column": 40, "program": "cast_expressions.ets" } } @@ -6579,39 +7356,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "int_", - "decorators": [], - "loc": { - "start": { - "line": 110, - "column": 23, - "program": "cast_expressions.ets" - }, - "end": { - "line": 110, - "column": 27, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "int_", + "decorators": [], + "loc": { + "start": { + "line": 110, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 110, + "column": 27, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toByte", + "decorators": [], + "loc": { + "start": { + "line": 110, + "column": 28, + "program": "cast_expressions.ets" + }, + "end": { + "line": 110, + "column": 34, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 110, - "column": 31, + "column": 23, "program": "cast_expressions.ets" }, "end": { "line": 110, - "column": 35, + "column": 34, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 110, @@ -6620,7 +7418,7 @@ }, "end": { "line": 110, - "column": 27, + "column": 36, "program": "cast_expressions.ets" } } @@ -6633,7 +7431,7 @@ }, "end": { "line": 110, - "column": 27, + "column": 36, "program": "cast_expressions.ets" } } @@ -6648,7 +7446,7 @@ }, "end": { "line": 110, - "column": 36, + "column": 37, "program": "cast_expressions.ets" } } @@ -6676,39 +7474,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "int_", - "decorators": [], - "loc": { - "start": { - "line": 111, - "column": 23, - "program": "cast_expressions.ets" - }, - "end": { - "line": 111, - "column": 27, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "int_", + "decorators": [], + "loc": { + "start": { + "line": 111, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 111, + "column": 27, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toShort", + "decorators": [], + "loc": { + "start": { + "line": 111, + "column": 28, + "program": "cast_expressions.ets" + }, + "end": { + "line": 111, + "column": 35, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 111, - "column": 31, + "column": 23, "program": "cast_expressions.ets" }, "end": { "line": 111, - "column": 36, + "column": 35, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 111, @@ -6717,7 +7536,7 @@ }, "end": { "line": 111, - "column": 27, + "column": 37, "program": "cast_expressions.ets" } } @@ -6730,7 +7549,7 @@ }, "end": { "line": 111, - "column": 27, + "column": 37, "program": "cast_expressions.ets" } } @@ -6745,7 +7564,7 @@ }, "end": { "line": 111, - "column": 37, + "column": 38, "program": "cast_expressions.ets" } } @@ -6773,39 +7592,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "int_", - "decorators": [], - "loc": { - "start": { - "line": 112, - "column": 23, - "program": "cast_expressions.ets" - }, - "end": { - "line": 112, - "column": 27, - "program": "cast_expressions.ets" - } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "int_", + "decorators": [], + "loc": { + "start": { + "line": 112, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 112, + "column": 27, + "program": "cast_expressions.ets" + } + } + }, + "property": { + "type": "Identifier", + "name": "toChar", + "decorators": [], + "loc": { + "start": { + "line": 112, + "column": 28, + "program": "cast_expressions.ets" + }, + "end": { + "line": 112, + "column": 34, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 112, - "column": 31, + "column": 23, "program": "cast_expressions.ets" }, "end": { "line": 112, - "column": 35, + "column": 34, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 112, @@ -6814,7 +7654,7 @@ }, "end": { "line": 112, - "column": 27, + "column": 36, "program": "cast_expressions.ets" } } @@ -6827,7 +7667,7 @@ }, "end": { "line": 112, - "column": 27, + "column": 36, "program": "cast_expressions.ets" } } @@ -6842,7 +7682,7 @@ }, "end": { "line": 112, - "column": 36, + "column": 37, "program": "cast_expressions.ets" } } @@ -6870,39 +7710,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "int_", - "decorators": [], - "loc": { - "start": { - "line": 113, - "column": 23, - "program": "cast_expressions.ets" - }, - "end": { - "line": 113, - "column": 27, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "int_", + "decorators": [], + "loc": { + "start": { + "line": 113, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 113, + "column": 27, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toInt", + "decorators": [], + "loc": { + "start": { + "line": 113, + "column": 28, + "program": "cast_expressions.ets" + }, + "end": { + "line": 113, + "column": 33, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 113, - "column": 31, + "column": 23, "program": "cast_expressions.ets" }, "end": { "line": 113, - "column": 34, + "column": 33, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 113, @@ -6911,7 +7772,7 @@ }, "end": { "line": 113, - "column": 27, + "column": 35, "program": "cast_expressions.ets" } } @@ -6924,7 +7785,7 @@ }, "end": { "line": 113, - "column": 27, + "column": 35, "program": "cast_expressions.ets" } } @@ -6939,7 +7800,7 @@ }, "end": { "line": 113, - "column": 35, + "column": 36, "program": "cast_expressions.ets" } } @@ -6967,39 +7828,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "int_", - "decorators": [], - "loc": { - "start": { - "line": 114, - "column": 23, - "program": "cast_expressions.ets" - }, - "end": { - "line": 114, - "column": 27, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "int_", + "decorators": [], + "loc": { + "start": { + "line": 114, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 114, + "column": 27, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toLong", + "decorators": [], + "loc": { + "start": { + "line": 114, + "column": 28, + "program": "cast_expressions.ets" + }, + "end": { + "line": 114, + "column": 34, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 114, - "column": 31, + "column": 23, "program": "cast_expressions.ets" }, "end": { "line": 114, - "column": 35, + "column": 34, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 114, @@ -7008,7 +7890,7 @@ }, "end": { "line": 114, - "column": 27, + "column": 36, "program": "cast_expressions.ets" } } @@ -7021,7 +7903,7 @@ }, "end": { "line": 114, - "column": 27, + "column": 36, "program": "cast_expressions.ets" } } @@ -7036,7 +7918,7 @@ }, "end": { "line": 114, - "column": 36, + "column": 37, "program": "cast_expressions.ets" } } @@ -7064,39 +7946,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "int_", - "decorators": [], - "loc": { - "start": { - "line": 115, - "column": 23, - "program": "cast_expressions.ets" - }, - "end": { - "line": 115, - "column": 27, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "int_", + "decorators": [], + "loc": { + "start": { + "line": 115, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 115, + "column": 27, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toFloat", + "decorators": [], + "loc": { + "start": { + "line": 115, + "column": 28, + "program": "cast_expressions.ets" + }, + "end": { + "line": 115, + "column": 35, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 115, - "column": 31, + "column": 23, "program": "cast_expressions.ets" }, "end": { "line": 115, - "column": 36, + "column": 35, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 115, @@ -7105,7 +8008,7 @@ }, "end": { "line": 115, - "column": 27, + "column": 37, "program": "cast_expressions.ets" } } @@ -7118,7 +8021,7 @@ }, "end": { "line": 115, - "column": 27, + "column": 37, "program": "cast_expressions.ets" } } @@ -7133,7 +8036,7 @@ }, "end": { "line": 115, - "column": 37, + "column": 38, "program": "cast_expressions.ets" } } @@ -7161,39 +8064,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "int_", - "decorators": [], - "loc": { - "start": { - "line": 116, - "column": 23, - "program": "cast_expressions.ets" - }, - "end": { - "line": 116, - "column": 27, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "int_", + "decorators": [], + "loc": { + "start": { + "line": 116, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 116, + "column": 27, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toDouble", + "decorators": [], + "loc": { + "start": { + "line": 116, + "column": 28, + "program": "cast_expressions.ets" + }, + "end": { + "line": 116, + "column": 36, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 116, - "column": 31, + "column": 23, "program": "cast_expressions.ets" }, "end": { "line": 116, - "column": 37, + "column": 36, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 116, @@ -7202,7 +8126,7 @@ }, "end": { "line": 116, - "column": 27, + "column": 38, "program": "cast_expressions.ets" } } @@ -7215,7 +8139,7 @@ }, "end": { "line": 116, - "column": 27, + "column": 38, "program": "cast_expressions.ets" } } @@ -7230,7 +8154,7 @@ }, "end": { "line": 116, - "column": 38, + "column": 39, "program": "cast_expressions.ets" } } @@ -7258,39 +8182,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "Int_", - "decorators": [], - "loc": { - "start": { - "line": 118, - "column": 23, - "program": "cast_expressions.ets" - }, - "end": { - "line": 118, - "column": 27, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "Int_", + "decorators": [], + "loc": { + "start": { + "line": 118, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 118, + "column": 27, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toInt", + "decorators": [], + "loc": { + "start": { + "line": 118, + "column": 28, + "program": "cast_expressions.ets" + }, + "end": { + "line": 118, + "column": 33, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 118, - "column": 31, + "column": 23, "program": "cast_expressions.ets" }, "end": { "line": 118, - "column": 34, + "column": 33, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 118, @@ -7299,7 +8244,7 @@ }, "end": { "line": 118, - "column": 27, + "column": 35, "program": "cast_expressions.ets" } } @@ -7312,7 +8257,7 @@ }, "end": { "line": 118, - "column": 27, + "column": 35, "program": "cast_expressions.ets" } } @@ -7327,7 +8272,7 @@ }, "end": { "line": 118, - "column": 35, + "column": 36, "program": "cast_expressions.ets" } } @@ -7355,39 +8300,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "Int_", - "decorators": [], - "loc": { - "start": { - "line": 119, - "column": 23, - "program": "cast_expressions.ets" - }, - "end": { - "line": 119, - "column": 27, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "Int_", + "decorators": [], + "loc": { + "start": { + "line": 119, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 119, + "column": 27, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toLong", + "decorators": [], + "loc": { + "start": { + "line": 119, + "column": 28, + "program": "cast_expressions.ets" + }, + "end": { + "line": 119, + "column": 34, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 119, - "column": 31, + "column": 23, "program": "cast_expressions.ets" }, "end": { "line": 119, - "column": 35, + "column": 34, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 119, @@ -7396,7 +8362,7 @@ }, "end": { "line": 119, - "column": 27, + "column": 36, "program": "cast_expressions.ets" } } @@ -7409,7 +8375,7 @@ }, "end": { "line": 119, - "column": 27, + "column": 36, "program": "cast_expressions.ets" } } @@ -7424,7 +8390,7 @@ }, "end": { "line": 119, - "column": 36, + "column": 37, "program": "cast_expressions.ets" } } @@ -7452,39 +8418,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "Int_", - "decorators": [], - "loc": { - "start": { - "line": 120, - "column": 23, - "program": "cast_expressions.ets" - }, - "end": { - "line": 120, - "column": 27, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "Int_", + "decorators": [], + "loc": { + "start": { + "line": 120, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 120, + "column": 27, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toFloat", + "decorators": [], + "loc": { + "start": { + "line": 120, + "column": 28, + "program": "cast_expressions.ets" + }, + "end": { + "line": 120, + "column": 35, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 120, - "column": 31, + "column": 23, "program": "cast_expressions.ets" }, "end": { "line": 120, - "column": 36, + "column": 35, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 120, @@ -7493,7 +8480,7 @@ }, "end": { "line": 120, - "column": 27, + "column": 37, "program": "cast_expressions.ets" } } @@ -7506,7 +8493,7 @@ }, "end": { "line": 120, - "column": 27, + "column": 37, "program": "cast_expressions.ets" } } @@ -7521,7 +8508,7 @@ }, "end": { "line": 120, - "column": 37, + "column": 38, "program": "cast_expressions.ets" } } @@ -7549,39 +8536,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "Int_", - "decorators": [], - "loc": { - "start": { - "line": 121, - "column": 23, - "program": "cast_expressions.ets" - }, - "end": { - "line": 121, - "column": 27, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "Int_", + "decorators": [], + "loc": { + "start": { + "line": 121, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 121, + "column": 27, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toDouble", + "decorators": [], + "loc": { + "start": { + "line": 121, + "column": 28, + "program": "cast_expressions.ets" + }, + "end": { + "line": 121, + "column": 36, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 121, - "column": 31, + "column": 23, "program": "cast_expressions.ets" }, "end": { "line": 121, - "column": 37, + "column": 36, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 121, @@ -7590,7 +8598,7 @@ }, "end": { "line": 121, - "column": 27, + "column": 38, "program": "cast_expressions.ets" } } @@ -7603,7 +8611,7 @@ }, "end": { "line": 121, - "column": 27, + "column": 38, "program": "cast_expressions.ets" } } @@ -7618,7 +8626,7 @@ }, "end": { "line": 121, - "column": 38, + "column": 39, "program": "cast_expressions.ets" } } @@ -8447,39 +9455,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "long_", - "decorators": [], - "loc": { - "start": { - "line": 138, - "column": 23, - "program": "cast_expressions.ets" - }, - "end": { - "line": 138, - "column": 28, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "long_", + "decorators": [], + "loc": { + "start": { + "line": 138, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 138, + "column": 28, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toByte", + "decorators": [], + "loc": { + "start": { + "line": 138, + "column": 29, + "program": "cast_expressions.ets" + }, + "end": { + "line": 138, + "column": 35, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 138, - "column": 32, + "column": 23, "program": "cast_expressions.ets" }, "end": { "line": 138, - "column": 36, + "column": 35, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 138, @@ -8488,7 +9517,7 @@ }, "end": { "line": 138, - "column": 28, + "column": 37, "program": "cast_expressions.ets" } } @@ -8501,7 +9530,7 @@ }, "end": { "line": 138, - "column": 28, + "column": 37, "program": "cast_expressions.ets" } } @@ -8516,7 +9545,7 @@ }, "end": { "line": 138, - "column": 37, + "column": 38, "program": "cast_expressions.ets" } } @@ -8544,39 +9573,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "long_", - "decorators": [], - "loc": { - "start": { - "line": 139, - "column": 23, - "program": "cast_expressions.ets" - }, - "end": { - "line": 139, - "column": 28, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "long_", + "decorators": [], + "loc": { + "start": { + "line": 139, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 139, + "column": 28, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toShort", + "decorators": [], + "loc": { + "start": { + "line": 139, + "column": 29, + "program": "cast_expressions.ets" + }, + "end": { + "line": 139, + "column": 36, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 139, - "column": 32, + "column": 23, "program": "cast_expressions.ets" }, "end": { "line": 139, - "column": 37, + "column": 36, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 139, @@ -8585,7 +9635,7 @@ }, "end": { "line": 139, - "column": 28, + "column": 38, "program": "cast_expressions.ets" } } @@ -8598,7 +9648,7 @@ }, "end": { "line": 139, - "column": 28, + "column": 38, "program": "cast_expressions.ets" } } @@ -8613,7 +9663,7 @@ }, "end": { "line": 139, - "column": 38, + "column": 39, "program": "cast_expressions.ets" } } @@ -8641,11 +9691,45 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "long_", - "decorators": [], + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "long_", + "decorators": [], + "loc": { + "start": { + "line": 140, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 140, + "column": 28, + "program": "cast_expressions.ets" + } + } + }, + "property": { + "type": "Identifier", + "name": "toChar", + "decorators": [], + "loc": { + "start": { + "line": 140, + "column": 29, + "program": "cast_expressions.ets" + }, + "end": { + "line": 140, + "column": 35, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 140, @@ -8654,26 +9738,13 @@ }, "end": { "line": 140, - "column": 28, - "program": "cast_expressions.ets" - } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 140, - "column": 32, - "program": "cast_expressions.ets" - }, - "end": { - "line": 140, - "column": 36, + "column": 35, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 140, @@ -8682,7 +9753,7 @@ }, "end": { "line": 140, - "column": 28, + "column": 37, "program": "cast_expressions.ets" } } @@ -8695,7 +9766,7 @@ }, "end": { "line": 140, - "column": 28, + "column": 37, "program": "cast_expressions.ets" } } @@ -8710,7 +9781,7 @@ }, "end": { "line": 140, - "column": 37, + "column": 38, "program": "cast_expressions.ets" } } @@ -8738,39 +9809,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "long_", - "decorators": [], - "loc": { - "start": { - "line": 141, - "column": 23, - "program": "cast_expressions.ets" - }, - "end": { - "line": 141, - "column": 28, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "long_", + "decorators": [], + "loc": { + "start": { + "line": 141, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 141, + "column": 28, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toInt", + "decorators": [], + "loc": { + "start": { + "line": 141, + "column": 29, + "program": "cast_expressions.ets" + }, + "end": { + "line": 141, + "column": 34, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 141, - "column": 32, + "column": 23, "program": "cast_expressions.ets" }, "end": { "line": 141, - "column": 35, + "column": 34, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 141, @@ -8779,7 +9871,7 @@ }, "end": { "line": 141, - "column": 28, + "column": 36, "program": "cast_expressions.ets" } } @@ -8792,7 +9884,7 @@ }, "end": { "line": 141, - "column": 28, + "column": 36, "program": "cast_expressions.ets" } } @@ -8807,7 +9899,7 @@ }, "end": { "line": 141, - "column": 36, + "column": 37, "program": "cast_expressions.ets" } } @@ -8835,39 +9927,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "long_", - "decorators": [], - "loc": { - "start": { - "line": 142, - "column": 23, - "program": "cast_expressions.ets" - }, - "end": { - "line": 142, - "column": 28, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "long_", + "decorators": [], + "loc": { + "start": { + "line": 142, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 142, + "column": 28, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toLong", + "decorators": [], + "loc": { + "start": { + "line": 142, + "column": 29, + "program": "cast_expressions.ets" + }, + "end": { + "line": 142, + "column": 35, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 142, - "column": 32, + "column": 23, "program": "cast_expressions.ets" }, "end": { "line": 142, - "column": 36, + "column": 35, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 142, @@ -8876,7 +9989,7 @@ }, "end": { "line": 142, - "column": 28, + "column": 37, "program": "cast_expressions.ets" } } @@ -8889,7 +10002,7 @@ }, "end": { "line": 142, - "column": 28, + "column": 37, "program": "cast_expressions.ets" } } @@ -8904,7 +10017,7 @@ }, "end": { "line": 142, - "column": 37, + "column": 38, "program": "cast_expressions.ets" } } @@ -8932,39 +10045,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "long_", - "decorators": [], - "loc": { - "start": { - "line": 143, - "column": 23, - "program": "cast_expressions.ets" - }, - "end": { - "line": 143, - "column": 28, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "long_", + "decorators": [], + "loc": { + "start": { + "line": 143, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 143, + "column": 28, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toFloat", + "decorators": [], + "loc": { + "start": { + "line": 143, + "column": 29, + "program": "cast_expressions.ets" + }, + "end": { + "line": 143, + "column": 36, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 143, - "column": 32, + "column": 23, "program": "cast_expressions.ets" }, "end": { "line": 143, - "column": 37, + "column": 36, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 143, @@ -8973,7 +10107,7 @@ }, "end": { "line": 143, - "column": 28, + "column": 38, "program": "cast_expressions.ets" } } @@ -8986,7 +10120,7 @@ }, "end": { "line": 143, - "column": 28, + "column": 38, "program": "cast_expressions.ets" } } @@ -9001,7 +10135,7 @@ }, "end": { "line": 143, - "column": 38, + "column": 39, "program": "cast_expressions.ets" } } @@ -9029,39 +10163,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "long_", - "decorators": [], - "loc": { - "start": { - "line": 144, - "column": 23, - "program": "cast_expressions.ets" - }, - "end": { - "line": 144, - "column": 28, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "long_", + "decorators": [], + "loc": { + "start": { + "line": 144, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 144, + "column": 28, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toDouble", + "decorators": [], + "loc": { + "start": { + "line": 144, + "column": 29, + "program": "cast_expressions.ets" + }, + "end": { + "line": 144, + "column": 37, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 144, - "column": 32, + "column": 23, "program": "cast_expressions.ets" }, "end": { "line": 144, - "column": 38, + "column": 37, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 144, @@ -9070,7 +10225,7 @@ }, "end": { "line": 144, - "column": 28, + "column": 39, "program": "cast_expressions.ets" } } @@ -9083,7 +10238,7 @@ }, "end": { "line": 144, - "column": 28, + "column": 39, "program": "cast_expressions.ets" } } @@ -9098,7 +10253,7 @@ }, "end": { "line": 144, - "column": 39, + "column": 40, "program": "cast_expressions.ets" } } @@ -9126,39 +10281,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "Long_", - "decorators": [], - "loc": { - "start": { - "line": 146, - "column": 23, - "program": "cast_expressions.ets" - }, - "end": { - "line": 146, - "column": 28, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "Long_", + "decorators": [], + "loc": { + "start": { + "line": 146, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 146, + "column": 28, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toLong", + "decorators": [], + "loc": { + "start": { + "line": 146, + "column": 29, + "program": "cast_expressions.ets" + }, + "end": { + "line": 146, + "column": 35, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 146, - "column": 32, + "column": 23, "program": "cast_expressions.ets" }, "end": { "line": 146, - "column": 36, + "column": 35, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 146, @@ -9167,7 +10343,7 @@ }, "end": { "line": 146, - "column": 28, + "column": 37, "program": "cast_expressions.ets" } } @@ -9180,7 +10356,7 @@ }, "end": { "line": 146, - "column": 28, + "column": 37, "program": "cast_expressions.ets" } } @@ -9195,7 +10371,7 @@ }, "end": { "line": 146, - "column": 37, + "column": 38, "program": "cast_expressions.ets" } } @@ -9223,39 +10399,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "Long_", - "decorators": [], - "loc": { - "start": { - "line": 147, - "column": 23, - "program": "cast_expressions.ets" - }, - "end": { - "line": 147, - "column": 28, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "Long_", + "decorators": [], + "loc": { + "start": { + "line": 147, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 147, + "column": 28, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toFloat", + "decorators": [], + "loc": { + "start": { + "line": 147, + "column": 29, + "program": "cast_expressions.ets" + }, + "end": { + "line": 147, + "column": 36, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 147, - "column": 32, + "column": 23, "program": "cast_expressions.ets" }, "end": { "line": 147, - "column": 37, + "column": 36, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 147, @@ -9264,7 +10461,7 @@ }, "end": { "line": 147, - "column": 28, + "column": 38, "program": "cast_expressions.ets" } } @@ -9277,7 +10474,7 @@ }, "end": { "line": 147, - "column": 28, + "column": 38, "program": "cast_expressions.ets" } } @@ -9292,7 +10489,7 @@ }, "end": { "line": 147, - "column": 38, + "column": 39, "program": "cast_expressions.ets" } } @@ -9320,39 +10517,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "Long_", - "decorators": [], - "loc": { - "start": { - "line": 148, - "column": 23, - "program": "cast_expressions.ets" - }, - "end": { - "line": 148, - "column": 28, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "Long_", + "decorators": [], + "loc": { + "start": { + "line": 148, + "column": 23, + "program": "cast_expressions.ets" + }, + "end": { + "line": 148, + "column": 28, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toDouble", + "decorators": [], + "loc": { + "start": { + "line": 148, + "column": 29, + "program": "cast_expressions.ets" + }, + "end": { + "line": 148, + "column": 37, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 148, - "column": 32, + "column": 23, "program": "cast_expressions.ets" }, "end": { "line": 148, - "column": 38, + "column": 37, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 148, @@ -9361,7 +10579,7 @@ }, "end": { "line": 148, - "column": 28, + "column": 39, "program": "cast_expressions.ets" } } @@ -9374,7 +10592,7 @@ }, "end": { "line": 148, - "column": 28, + "column": 39, "program": "cast_expressions.ets" } } @@ -9389,7 +10607,7 @@ }, "end": { "line": 148, - "column": 39, + "column": 40, "program": "cast_expressions.ets" } } @@ -10218,39 +11436,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "float_", - "decorators": [], - "loc": { - "start": { - "line": 165, - "column": 24, - "program": "cast_expressions.ets" - }, - "end": { - "line": 165, - "column": 30, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "float_", + "decorators": [], + "loc": { + "start": { + "line": 165, + "column": 24, + "program": "cast_expressions.ets" + }, + "end": { + "line": 165, + "column": 30, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toByte", + "decorators": [], + "loc": { + "start": { + "line": 165, + "column": 31, + "program": "cast_expressions.ets" + }, + "end": { + "line": 165, + "column": 37, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 165, - "column": 34, + "column": 24, "program": "cast_expressions.ets" }, "end": { "line": 165, - "column": 38, + "column": 37, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 165, @@ -10259,7 +11498,7 @@ }, "end": { "line": 165, - "column": 30, + "column": 39, "program": "cast_expressions.ets" } } @@ -10272,7 +11511,7 @@ }, "end": { "line": 165, - "column": 30, + "column": 39, "program": "cast_expressions.ets" } } @@ -10287,7 +11526,7 @@ }, "end": { "line": 165, - "column": 39, + "column": 40, "program": "cast_expressions.ets" } } @@ -10315,39 +11554,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "float_", - "decorators": [], - "loc": { - "start": { - "line": 166, - "column": 24, - "program": "cast_expressions.ets" - }, - "end": { - "line": 166, - "column": 30, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "float_", + "decorators": [], + "loc": { + "start": { + "line": 166, + "column": 24, + "program": "cast_expressions.ets" + }, + "end": { + "line": 166, + "column": 30, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toShort", + "decorators": [], + "loc": { + "start": { + "line": 166, + "column": 31, + "program": "cast_expressions.ets" + }, + "end": { + "line": 166, + "column": 38, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 166, - "column": 34, + "column": 24, "program": "cast_expressions.ets" }, "end": { "line": 166, - "column": 39, + "column": 38, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 166, @@ -10356,7 +11616,7 @@ }, "end": { "line": 166, - "column": 30, + "column": 40, "program": "cast_expressions.ets" } } @@ -10369,7 +11629,7 @@ }, "end": { "line": 166, - "column": 30, + "column": 40, "program": "cast_expressions.ets" } } @@ -10384,7 +11644,7 @@ }, "end": { "line": 166, - "column": 40, + "column": 41, "program": "cast_expressions.ets" } } @@ -10412,39 +11672,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "float_", - "decorators": [], - "loc": { - "start": { - "line": 167, - "column": 24, - "program": "cast_expressions.ets" - }, - "end": { - "line": 167, - "column": 30, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "float_", + "decorators": [], + "loc": { + "start": { + "line": 167, + "column": 24, + "program": "cast_expressions.ets" + }, + "end": { + "line": 167, + "column": 30, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toChar", + "decorators": [], + "loc": { + "start": { + "line": 167, + "column": 31, + "program": "cast_expressions.ets" + }, + "end": { + "line": 167, + "column": 37, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 167, - "column": 34, + "column": 24, "program": "cast_expressions.ets" }, "end": { "line": 167, - "column": 38, + "column": 37, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 167, @@ -10453,7 +11734,7 @@ }, "end": { "line": 167, - "column": 30, + "column": 39, "program": "cast_expressions.ets" } } @@ -10466,7 +11747,7 @@ }, "end": { "line": 167, - "column": 30, + "column": 39, "program": "cast_expressions.ets" } } @@ -10481,7 +11762,7 @@ }, "end": { "line": 167, - "column": 39, + "column": 40, "program": "cast_expressions.ets" } } @@ -10509,39 +11790,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "float_", - "decorators": [], - "loc": { - "start": { - "line": 168, - "column": 24, - "program": "cast_expressions.ets" - }, - "end": { - "line": 168, - "column": 30, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "float_", + "decorators": [], + "loc": { + "start": { + "line": 168, + "column": 24, + "program": "cast_expressions.ets" + }, + "end": { + "line": 168, + "column": 30, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toInt", + "decorators": [], + "loc": { + "start": { + "line": 168, + "column": 31, + "program": "cast_expressions.ets" + }, + "end": { + "line": 168, + "column": 36, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 168, - "column": 34, + "column": 24, "program": "cast_expressions.ets" }, "end": { "line": 168, - "column": 37, + "column": 36, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 168, @@ -10550,7 +11852,7 @@ }, "end": { "line": 168, - "column": 30, + "column": 38, "program": "cast_expressions.ets" } } @@ -10563,7 +11865,7 @@ }, "end": { "line": 168, - "column": 30, + "column": 38, "program": "cast_expressions.ets" } } @@ -10578,7 +11880,7 @@ }, "end": { "line": 168, - "column": 38, + "column": 39, "program": "cast_expressions.ets" } } @@ -10606,39 +11908,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "float_", - "decorators": [], - "loc": { - "start": { - "line": 169, - "column": 24, - "program": "cast_expressions.ets" - }, - "end": { - "line": 169, - "column": 30, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "float_", + "decorators": [], + "loc": { + "start": { + "line": 169, + "column": 24, + "program": "cast_expressions.ets" + }, + "end": { + "line": 169, + "column": 30, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toLong", + "decorators": [], + "loc": { + "start": { + "line": 169, + "column": 31, + "program": "cast_expressions.ets" + }, + "end": { + "line": 169, + "column": 37, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 169, - "column": 34, + "column": 24, "program": "cast_expressions.ets" }, "end": { "line": 169, - "column": 38, + "column": 37, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 169, @@ -10647,7 +11970,7 @@ }, "end": { "line": 169, - "column": 30, + "column": 39, "program": "cast_expressions.ets" } } @@ -10660,7 +11983,7 @@ }, "end": { "line": 169, - "column": 30, + "column": 39, "program": "cast_expressions.ets" } } @@ -10675,7 +11998,7 @@ }, "end": { "line": 169, - "column": 39, + "column": 40, "program": "cast_expressions.ets" } } @@ -10703,39 +12026,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "float_", - "decorators": [], - "loc": { - "start": { - "line": 170, - "column": 24, - "program": "cast_expressions.ets" - }, - "end": { - "line": 170, - "column": 30, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "float_", + "decorators": [], + "loc": { + "start": { + "line": 170, + "column": 24, + "program": "cast_expressions.ets" + }, + "end": { + "line": 170, + "column": 30, + "program": "cast_expressions.ets" + } + } + }, + "property": { + "type": "Identifier", + "name": "toFloat", + "decorators": [], + "loc": { + "start": { + "line": 170, + "column": 31, + "program": "cast_expressions.ets" + }, + "end": { + "line": 170, + "column": 38, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 170, - "column": 34, + "column": 24, "program": "cast_expressions.ets" }, "end": { "line": 170, - "column": 39, + "column": 38, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 170, @@ -10744,7 +12088,7 @@ }, "end": { "line": 170, - "column": 30, + "column": 40, "program": "cast_expressions.ets" } } @@ -10757,7 +12101,7 @@ }, "end": { "line": 170, - "column": 30, + "column": 40, "program": "cast_expressions.ets" } } @@ -10772,7 +12116,7 @@ }, "end": { "line": 170, - "column": 40, + "column": 41, "program": "cast_expressions.ets" } } @@ -10800,39 +12144,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "float_", - "decorators": [], - "loc": { - "start": { - "line": 171, - "column": 24, - "program": "cast_expressions.ets" - }, - "end": { - "line": 171, - "column": 30, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "float_", + "decorators": [], + "loc": { + "start": { + "line": 171, + "column": 24, + "program": "cast_expressions.ets" + }, + "end": { + "line": 171, + "column": 30, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toDouble", + "decorators": [], + "loc": { + "start": { + "line": 171, + "column": 31, + "program": "cast_expressions.ets" + }, + "end": { + "line": 171, + "column": 39, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 171, - "column": 34, + "column": 24, "program": "cast_expressions.ets" }, "end": { "line": 171, - "column": 40, + "column": 39, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 171, @@ -10841,7 +12206,7 @@ }, "end": { "line": 171, - "column": 30, + "column": 41, "program": "cast_expressions.ets" } } @@ -10854,7 +12219,7 @@ }, "end": { "line": 171, - "column": 30, + "column": 41, "program": "cast_expressions.ets" } } @@ -10869,7 +12234,7 @@ }, "end": { "line": 171, - "column": 41, + "column": 42, "program": "cast_expressions.ets" } } @@ -10897,39 +12262,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "Float_", - "decorators": [], - "loc": { - "start": { - "line": 173, - "column": 24, - "program": "cast_expressions.ets" - }, - "end": { - "line": 173, - "column": 30, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "Float_", + "decorators": [], + "loc": { + "start": { + "line": 173, + "column": 24, + "program": "cast_expressions.ets" + }, + "end": { + "line": 173, + "column": 30, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toFloat", + "decorators": [], + "loc": { + "start": { + "line": 173, + "column": 31, + "program": "cast_expressions.ets" + }, + "end": { + "line": 173, + "column": 38, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 173, - "column": 34, + "column": 24, "program": "cast_expressions.ets" }, "end": { "line": 173, - "column": 39, + "column": 38, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 173, @@ -10938,7 +12324,7 @@ }, "end": { "line": 173, - "column": 30, + "column": 40, "program": "cast_expressions.ets" } } @@ -10951,7 +12337,7 @@ }, "end": { "line": 173, - "column": 30, + "column": 40, "program": "cast_expressions.ets" } } @@ -10966,7 +12352,7 @@ }, "end": { "line": 173, - "column": 40, + "column": 41, "program": "cast_expressions.ets" } } @@ -10994,39 +12380,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "Float_", - "decorators": [], - "loc": { - "start": { - "line": 174, - "column": 24, - "program": "cast_expressions.ets" - }, - "end": { - "line": 174, - "column": 30, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "Float_", + "decorators": [], + "loc": { + "start": { + "line": 174, + "column": 24, + "program": "cast_expressions.ets" + }, + "end": { + "line": 174, + "column": 30, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toDouble", + "decorators": [], + "loc": { + "start": { + "line": 174, + "column": 31, + "program": "cast_expressions.ets" + }, + "end": { + "line": 174, + "column": 39, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 174, - "column": 34, + "column": 24, "program": "cast_expressions.ets" }, "end": { "line": 174, - "column": 40, + "column": 39, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 174, @@ -11035,7 +12442,7 @@ }, "end": { "line": 174, - "column": 30, + "column": 41, "program": "cast_expressions.ets" } } @@ -11048,7 +12455,7 @@ }, "end": { "line": 174, - "column": 30, + "column": 41, "program": "cast_expressions.ets" } } @@ -11063,7 +12470,7 @@ }, "end": { "line": 174, - "column": 41, + "column": 42, "program": "cast_expressions.ets" } } @@ -11892,39 +13299,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "double_", - "decorators": [], - "loc": { - "start": { - "line": 191, - "column": 25, - "program": "cast_expressions.ets" - }, - "end": { - "line": 191, - "column": 32, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "double_", + "decorators": [], + "loc": { + "start": { + "line": 191, + "column": 25, + "program": "cast_expressions.ets" + }, + "end": { + "line": 191, + "column": 32, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toByte", + "decorators": [], + "loc": { + "start": { + "line": 191, + "column": 33, + "program": "cast_expressions.ets" + }, + "end": { + "line": 191, + "column": 39, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 191, - "column": 36, + "column": 25, "program": "cast_expressions.ets" }, "end": { "line": 191, - "column": 40, + "column": 39, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 191, @@ -11933,7 +13361,7 @@ }, "end": { "line": 191, - "column": 32, + "column": 41, "program": "cast_expressions.ets" } } @@ -11946,7 +13374,7 @@ }, "end": { "line": 191, - "column": 32, + "column": 41, "program": "cast_expressions.ets" } } @@ -11961,7 +13389,7 @@ }, "end": { "line": 191, - "column": 41, + "column": 42, "program": "cast_expressions.ets" } } @@ -11989,39 +13417,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "double_", - "decorators": [], - "loc": { - "start": { - "line": 192, - "column": 25, - "program": "cast_expressions.ets" - }, - "end": { - "line": 192, - "column": 32, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "double_", + "decorators": [], + "loc": { + "start": { + "line": 192, + "column": 25, + "program": "cast_expressions.ets" + }, + "end": { + "line": 192, + "column": 32, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toShort", + "decorators": [], + "loc": { + "start": { + "line": 192, + "column": 33, + "program": "cast_expressions.ets" + }, + "end": { + "line": 192, + "column": 40, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 192, - "column": 36, + "column": 25, "program": "cast_expressions.ets" }, "end": { "line": 192, - "column": 41, + "column": 40, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 192, @@ -12030,7 +13479,7 @@ }, "end": { "line": 192, - "column": 32, + "column": 42, "program": "cast_expressions.ets" } } @@ -12043,7 +13492,7 @@ }, "end": { "line": 192, - "column": 32, + "column": 42, "program": "cast_expressions.ets" } } @@ -12058,7 +13507,7 @@ }, "end": { "line": 192, - "column": 42, + "column": 43, "program": "cast_expressions.ets" } } @@ -12084,41 +13533,62 @@ "program": "cast_expressions.ets" } } - }, - "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "double_", - "decorators": [], - "loc": { - "start": { - "line": 193, - "column": 25, - "program": "cast_expressions.ets" - }, - "end": { - "line": 193, - "column": 32, - "program": "cast_expressions.ets" + }, + "init": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "double_", + "decorators": [], + "loc": { + "start": { + "line": 193, + "column": 25, + "program": "cast_expressions.ets" + }, + "end": { + "line": 193, + "column": 32, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toChar", + "decorators": [], + "loc": { + "start": { + "line": 193, + "column": 33, + "program": "cast_expressions.ets" + }, + "end": { + "line": 193, + "column": 39, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 193, - "column": 36, + "column": 25, "program": "cast_expressions.ets" }, "end": { "line": 193, - "column": 40, + "column": 39, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 193, @@ -12127,7 +13597,7 @@ }, "end": { "line": 193, - "column": 32, + "column": 41, "program": "cast_expressions.ets" } } @@ -12140,7 +13610,7 @@ }, "end": { "line": 193, - "column": 32, + "column": 41, "program": "cast_expressions.ets" } } @@ -12155,7 +13625,7 @@ }, "end": { "line": 193, - "column": 41, + "column": 42, "program": "cast_expressions.ets" } } @@ -12183,39 +13653,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "double_", - "decorators": [], - "loc": { - "start": { - "line": 194, - "column": 25, - "program": "cast_expressions.ets" - }, - "end": { - "line": 194, - "column": 32, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "double_", + "decorators": [], + "loc": { + "start": { + "line": 194, + "column": 25, + "program": "cast_expressions.ets" + }, + "end": { + "line": 194, + "column": 32, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toInt", + "decorators": [], + "loc": { + "start": { + "line": 194, + "column": 33, + "program": "cast_expressions.ets" + }, + "end": { + "line": 194, + "column": 38, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 194, - "column": 36, + "column": 25, "program": "cast_expressions.ets" }, "end": { "line": 194, - "column": 39, + "column": 38, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 194, @@ -12224,7 +13715,7 @@ }, "end": { "line": 194, - "column": 32, + "column": 40, "program": "cast_expressions.ets" } } @@ -12237,7 +13728,7 @@ }, "end": { "line": 194, - "column": 32, + "column": 40, "program": "cast_expressions.ets" } } @@ -12252,7 +13743,7 @@ }, "end": { "line": 194, - "column": 40, + "column": 41, "program": "cast_expressions.ets" } } @@ -12280,39 +13771,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "double_", - "decorators": [], - "loc": { - "start": { - "line": 195, - "column": 25, - "program": "cast_expressions.ets" - }, - "end": { - "line": 195, - "column": 32, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "double_", + "decorators": [], + "loc": { + "start": { + "line": 195, + "column": 25, + "program": "cast_expressions.ets" + }, + "end": { + "line": 195, + "column": 32, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toLong", + "decorators": [], + "loc": { + "start": { + "line": 195, + "column": 33, + "program": "cast_expressions.ets" + }, + "end": { + "line": 195, + "column": 39, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 195, - "column": 36, + "column": 25, "program": "cast_expressions.ets" }, "end": { "line": 195, - "column": 40, + "column": 39, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 195, @@ -12321,7 +13833,7 @@ }, "end": { "line": 195, - "column": 32, + "column": 41, "program": "cast_expressions.ets" } } @@ -12334,7 +13846,7 @@ }, "end": { "line": 195, - "column": 32, + "column": 41, "program": "cast_expressions.ets" } } @@ -12349,7 +13861,7 @@ }, "end": { "line": 195, - "column": 41, + "column": 42, "program": "cast_expressions.ets" } } @@ -12377,39 +13889,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "double_", - "decorators": [], - "loc": { - "start": { - "line": 196, - "column": 25, - "program": "cast_expressions.ets" - }, - "end": { - "line": 196, - "column": 32, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "double_", + "decorators": [], + "loc": { + "start": { + "line": 196, + "column": 25, + "program": "cast_expressions.ets" + }, + "end": { + "line": 196, + "column": 32, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toFloat", + "decorators": [], + "loc": { + "start": { + "line": 196, + "column": 33, + "program": "cast_expressions.ets" + }, + "end": { + "line": 196, + "column": 40, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 196, - "column": 36, + "column": 25, "program": "cast_expressions.ets" }, "end": { "line": 196, - "column": 41, + "column": 40, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 196, @@ -12418,7 +13951,7 @@ }, "end": { "line": 196, - "column": 32, + "column": 42, "program": "cast_expressions.ets" } } @@ -12431,7 +13964,7 @@ }, "end": { "line": 196, - "column": 32, + "column": 42, "program": "cast_expressions.ets" } } @@ -12446,7 +13979,7 @@ }, "end": { "line": 196, - "column": 42, + "column": 43, "program": "cast_expressions.ets" } } @@ -12474,39 +14007,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "double_", - "decorators": [], - "loc": { - "start": { - "line": 197, - "column": 25, - "program": "cast_expressions.ets" - }, - "end": { - "line": 197, - "column": 32, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "double_", + "decorators": [], + "loc": { + "start": { + "line": 197, + "column": 25, + "program": "cast_expressions.ets" + }, + "end": { + "line": 197, + "column": 32, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toDouble", + "decorators": [], + "loc": { + "start": { + "line": 197, + "column": 33, + "program": "cast_expressions.ets" + }, + "end": { + "line": 197, + "column": 41, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 197, - "column": 36, + "column": 25, "program": "cast_expressions.ets" }, "end": { "line": 197, - "column": 42, + "column": 41, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 197, @@ -12515,7 +14069,7 @@ }, "end": { "line": 197, - "column": 32, + "column": 43, "program": "cast_expressions.ets" } } @@ -12528,7 +14082,7 @@ }, "end": { "line": 197, - "column": 32, + "column": 43, "program": "cast_expressions.ets" } } @@ -12543,7 +14097,7 @@ }, "end": { "line": 197, - "column": 43, + "column": 44, "program": "cast_expressions.ets" } } @@ -12571,39 +14125,60 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "Double_", - "decorators": [], - "loc": { - "start": { - "line": 199, - "column": 25, - "program": "cast_expressions.ets" - }, - "end": { - "line": 199, - "column": 32, - "program": "cast_expressions.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "Double_", + "decorators": [], + "loc": { + "start": { + "line": 199, + "column": 25, + "program": "cast_expressions.ets" + }, + "end": { + "line": 199, + "column": 32, + "program": "cast_expressions.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toDouble", + "decorators": [], + "loc": { + "start": { + "line": 199, + "column": 33, + "program": "cast_expressions.ets" + }, + "end": { + "line": 199, + "column": 41, + "program": "cast_expressions.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 199, - "column": 36, + "column": 25, "program": "cast_expressions.ets" }, "end": { "line": 199, - "column": 42, + "column": 41, "program": "cast_expressions.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 199, @@ -12612,7 +14187,7 @@ }, "end": { "line": 199, - "column": 32, + "column": 43, "program": "cast_expressions.ets" } } @@ -12625,7 +14200,7 @@ }, "end": { "line": 199, - "column": 32, + "column": 43, "program": "cast_expressions.ets" } } @@ -12640,7 +14215,7 @@ }, "end": { "line": 199, - "column": 43, + "column": 44, "program": "cast_expressions.ets" } } diff --git a/ets2panda/test/parser/ets/cast_expressions.ets b/ets2panda/test/parser/ets/cast_expressions.ets index de9c130144b93749f3dfedcf5ecf2ec67d1766c1..499ebb71f1bb51ab3d432ad88badb61fcf5ac6b0 100644 --- a/ets2panda/test/parser/ets/cast_expressions.ets +++ b/ets2panda/test/parser/ets/cast_expressions.ets @@ -19,20 +19,20 @@ function byte_test(): void { { // Casting to primitive types - let byte_byte = byte_ as byte; - let byte_short = byte_ as short; - let byte_char = byte_ as char; - let byte_int = byte_ as int; - let byte_long = byte_ as long; - let byte_float = byte_ as float; - let byte_double = byte_ as double; - - let Byte_byte = Byte_ as byte; - let Byte_short = Byte_ as short; - let Byte_int = Byte_ as int; - let Byte_long = Byte_ as long; - let Byte_float = Byte_ as float; - let Byte_double = Byte_ as double; + let byte_byte = byte_.toByte(); + let byte_short = byte_.toShort(); + let byte_char = byte_.toChar(); + let byte_int = byte_.toInt(); + let byte_long = byte_.toLong(); + let byte_float = byte_.toFloat(); + let byte_double = byte_.toDouble(); + + let Byte_byte = Byte_.toByte(); + let Byte_short = Byte_.toShort(); + let Byte_int = Byte_.toInt(); + let Byte_long = Byte_.toLong(); + let Byte_float = Byte_.toFloat(); + let Byte_double = Byte_.toDouble(); } { @@ -49,19 +49,19 @@ function short_test(): void { { // Casting to primitive types - let short_byte = short_ as byte; - let short_short = short_ as short; - let short_char = short_ as char; - let short_int = short_ as int; - let short_long = short_ as long; - let short_float = short_ as float; - let short_double = short_ as double; - - let Short_short = Short_ as short; - let Short_int = Short_ as int; - let Short_long = Short_ as long; - let Short_float = Short_ as float; - let Short_double = Short_ as double; + let short_byte = short_.toByte(); + let short_short = short_.toShort(); + let short_char = short_.toChar(); + let short_int = short_.toInt(); + let short_long = short_.toLong(); + let short_float = short_.toFloat(); + let short_double = short_.toDouble(); + + let Short_short = Short_.toShort(); + let Short_int = Short_.toInt(); + let Short_long = Short_.toLong(); + let Short_float = Short_.toFloat(); + let Short_double = Short_.toDouble(); } { @@ -78,19 +78,19 @@ function char_test(): void { { // Casting to primitive types - let char_byte = char_ as byte; - let char_short = char_ as short; - let char_char = char_ as char; - let char_int = char_ as int; - let char_long = char_ as long; - let char_float = char_ as float; - let char_double = char_ as double; - - let Char_char = Char_ as char; - let Char_int = Char_ as int; - let Char_long = Char_ as long; - let Char_float = Char_ as float; - let Char_double = Char_ as double; + let char_byte = char_.toByte(); + let char_short = char_.toShort(); + let char_char = char_.toChar(); + let char_int = char_.toInt(); + let char_long = char_.toLong(); + let char_float = char_.toFloat(); + let char_double = char_.toDouble(); + + let Char_char = Char_.toChar(); + let Char_int = Char_.toInt(); + let Char_long = Char_.toLong(); + let Char_float = Char_.toFloat(); + let Char_double = Char_.toDouble(); } { @@ -107,18 +107,18 @@ function int_test(): void { { // Casting to primitive types - let int_byte = int_ as byte; - let int_short = int_ as short; - let int_char = int_ as char; - let int_int = int_ as int; - let int_long = int_ as long; - let int_float = int_ as float; - let int_double = int_ as double; - - let Int_int = Int_ as int; - let Int_long = Int_ as long; - let Int_float = Int_ as float; - let Int_double = Int_ as double; + let int_byte = int_.toByte(); + let int_short = int_.toShort(); + let int_char = int_.toChar(); + let int_int = int_.toInt(); + let int_long = int_.toLong(); + let int_float = int_.toFloat(); + let int_double = int_.toDouble(); + + let Int_int = Int_.toInt(); + let Int_long = Int_.toLong(); + let Int_float = Int_.toFloat(); + let Int_double = Int_.toDouble(); } { @@ -135,17 +135,17 @@ function long_test(): void { { // Casting to primitive types - let long_byte = long_ as byte; - let long_short = long_ as short; - let long_char = long_ as char; - let long_int = long_ as int; - let long_long = long_ as long; - let long_float = long_ as float; - let long_double = long_ as double; - - let Long_long = Long_ as long; - let Long_float = Long_ as float; - let Long_double = Long_ as double; + let long_byte = long_.toByte(); + let long_short = long_.toShort(); + let long_char = long_.toChar(); + let long_int = long_.toInt(); + let long_long = long_.toLong(); + let long_float = long_.toFloat(); + let long_double = long_.toDouble(); + + let Long_long = Long_.toLong(); + let Long_float = Long_.toFloat(); + let Long_double = Long_.toDouble(); } { @@ -162,16 +162,16 @@ function float_test(): void { { // Casting to primitive types - let float_byte = float_ as byte; - let float_short = float_ as short; - let float_char = float_ as char; - let float_int = float_ as int; - let float_long = float_ as long; - let float_float = float_ as float; - let float_double = float_ as double; + let float_byte = float_.toByte(); + let float_short = float_.toShort(); + let float_char = float_.toChar(); + let float_int = float_.toInt(); + let float_long = float_.toLong(); + let float_float = float_.toFloat(); + let float_double = float_.toDouble(); - let Float_float = Float_ as float; - let Float_double = Float_ as double; + let Float_float = Float_.toFloat(); + let Float_double = Float_.toDouble(); } { @@ -188,15 +188,15 @@ function double_test(): void { { // Casting to primitive types - let double_byte = double_ as byte; - let double_short = double_ as short; - let double_char = double_ as char; - let double_int = double_ as int; - let double_long = double_ as long; - let double_float = double_ as float; - let double_double = double_ as double; - - let Double_double = Double_ as double; + let double_byte = double_.toByte(); + let double_short = double_.toShort(); + let double_char = double_.toChar(); + let double_int = double_.toInt(); + let double_long = double_.toLong(); + let double_float = double_.toFloat(); + let double_double = double_.toDouble(); + + let Double_double = Double_.toDouble(); } { diff --git a/ets2panda/test/parser/ets/cast_expressions5-expected.txt b/ets2panda/test/parser/ets/cast_expressions5-expected.txt index bc09d5b685b500e67bd02238e095b506257d666b..ab9a22576b6e3a73e4115185495366f6cc36aec5 100644 --- a/ets2panda/test/parser/ets/cast_expressions5-expected.txt +++ b/ets2panda/test/parser/ets/cast_expressions5-expected.txt @@ -370,11 +370,45 @@ { "type": "ReturnStatement", "argument": { - "type": "TSAsExpression", - "expression": { + "type": "CallExpression", + "callee": { "type": "MemberExpression", "object": { - "type": "ThisExpression", + "type": "MemberExpression", + "object": { + "type": "ThisExpression", + "loc": { + "start": { + "line": 30, + "column": 12, + "program": "cast_expressions5.ets" + }, + "end": { + "line": 30, + "column": 16, + "program": "cast_expressions5.ets" + } + } + }, + "property": { + "type": "Identifier", + "name": "a", + "decorators": [], + "loc": { + "start": { + "line": 30, + "column": 17, + "program": "cast_expressions5.ets" + }, + "end": { + "line": 30, + "column": 18, + "program": "cast_expressions5.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 30, @@ -383,24 +417,24 @@ }, "end": { "line": 30, - "column": 16, + "column": 18, "program": "cast_expressions5.ets" } } }, "property": { "type": "Identifier", - "name": "a", + "name": "toLong", "decorators": [], "loc": { "start": { "line": 30, - "column": 17, + "column": 19, "program": "cast_expressions5.ets" }, "end": { "line": 30, - "column": 18, + "column": 25, "program": "cast_expressions5.ets" } } @@ -415,26 +449,13 @@ }, "end": { "line": 30, - "column": 18, - "program": "cast_expressions5.ets" - } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 30, - "column": 22, - "program": "cast_expressions5.ets" - }, - "end": { - "line": 30, - "column": 26, + "column": 25, "program": "cast_expressions5.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 30, @@ -443,7 +464,7 @@ }, "end": { "line": 30, - "column": 18, + "column": 27, "program": "cast_expressions5.ets" } } @@ -456,7 +477,7 @@ }, "end": { "line": 30, - "column": 27, + "column": 28, "program": "cast_expressions5.ets" } } diff --git a/ets2panda/test/parser/ets/cast_expressions5.ets b/ets2panda/test/parser/ets/cast_expressions5.ets index d0b64144450289fd657755fc1a5c43e85d9539eb..cfcdb1c3742fd9a8ee6312ee92b3f612fc2ba178 100644 --- a/ets2panda/test/parser/ets/cast_expressions5.ets +++ b/ets2panda/test/parser/ets/cast_expressions5.ets @@ -27,6 +27,6 @@ class A { } method2(): long { - return this.a as long; + return this.a.toLong(); } } diff --git a/ets2panda/test/parser/ets/lambda-type-inference-expected.txt b/ets2panda/test/parser/ets/lambda-type-inference-expected.txt index 677295a425c717bbca61d7489313ee4e27cef15e..b8e4591d4d61cb8492a4faafdd5b4f8a8e66474b 100644 --- a/ets2panda/test/parser/ets/lambda-type-inference-expected.txt +++ b/ets2panda/test/parser/ets/lambda-type-inference-expected.txt @@ -1633,28 +1633,43 @@ { "type": "ReturnStatement", "argument": { - "type": "TSAsExpression", - "expression": { + "type": "CallExpression", + "callee": { "type": "MemberExpression", "object": { - "type": "ETSNewClassInstanceExpression", - "typeReference": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "String", - "decorators": [], + "type": "MemberExpression", + "object": { + "type": "ETSNewClassInstanceExpression", + "typeReference": { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "String", + "decorators": [], + "loc": { + "start": { + "line": 37, + "column": 21, + "program": "lambda-type-inference.ets" + }, + "end": { + "line": 37, + "column": 27, + "program": "lambda-type-inference.ets" + } + } + }, "loc": { "start": { "line": 37, - "column": 20, + "column": 21, "program": "lambda-type-inference.ets" }, "end": { "line": 37, - "column": 26, + "column": 28, "program": "lambda-type-inference.ets" } } @@ -1662,47 +1677,66 @@ "loc": { "start": { "line": 37, - "column": 20, + "column": 21, "program": "lambda-type-inference.ets" }, "end": { "line": 37, - "column": 27, + "column": 28, "program": "lambda-type-inference.ets" } } }, + "arguments": [ + { + "type": "StringLiteral", + "value": "hello", + "loc": { + "start": { + "line": 37, + "column": 28, + "program": "lambda-type-inference.ets" + }, + "end": { + "line": 37, + "column": 35, + "program": "lambda-type-inference.ets" + } + } + } + ], "loc": { "start": { "line": 37, - "column": 20, + "column": 16, "program": "lambda-type-inference.ets" }, "end": { "line": 37, - "column": 27, + "column": 37, "program": "lambda-type-inference.ets" } } }, - "arguments": [ - { - "type": "StringLiteral", - "value": "hello", - "loc": { - "start": { - "line": 37, - "column": 27, - "program": "lambda-type-inference.ets" - }, - "end": { - "line": 37, - "column": 34, - "program": "lambda-type-inference.ets" - } + "property": { + "type": "Identifier", + "name": "length", + "decorators": [], + "loc": { + "start": { + "line": 37, + "column": 38, + "program": "lambda-type-inference.ets" + }, + "end": { + "line": 37, + "column": 44, + "program": "lambda-type-inference.ets" } } - ], + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 37, @@ -1711,24 +1745,24 @@ }, "end": { "line": 37, - "column": 36, + "column": 44, "program": "lambda-type-inference.ets" } } }, "property": { "type": "Identifier", - "name": "length", + "name": "toInt", "decorators": [], "loc": { "start": { "line": 37, - "column": 36, + "column": 45, "program": "lambda-type-inference.ets" }, "end": { "line": 37, - "column": 42, + "column": 50, "program": "lambda-type-inference.ets" } } @@ -1743,26 +1777,13 @@ }, "end": { "line": 37, - "column": 42, - "program": "lambda-type-inference.ets" - } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 37, - "column": 46, - "program": "lambda-type-inference.ets" - }, - "end": { - "line": 37, - "column": 49, + "column": 50, "program": "lambda-type-inference.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 37, @@ -1771,7 +1792,7 @@ }, "end": { "line": 37, - "column": 42, + "column": 52, "program": "lambda-type-inference.ets" } } @@ -1784,7 +1805,7 @@ }, "end": { "line": 37, - "column": 50, + "column": 53, "program": "lambda-type-inference.ets" } } @@ -1894,28 +1915,43 @@ { "type": "ReturnStatement", "argument": { - "type": "TSAsExpression", - "expression": { + "type": "CallExpression", + "callee": { "type": "MemberExpression", "object": { - "type": "ETSNewClassInstanceExpression", - "typeReference": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "String", - "decorators": [], + "type": "MemberExpression", + "object": { + "type": "ETSNewClassInstanceExpression", + "typeReference": { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "String", + "decorators": [], + "loc": { + "start": { + "line": 40, + "column": 21, + "program": "lambda-type-inference.ets" + }, + "end": { + "line": 40, + "column": 27, + "program": "lambda-type-inference.ets" + } + } + }, "loc": { "start": { "line": 40, - "column": 20, + "column": 21, "program": "lambda-type-inference.ets" }, "end": { "line": 40, - "column": 26, + "column": 28, "program": "lambda-type-inference.ets" } } @@ -1923,47 +1959,66 @@ "loc": { "start": { "line": 40, - "column": 20, + "column": 21, "program": "lambda-type-inference.ets" }, "end": { "line": 40, - "column": 27, + "column": 28, "program": "lambda-type-inference.ets" } } }, + "arguments": [ + { + "type": "StringLiteral", + "value": "hello", + "loc": { + "start": { + "line": 40, + "column": 28, + "program": "lambda-type-inference.ets" + }, + "end": { + "line": 40, + "column": 35, + "program": "lambda-type-inference.ets" + } + } + } + ], "loc": { "start": { "line": 40, - "column": 20, + "column": 16, "program": "lambda-type-inference.ets" }, "end": { "line": 40, - "column": 27, + "column": 37, "program": "lambda-type-inference.ets" } } }, - "arguments": [ - { - "type": "StringLiteral", - "value": "hello", - "loc": { - "start": { - "line": 40, - "column": 27, - "program": "lambda-type-inference.ets" - }, - "end": { - "line": 40, - "column": 34, - "program": "lambda-type-inference.ets" - } + "property": { + "type": "Identifier", + "name": "length", + "decorators": [], + "loc": { + "start": { + "line": 40, + "column": 38, + "program": "lambda-type-inference.ets" + }, + "end": { + "line": 40, + "column": 44, + "program": "lambda-type-inference.ets" } } - ], + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 40, @@ -1972,24 +2027,24 @@ }, "end": { "line": 40, - "column": 36, + "column": 44, "program": "lambda-type-inference.ets" } } }, "property": { "type": "Identifier", - "name": "length", + "name": "toInt", "decorators": [], "loc": { "start": { "line": 40, - "column": 36, + "column": 45, "program": "lambda-type-inference.ets" }, "end": { "line": 40, - "column": 42, + "column": 50, "program": "lambda-type-inference.ets" } } @@ -2004,26 +2059,13 @@ }, "end": { "line": 40, - "column": 42, - "program": "lambda-type-inference.ets" - } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 40, - "column": 46, - "program": "lambda-type-inference.ets" - }, - "end": { - "line": 40, - "column": 49, + "column": 50, "program": "lambda-type-inference.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 40, @@ -2032,7 +2074,7 @@ }, "end": { "line": 40, - "column": 42, + "column": 52, "program": "lambda-type-inference.ets" } } @@ -2045,7 +2087,7 @@ }, "end": { "line": 40, - "column": 50, + "column": 53, "program": "lambda-type-inference.ets" } } diff --git a/ets2panda/test/parser/ets/lambda-type-inference.ets b/ets2panda/test/parser/ets/lambda-type-inference.ets index 81223e7cec1c68e7a0b0f96c8d1cab5cf1c5357f..f36c02babf7838a043602419edf7b8899bdd9157 100644 --- a/ets2panda/test/parser/ets/lambda-type-inference.ets +++ b/ets2panda/test/parser/ets/lambda-type-inference.ets @@ -34,10 +34,10 @@ function main(): void { }); callbackNoArgInt((): int => { - return new String("hello").length as int; + return (new String("hello")).length.toInt(); }); callbackNoArgInt(() => { - return new String("hello").length as int; + return (new String("hello")).length.toInt(); }); callbackIntStringBool((x: int, y: String): boolean => { diff --git a/ets2panda/test/parser/ets/rethrow-func-1-expected.txt b/ets2panda/test/parser/ets/rethrow-func-1-expected.txt index 74a8f4c9f123482bc53f759e5daf5cf4b790751e..8e9d7e605017436ec7fdb938df30aa4f505ef7e8 100644 --- a/ets2panda/test/parser/ets/rethrow-func-1-expected.txt +++ b/ets2panda/test/parser/ets/rethrow-func-1-expected.txt @@ -1275,4 +1275,4 @@ } } } -SyntaxError: Division by zero are not allowed. [rethrow-func-1.ets:26:17] +SyntaxError: Division by zero is not allowed. [rethrow-func-1.ets:26:17] diff --git a/ets2panda/test/parser/ets/simple_types-expected.txt b/ets2panda/test/parser/ets/simple_types-expected.txt index 02ebb2a18137878e991c7a4a3d9416def893ab2a..cc148403109fd0df8891d04abd198467b927bc2f 100644 --- a/ets2panda/test/parser/ets/simple_types-expected.txt +++ b/ets2panda/test/parser/ets/simple_types-expected.txt @@ -589,8 +589,77 @@ } }, "right": { - "type": "NumberLiteral", - "value": 3.1415, + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "Double", + "decorators": [], + "loc": { + "start": { + "line": 26, + "column": 16, + "program": "simple_types.ets" + }, + "end": { + "line": 26, + "column": 22, + "program": "simple_types.ets" + } + } + }, + "property": { + "type": "Identifier", + "name": "toFloat", + "decorators": [], + "loc": { + "start": { + "line": 26, + "column": 23, + "program": "simple_types.ets" + }, + "end": { + "line": 26, + "column": 30, + "program": "simple_types.ets" + } + } + }, + "computed": false, + "optional": false, + "loc": { + "start": { + "line": 26, + "column": 16, + "program": "simple_types.ets" + }, + "end": { + "line": 26, + "column": 30, + "program": "simple_types.ets" + } + } + }, + "arguments": [ + { + "type": "NumberLiteral", + "value": 3.1415, + "loc": { + "start": { + "line": 26, + "column": 31, + "program": "simple_types.ets" + }, + "end": { + "line": 26, + "column": 37, + "program": "simple_types.ets" + } + } + } + ], + "optional": false, "loc": { "start": { "line": 26, @@ -599,7 +668,7 @@ }, "end": { "line": 26, - "column": 22, + "column": 38, "program": "simple_types.ets" } } @@ -612,7 +681,7 @@ }, "end": { "line": 26, - "column": 22, + "column": 38, "program": "simple_types.ets" } } @@ -625,7 +694,7 @@ }, "end": { "line": 26, - "column": 22, + "column": 38, "program": "simple_types.ets" } } @@ -1249,7 +1318,7 @@ }, "end": { "line": 26, - "column": 22, + "column": 38, "program": "simple_types.ets" } } diff --git a/ets2panda/test/parser/ets/simple_types.ets b/ets2panda/test/parser/ets/simple_types.ets index 1b7e2adf1936b3f19569aeb7915f031e7b732ff1..d94d7ace0f57b36105df259fbd54c7964a4cf69e 100644 --- a/ets2panda/test/parser/ets/simple_types.ets +++ b/ets2panda/test/parser/ets/simple_types.ets @@ -23,7 +23,7 @@ let f: char = c'a'; let g: undefined; -let k: float = 3.1415; +let k: float = Double.toFloat(3.1415); let l: double = 3.1415; let c2: int = a; diff --git a/ets2panda/test/parser/ets/type_cast-expected.txt b/ets2panda/test/parser/ets/type_cast-expected.txt index a721015acb0d7af7dd9a3379daf782dd3d032b50..d75a72aa64bb7e0cbaf44204c8bc6ca0887e17db 100644 --- a/ets2panda/test/parser/ets/type_cast-expected.txt +++ b/ets2panda/test/parser/ets/type_cast-expected.txt @@ -186,11 +186,45 @@ } }, "value": { - "type": "TSAsExpression", - "expression": { + "type": "CallExpression", + "callee": { "type": "MemberExpression", "object": { - "type": "ThisExpression", + "type": "MemberExpression", + "object": { + "type": "ThisExpression", + "loc": { + "start": { + "line": 19, + "column": 23, + "program": "type_cast.ets" + }, + "end": { + "line": 19, + "column": 27, + "program": "type_cast.ets" + } + } + }, + "property": { + "type": "Identifier", + "name": "d", + "decorators": [], + "loc": { + "start": { + "line": 19, + "column": 28, + "program": "type_cast.ets" + }, + "end": { + "line": 19, + "column": 29, + "program": "type_cast.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 19, @@ -199,24 +233,24 @@ }, "end": { "line": 19, - "column": 27, + "column": 29, "program": "type_cast.ets" } } }, "property": { "type": "Identifier", - "name": "d", + "name": "toInt", "decorators": [], "loc": { "start": { "line": 19, - "column": 28, + "column": 30, "program": "type_cast.ets" }, "end": { "line": 19, - "column": 29, + "column": 35, "program": "type_cast.ets" } } @@ -231,26 +265,13 @@ }, "end": { "line": 19, - "column": 29, - "program": "type_cast.ets" - } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 19, - "column": 33, - "program": "type_cast.ets" - }, - "end": { - "line": 19, - "column": 36, + "column": 35, "program": "type_cast.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 19, @@ -259,7 +280,7 @@ }, "end": { "line": 19, - "column": 29, + "column": 37, "program": "type_cast.ets" } } @@ -295,7 +316,7 @@ }, "end": { "line": 19, - "column": 29, + "column": 37, "program": "type_cast.ets" } } @@ -391,11 +412,45 @@ } }, "value": { - "type": "TSAsExpression", - "expression": { + "type": "CallExpression", + "callee": { "type": "MemberExpression", "object": { - "type": "ThisExpression", + "type": "MemberExpression", + "object": { + "type": "ThisExpression", + "loc": { + "start": { + "line": 21, + "column": 25, + "program": "type_cast.ets" + }, + "end": { + "line": 21, + "column": 29, + "program": "type_cast.ets" + } + } + }, + "property": { + "type": "Identifier", + "name": "c", + "decorators": [], + "loc": { + "start": { + "line": 21, + "column": 30, + "program": "type_cast.ets" + }, + "end": { + "line": 21, + "column": 31, + "program": "type_cast.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 21, @@ -404,24 +459,24 @@ }, "end": { "line": 21, - "column": 29, + "column": 31, "program": "type_cast.ets" } } }, "property": { "type": "Identifier", - "name": "c", + "name": "toByte", "decorators": [], "loc": { "start": { "line": 21, - "column": 30, + "column": 32, "program": "type_cast.ets" }, "end": { "line": 21, - "column": 31, + "column": 38, "program": "type_cast.ets" } } @@ -436,26 +491,13 @@ }, "end": { "line": 21, - "column": 31, - "program": "type_cast.ets" - } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 21, - "column": 35, - "program": "type_cast.ets" - }, - "end": { - "line": 21, - "column": 39, + "column": 38, "program": "type_cast.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 21, @@ -464,7 +506,7 @@ }, "end": { "line": 21, - "column": 31, + "column": 40, "program": "type_cast.ets" } } @@ -500,7 +542,7 @@ }, "end": { "line": 21, - "column": 31, + "column": 40, "program": "type_cast.ets" } } @@ -525,11 +567,45 @@ } }, "value": { - "type": "TSAsExpression", - "expression": { + "type": "CallExpression", + "callee": { "type": "MemberExpression", "object": { - "type": "ThisExpression", + "type": "MemberExpression", + "object": { + "type": "ThisExpression", + "loc": { + "start": { + "line": 22, + "column": 16, + "program": "type_cast.ets" + }, + "end": { + "line": 22, + "column": 20, + "program": "type_cast.ets" + } + } + }, + "property": { + "type": "Identifier", + "name": "d", + "decorators": [], + "loc": { + "start": { + "line": 22, + "column": 21, + "program": "type_cast.ets" + }, + "end": { + "line": 22, + "column": 22, + "program": "type_cast.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 22, @@ -538,24 +614,24 @@ }, "end": { "line": 22, - "column": 20, + "column": 22, "program": "type_cast.ets" } } }, "property": { "type": "Identifier", - "name": "d", + "name": "toFloat", "decorators": [], "loc": { "start": { "line": 22, - "column": 21, + "column": 23, "program": "type_cast.ets" }, "end": { "line": 22, - "column": 22, + "column": 30, "program": "type_cast.ets" } } @@ -570,26 +646,13 @@ }, "end": { "line": 22, - "column": 22, - "program": "type_cast.ets" - } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 22, - "column": 26, - "program": "type_cast.ets" - }, - "end": { - "line": 22, - "column": 31, + "column": 30, "program": "type_cast.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 22, @@ -598,7 +661,7 @@ }, "end": { "line": 22, - "column": 22, + "column": 32, "program": "type_cast.ets" } } @@ -634,7 +697,7 @@ }, "end": { "line": 22, - "column": 22, + "column": 32, "program": "type_cast.ets" } } diff --git a/ets2panda/test/parser/ets/type_cast.ets b/ets2panda/test/parser/ets/type_cast.ets index 147c1d1e6fb4e9b132aa9ff11f6f5ee1b09c1861..2793fba742d6038e74bd25a3398bb7a8363b546c 100644 --- a/ets2panda/test/parser/ets/type_cast.ets +++ b/ets2panda/test/parser/ets/type_cast.ets @@ -16,8 +16,8 @@ export class type_cast { private i1: int = 34; private d: double = 3.7; - private i2: int = this.d as int; + private i2: int = this.d.toInt(); protected c: char = c'c'; - protected b: byte = this.c as byte; - f: float = this.d as float; + protected b: byte = this.c.toByte(); + f: float = this.d.toFloat(); } diff --git a/ets2panda/test/runtime/ets/15656.ets b/ets2panda/test/runtime/ets/15656.ets index 1459139905a446cd1b48ea3520e7580ebc387a68..b106aaec8eccf88d0710ebdadff434527fb0805a 100644 --- a/ets2panda/test/runtime/ets/15656.ets +++ b/ets2panda/test/runtime/ets/15656.ets @@ -19,5 +19,5 @@ function foo(lmb: (i: number) => number): number { } function main(): int { - return foo((i:number): number => { return i }) as int + return Double.toInt(foo((i:number): number => { return i })) } diff --git a/ets2panda/test/runtime/ets/AccessNBody.ets b/ets2panda/test/runtime/ets/AccessNBody.ets index 17740b5c161d6d61b44449341e33a4560f0eda66..88ed759dadd6723410dc96372f22fa8347475e41 100644 --- a/ets2panda/test/runtime/ets/AccessNBody.ets +++ b/ets2panda/test/runtime/ets/AccessNBody.ets @@ -50,7 +50,7 @@ class NBodySystem { let px : double = 0.0; let py : double = 0.0; let pz : double = 0.0; - let size : int = this.bodies.length as int; + let size : int = Double.toInt(this.bodies.length); for (let i : int = 0; i < size; i++) { let b : Body = this.bodies[i]; let m : double = b.mass; @@ -67,7 +67,7 @@ class NBodySystem { let dz : double ; let distance : double ; let mag : double ; - let size : int = this.bodies.length as int; + let size : int = Double.toInt(this.bodies.length); for (let i : int = 0; i < size; i++) { let bodyi : Body = this.bodies[i]; for (let j : int = i + 1; j < size; j++) { @@ -98,7 +98,7 @@ class NBodySystem { let dz : double ; let distance : double ; let e : double = 0.0; - let size : int = this.bodies.length as int; + let size : int = Double.toInt(this.bodies.length); for (let i : int = 0; i < size; i++) { let bodyi : Body = this.bodies[i]; e += 0.5 * bodyi.mass * (bodyi.vx * bodyi.vx + bodyi.vy * bodyi.vy + bodyi.vz * bodyi.vz); diff --git a/ets2panda/test/runtime/ets/ArrayLiteral.ets b/ets2panda/test/runtime/ets/ArrayLiteral.ets index 138113de778dc01763ba5f2b8dacbf8012b74102..b4a11058434a0ea1c72c87bbf28bea6e5803073b 100644 --- a/ets2panda/test/runtime/ets/ArrayLiteral.ets +++ b/ets2panda/test/runtime/ets/ArrayLiteral.ets @@ -34,7 +34,7 @@ function main(): void { const k: long = 2; const l: float = 2.0f; const m: double = 2.0; - const n: byte[] = [h, i, j, k, l, m]; + const n: byte[] = [h, i, j, k, Float.toByte(l), Double.toByte(m)]; assertEQ(n[0], 2) assertEQ(n[1], 2) assertEQ(n[2], 2) diff --git a/ets2panda/test/runtime/ets/MathCordic.ets b/ets2panda/test/runtime/ets/MathCordic.ets index 0e861bbf6c33ad5a64939084ca1d7857588a493a..a0701ed1a421f861f489c4e0a7062137acfb724f 100644 --- a/ets2panda/test/runtime/ets/MathCordic.ets +++ b/ets2panda/test/runtime/ets/MathCordic.ets @@ -42,14 +42,14 @@ export class MathCordic { for (step = 0; step < 12; step++) { let newX : double ; if (targetAngle > currAngle) { - newX = x - (y as int >> step); - y = (x as int >> step) + y; + newX = x - (Double.toInt(y) >> step); + y = (Double.toInt(x) >> step) + y; x = newX; currAngle += MathCordic.ANGLES[step]; } else { - newX = x + (y as int >> step); - y = -(x as int >> step) + y; + newX = x + (Double.toInt(y) >> step); + y = -(Double.toInt(x) >> step) + y; x = newX; currAngle -= MathCordic.ANGLES[step]; } diff --git a/ets2panda/test/runtime/ets/RegisterSpiller.ets b/ets2panda/test/runtime/ets/RegisterSpiller.ets index 3e1f984b85c411c23b0b6298b4820a31fea1fd01..ec627eae4aa2030a479be0747cd6909aef8349fb 100644 --- a/ets2panda/test/runtime/ets/RegisterSpiller.ets +++ b/ets2panda/test/runtime/ets/RegisterSpiller.ets @@ -17,7 +17,7 @@ function main(): void { let str: String = "hello\nworld\n"; assertEQ(str.charAt(2), c'l') assertEQ(str.length, 12) - assertEQ(str.charAt(str.length as int - 1), c'\n') + assertEQ(str.charAt(Double.toInt(str.length) - 1), c'\n') let a: String = "abc"; let b: String = "ace"; diff --git a/ets2panda/test/runtime/ets/StringBase64.ets b/ets2panda/test/runtime/ets/StringBase64.ets index 8b5f91d36a161d2c6afa46875ac44343b220d672..3ef00b1219bd12d2b5f740d5bc58a1d4a39fdeb0 100644 --- a/ets2panda/test/runtime/ets/StringBase64.ets +++ b/ets2panda/test/runtime/ets/StringBase64.ets @@ -19,7 +19,7 @@ export class StringBase64 { static readonly TO_BINARY_TABLE : int[] = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, 0, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1]; final toBase64(data : String): String { let result : StringBuilder = new StringBuilder(); - let length : int = data.length as int; + let length : int = Double.toInt(data.length); let i : int ; for (i = 0; i < (length - 2); i += 3) { result.append(StringBase64.TO_BASE64_TABLE.charAt(data.charAt(i) >> 2)); @@ -58,7 +58,7 @@ export class StringBase64 { if (leftbits >= 8) { leftbits -= 8; if (!padding) { - result.append(((leftdata >> leftbits) & 0xff) as char); + result.append(Int.toChar((leftdata >> leftbits) & 0xff)); } leftdata &= (1 << leftbits) - 1; } @@ -72,7 +72,7 @@ export class StringBase64 { public run(): void { let str : String = ""; for (let i : int = 0; i < this.n1; i++) { - str += ((25 * random()) + 97) as char; + str += Double.toChar((25 * random()) + 97); } for (let i : int = this.n1; i <= this.n2; i *= 2) { let base64 : String = this.toBase64(str); diff --git a/ets2panda/test/runtime/ets/UpdateExpression.ets b/ets2panda/test/runtime/ets/UpdateExpression.ets index 7c764d28ced86b510f2bf18cb9a56b7e814caa10..ea79477ae639c095228917f45788294b48b418c0 100644 --- a/ets2panda/test/runtime/ets/UpdateExpression.ets +++ b/ets2panda/test/runtime/ets/UpdateExpression.ets @@ -81,16 +81,16 @@ function main(): void { { let b: byte = 127; - assertEQ(++b as int, -128) - assertEQ(--b as int, 127) + assertEQ(Byte.toInt(++b), -128) + assertEQ(Byte.toInt(--b), 127) let c: char = 65535; - assertEQ(++c as int, 0) - assertEQ(--c as int, 65535) + assertEQ(Char.toInt(++c), 0) + assertEQ(Char.toInt(--c), 65535) let s: short = 32767; - assertEQ(++s as int, -32768) - assertEQ(--s as int, 32767) + assertEQ(Short.toInt(++s), -32768) + assertEQ(Short.toInt(--s), 32767) } { diff --git a/ets2panda/test/runtime/ets/boxingConversions3.ets b/ets2panda/test/runtime/ets/boxingConversions3.ets index 49c48b0ee196ce18a16aa3783ebebad0128306b0..b5a1ab4277ab11eaad0ab4c0cfb0f6da82956d44 100644 --- a/ets2panda/test/runtime/ets/boxingConversions3.ets +++ b/ets2panda/test/runtime/ets/boxingConversions3.ets @@ -14,8 +14,8 @@ */ function main() { - let b: byte = 1.0 - let s: Short = b + let b: byte = 1 + let s: Short = b let i: Int = b let l: Long = b let f: Float = b diff --git a/ets2panda/test/runtime/ets/castSequence.ets b/ets2panda/test/runtime/ets/castSequence.ets index 23d7d88b2d8e31d16a0097c0f1105c3ae3cdfd51..bdc27764fa581056a273f4c2a22d4149acbe4311 100644 --- a/ets2panda/test/runtime/ets/castSequence.ets +++ b/ets2panda/test/runtime/ets/castSequence.ets @@ -15,12 +15,12 @@ function main(): void { let a_int : int = 2147; - let b_Num : Number = a_int as Number; + let b_Num : Number = Int.toDouble(a_int); assertTrue(b_Num instanceof Number && b_Num.unboxed() == 2147.0) let a_Short : Short = 215; - let b_double : double = a_Short as double; + let b_double : double = Short.toDouble(a_Short); assertTrue(a_Short instanceof Short) assertEQ(b_double, 215.0) diff --git a/ets2panda/test/runtime/ets/compoundAssignmentExpression.ets b/ets2panda/test/runtime/ets/compoundAssignmentExpression.ets index abf352f21ca68ae5a1e5a8fdc2c90e7bc9a0561b..2688584ce51617915ef2bec90c0bc0bd583a6281 100644 --- a/ets2panda/test/runtime/ets/compoundAssignmentExpression.ets +++ b/ets2panda/test/runtime/ets/compoundAssignmentExpression.ets @@ -16,11 +16,11 @@ function main() { let s: FixedArray = ["s1", "s2"]; let res: FixedArray = [0, 0, 0, 0, 0]; - res[0] -= s[1 % 2].length as int; + res[0] -= Double.toInt(s[1 % 2].length); res[(res.length - 4) as Int] += 1; - res[2 % (res.length as int)] &= s[1].length; - res[3 % (res.length as int)] |= s[1 % 2].length as int; - res[2 % (res.length as int) + s.length] *= s[1 % 2].length as int; + res[2 % (res.length as int)] &= Double.toInt(s[1].length); + res[3 % (res.length as int)] |= Double.toInt(s[1 % 2].length); + res[2 % (res.length as int) + s.length] *= Double.toInt(s[1 % 2].length); assertEQ(res[0], -2); assertEQ(res[1], 1); diff --git a/ets2panda/test/runtime/ets/conversionFromInfinity.ets b/ets2panda/test/runtime/ets/conversionFromInfinity.ets index 495594431dab98bdc0b9a0c46a6cc3ae38ac09f2..140ba69b2f145e9a3bee00bc2b089473e4f3ca65 100644 --- a/ets2panda/test/runtime/ets/conversionFromInfinity.ets +++ b/ets2panda/test/runtime/ets/conversionFromInfinity.ets @@ -16,14 +16,14 @@ function main(): void { -let nan_byte = Infinity * 0 as byte -let nan_short = Infinity * 0 as short -let nan_long = Infinity * 0 as long -let nan_char = Infinity * 0 as char -let nan_int = Infinity * 0 as int -let nan_float = Infinity * 0 as float -let nan_double = Infinity * 0 as double -let nan_byte2 = Infinity * 0 as byte +let nan_byte = Double.toByte(Infinity * 0) +let nan_short = Double.toShort(Infinity * 0) +let nan_long = Double.toLong(Infinity * 0) +let nan_char = Double.toChar(Infinity * 0) +let nan_int = Double.toInt(Infinity * 0) +let nan_float = Double.toFloat(Infinity * 0) +let nan_double = Double.toDouble(Infinity * 0) +let nan_byte2 = Double.toByte(Infinity * 0) assertEQ(nan_byte, 0) assertEQ(nan_int, 0) @@ -34,53 +34,53 @@ assertTrue(isNaN(nan_float)) assertTrue(isNaN(nan_double)) assertEQ(nan_byte2, 0) -let b1 = Infinity as byte // converted at compile time, as 'Infinity' is constant +let b1 = Double.toByte(Infinity) // converted at compile time, as 'Infinity' is constant let b2: double = Infinity -let b3 = b2 as byte // converted in runtime, as b2 isn't constant +let b3 = Double.toByte(b2) // converted in runtime, as b2 isn't constant assertEQ(b1, -1) assertEQ(b3, -1) -let l1 = Infinity as long +let l1 = Double.toLong(Infinity) let l2: double = Infinity -let l3 = l2 as long -let l4 = -Infinity as long +let l3 = Double.toLong(l2) +let l4 = Double.toLong(-Infinity) assertEQ(l1, 9223372036854775807) assertEQ(l3, 9223372036854775807) assertEQ(l4, -9223372036854775808) -let i1 = Infinity as int +let i1 = Double.toInt(Infinity) let i2: double = Infinity -let i3 = i2 as int -let i4 = -Infinity as int +let i3 = Double.toInt(i2) +let i4 = Double.toInt(-Infinity) assertEQ(i1, 2147483647) assertEQ(i3, 2147483647) assertEQ(i4, -2147483648) -let s1 = Infinity as short +let s1 = Double.toShort(Infinity) let s2: double = Infinity -let s3 = s2 as short -let s4 = -Infinity as short +let s3 = Double.toShort(s2) +let s4 = Double.toShort(-Infinity) assertEQ(s1, -1) assertEQ(s3, -1) assertEQ(s4, 0) -let c1 = Infinity as char +let c1 = Double.toChar(Infinity) let c2: double = Infinity -let c3 = c2 as char -let c4 = -Infinity as char +let c3 = Double.toChar(c2) +let c4 = Double.toChar(-Infinity) assertEQ(c1, 65535) assertEQ(c3, 65535) assertEQ(c4, 0) -let f1 = Infinity as float +let f1 = Double.toFloat(Infinity) let f2: double = Infinity -let f3 = f2 as float -let f4 = -Infinity as float +let f3 = Double.toFloat(f2) +let f4 = Double.toFloat(-Infinity) assertEQ(f1, Infinity) assertEQ(f3, Infinity) diff --git a/ets2panda/test/runtime/ets/enum_as_expression_cast.ets b/ets2panda/test/runtime/ets/enum_as_expression_cast.ets index 6ae7f5e5cef09d389ffacd18d2f6a06af4816ffa..252dab20655ca874bd4faad9067d0db6213a440a 100644 --- a/ets2panda/test/runtime/ets/enum_as_expression_cast.ets +++ b/ets2panda/test/runtime/ets/enum_as_expression_cast.ets @@ -22,7 +22,7 @@ function main() { assertEQ(E.A.toString(), "100") // E.A.toString() assertEQ(E.A as int, 100) // cast(E.A) to int, E.A is a index assertEQ(E.B.toString(), "200") // E.B.toString() - assertEQ(E.B as number, 200) // cast(E.B) to number, E.B is a index + assertEQ(Int.toDouble(E.B), 200) // cast(E.B) to number, E.B is a index assertEQ(E.A.valueOf() as int, 100) // get value of E.A - assertEQ(E.B.valueOf() as number, 200) // get value of E.B + assertEQ(Int.toDouble(E.B.valueOf()), 200) // get value of E.B } \ No newline at end of file diff --git a/ets2panda/test/runtime/ets/explicit_cast_boxed_expressions.ets b/ets2panda/test/runtime/ets/explicit_cast_boxed_expressions.ets index 45197e365f80ad1988b6fc601eff33d772cf3e6a..3a8115afd14f56e4b54424d27e0b76e15158a683 100644 --- a/ets2panda/test/runtime/ets/explicit_cast_boxed_expressions.ets +++ b/ets2panda/test/runtime/ets/explicit_cast_boxed_expressions.ets @@ -25,12 +25,12 @@ let testLongValue: Long = 9223372036854775807; function byte_test(): boolean { let Byte_: Byte = new Byte(42 as byte); // ? - let byte_short = Byte_ as Short; // ? - let byte_int = Byte_ as Int; // ? - let byte_long = Byte_ as Long; // ok - let byte_float = Byte_ as Float; // ok - let byte_double = Byte_ as Double; // ok - let byte_char = Byte_ as Char; // ok + let byte_short = Byte.toShort(Byte_); // ? + let byte_int = Byte.toInt(Byte_); // ? + let byte_long = Byte.toLong(Byte_); // ok + let byte_float = Byte.toFloat(Byte_); // ok + let byte_double = Byte.toDouble(Byte_); // ok + let byte_char = Byte.toChar(Byte_); // ok // true test Type speciefic operations { @@ -57,13 +57,13 @@ function short_test(): boolean { let Short_: Short = new Short(42 as short); - let short_byte = Short_ as Byte; - let short_short = Short_ as Short; - let short_char = Short_ as Char; - let short_int = Short_ as Int; - let short_long = Short_ as Long; - let short_float = Short_ as Float; - let short_double = Short_ as Double; + let short_byte = Short.toByte(Short_); + let short_short = Short.toShort(Short_); + let short_char = Short.toChar(Short_); + let short_int = Short.toInt(Short_); + let short_long = Short.toLong(Short_); + let short_float = Short.toFloat(Short_); + let short_double = Short.toDouble(Short_); // true test Type speciefic operations @@ -90,13 +90,13 @@ function short_test(): boolean { function char_test(): boolean { let Char_: Char = new Char(42 as char); - let char_byte = Char_ as Byte; - let char_short = Char_ as Short; - let char_char = Char_ as Char; - let char_int = Char_ as Int; - let char_long = Char_ as Long; - let char_float = Char_ as Float; - let char_double = Char_ as Double; + let char_byte = Char.toByte(Char_); + let char_short = Char.toShort(Char_); + let char_char = Char.toChar(Char_); + let char_int = Char.toInt(Char_); + let char_long = Char.toLong(Char_); + let char_float = Char.toFloat(Char_); + let char_double = Char.toDouble(Char_); // true test Type speciefic operations { @@ -123,13 +123,13 @@ function int_test(): boolean { let Int_: Int = new Int(42 as int); - let int_byte = Int_ as Byte; - let int_short = Int_ as Short; - let int_char = Int_ as Char; - let int_int = Int_ as Int; - let int_long = Int_ as Long; - let int_float = Int_ as Float; - let int_double = Int_ as Double; + let int_byte = Int.toByte(Int_); + let int_short = Int.toShort(Int_); + let int_char = Int.toChar(Int_); + let int_int = Int.toInt(Int_); + let int_long = Int.toLong(Int_); + let int_float = Int.toFloat(Int_); + let int_double = Int.toDouble(Int_); // true test Type speciefic operations { @@ -155,13 +155,13 @@ function int_test(): boolean { function long_test(): boolean { let Long_: Long = new Long(42 as long); - let long_byte = Long_ as Byte; - let long_short = Long_ as Short; - let long_char = Long_ as Char; - let long_int = Long_ as Int; - let long_long = Long_ as Long; - let long_float = Long_ as Float; - let long_double = Long_ as Double; + let long_byte = Long.toByte(Long_); + let long_short = Long.toShort(Long_); + let long_char = Long.toChar(Long_); + let long_int = Long.toInt(Long_); + let long_long = Long.toLong(Long_); + let long_float = Long.toFloat(Long_); + let long_double = Long.toDouble(Long_); // true test Type speciefic operations { @@ -187,13 +187,13 @@ function long_test(): boolean { function float_test(): boolean { let Float_: Float = new Float(42 as float); - let float_byte = Float_ as Byte; - let float_short = Float_ as Short; - let float_char = Float_ as Char; - let float_int = Float_ as Int; - let float_long = Float_ as Long; - let float_float = Float_ as Float; - let float_double = Float_ as Double; + let float_byte = Float.toByte(Float_); + let float_short = Float.toShort(Float_); + let float_char = Float.toChar(Float_); + let float_int = Float.toInt(Float_); + let float_long = Float.toLong(Float_); + let float_float = Float.toFloat(Float_); + let float_double = Float.toDouble(Float_); // true test Type speciefic operations { if (float_double.toExponential() != testDouble.toExponential()) { @@ -218,13 +218,13 @@ function float_test(): boolean { function double_test(): boolean { let Double_: Double = new Double(42 as double); - let double_byte = Double_ as Byte; - let double_short = Double_ as Short; - let double_char = Double_ as Char; - let double_int = Double_ as Int; - let double_long = Double_ as Long; - let double_float = Double_ as Float; - let double_double = Double_ as Double; + let double_byte = Double.toByte(Double_); + let double_short = Double.toShort(Double_); + let double_char = Double.toChar(Double_); + let double_int = Double.toInt(Double_); + let double_long = Double.toLong(Double_); + let double_float = Double.toFloat(Double_); + let double_double = Double.toDouble(Double_); // true test Type speciefic operations { if (double_double.toExponential() != testDouble.toExponential()) { diff --git a/ets2panda/test/runtime/ets/local-class-capture-boxing.ets b/ets2panda/test/runtime/ets/local-class-capture-boxing.ets index 17712173f8ec78e6eeb6af0d32866e43bc57cb6c..a3ebeedea6082408a396fc7b247e33e7203d89a2 100644 --- a/ets2panda/test/runtime/ets/local-class-capture-boxing.ets +++ b/ets2panda/test/runtime/ets/local-class-capture-boxing.ets @@ -147,7 +147,7 @@ class GlobalClass l_short = 103; l_int = 104; l_long = 105; - l_float = 106.0; + l_float = Double.toFloat(106.0); l_double = 107.0; l_boolean = true; l_char = c'y'; diff --git a/ets2panda/test/runtime/ets/looseReferenceEquality.ets b/ets2panda/test/runtime/ets/looseReferenceEquality.ets index baa9079342ad7edaf1254df3ea179cd0faacffcd..e5f1698008fbc60d916db5f1dafeb590fc16bb69 100644 --- a/ets2panda/test/runtime/ets/looseReferenceEquality.ets +++ b/ets2panda/test/runtime/ets/looseReferenceEquality.ets @@ -39,9 +39,9 @@ function test_numerics() { // NOTE(vpukhov): the same is applied to float? // NOTE(vpukhov): char == int overlow? function test_numeric_precision() { - const maxsafe = Double.MAX_SAFE_INTEGER as long + const maxsafe = Double.toLong(Double.MAX_SAFE_INTEGER) assertTrue(!eq(maxsafe * 4 + 1, maxsafe * 4)) - assertTrue(eq(maxsafe * 4 + 1, (maxsafe * 4) as double)) + assertTrue(eq(maxsafe * 4 + 1, Long.toDouble(maxsafe * 4))) } function main() { diff --git a/ets2panda/test/runtime/ets/non-const-capture.ets b/ets2panda/test/runtime/ets/non-const-capture.ets index c9cc5905de8aab7e86dddd513b48b232e524abf6..f2eacbf0e466c58b165b8eeb19cde025accc550e 100644 --- a/ets2panda/test/runtime/ets/non-const-capture.ets +++ b/ets2panda/test/runtime/ets/non-const-capture.ets @@ -59,7 +59,7 @@ function part1() { function part2() { let l: long = 0; - let f: float = 0.0; + let f: float = Double.toFloat(0.0); let d: double = 0.0; let o = new C(0); let lam: () => void = () => { @@ -68,12 +68,12 @@ function part2() { assertEQ(d, 11.0) assertEQ(o.v, 12) l = 13; - f = 14.0; + f = Double.toFloat(14.0); d = 15.0; o = new C(16); } l = 9; - f = 10.0; + f = Double.toFloat(10.0); d = 11.0; o = new C(12); lam(); diff --git a/ets2panda/test/runtime/ets/precedence.ets b/ets2panda/test/runtime/ets/precedence.ets index 0c3fb4064ec9dd06d15a8e70df2140016a899e2c..148c7997755973c20b8c587999a5a3858d61bd41 100644 --- a/ets2panda/test/runtime/ets/precedence.ets +++ b/ets2panda/test/runtime/ets/precedence.ets @@ -20,8 +20,8 @@ function main() : void { function testAsAndDiv() : void { let i : int = 1 let f : float - f = i as float / 2 + f = Int.toFloat(i) / 2 assertEQ(f, 0.5) - f = i / 2 as float + f = Int.toFloat(i / 2) assertEQ(f, 0.0) } diff --git a/ets2panda/test/runtime/ets/readonly_parameter_test_2.ets b/ets2panda/test/runtime/ets/readonly_parameter_test_2.ets index bec85a4d1f230709b8013f44cdb8f1c1635a36de..17bd9ff9840c9c53c4560991606cd8a4b7cd87d8 100644 --- a/ets2panda/test/runtime/ets/readonly_parameter_test_2.ets +++ b/ets2panda/test/runtime/ets/readonly_parameter_test_2.ets @@ -44,7 +44,7 @@ function foo4 (x: readonly [int, string], x2: [int, string]) { function main() : void { foo1([1, "ab", true], [1, 2]) let x2: readonly int[] = [] - let y2: readonly [string, float] = ["a", 0.1] + let y2: readonly [string, float] = ["a", Double.toFloat(0.1)] foo2(x2, y2) let x : readonly int[] = [] diff --git a/ets2panda/test/runtime/ets/readonly_parameter_test_3.ets b/ets2panda/test/runtime/ets/readonly_parameter_test_3.ets index 193ab00d4c7c45feb5780894481a634a91480d66..6fb60b165a62241d6ef52e17a50e17b0536fc271 100644 --- a/ets2panda/test/runtime/ets/readonly_parameter_test_3.ets +++ b/ets2panda/test/runtime/ets/readonly_parameter_test_3.ets @@ -46,7 +46,7 @@ function main() : void { foo1([1, "ab", true], [1, 2]) let x2: Readonly = [] - let y2: Readonly<[string, float]> = ["a", 0.1] + let y2: Readonly<[string, float]> = ["a", Double.toFloat(0.1)] foo2(x2, y2) let x : Readonly = [] diff --git a/ets2panda/test/runtime/ets/skippedTest.ets b/ets2panda/test/runtime/ets/skippedTest.ets index 2411180ddbe7c409c2409b48978508b82527f0ce..b611bb3cbcb0eb36b135ded2fa8820fa7a3bdc84 100644 --- a/ets2panda/test/runtime/ets/skippedTest.ets +++ b/ets2panda/test/runtime/ets/skippedTest.ets @@ -26,7 +26,7 @@ function main(): void { console.println(); console.print(str.charAt(2)); console.println(); - console.print(str.length as int); + console.print(Double.toInt(str.length)); console.println(); console.print(a.equals(b)); console.println(); diff --git a/ets2panda/test/runtime/ets/verifier_acc_type.ets b/ets2panda/test/runtime/ets/verifier_acc_type.ets index 27e3850725d7362aa80c423ec18a8fe5638cae4a..4133f9ef3aabe1013a4df8c3487e67d0da8719b7 100644 --- a/ets2panda/test/runtime/ets/verifier_acc_type.ets +++ b/ets2panda/test/runtime/ets/verifier_acc_type.ets @@ -23,7 +23,7 @@ class A { } } function foo(a: int, ...p: boolean[]): int { - return a + p.length as int + return Double.toInt(a + p.length) } function main() { diff --git a/ets2panda/test/runtime/ets/verifier_acc_type1.ets b/ets2panda/test/runtime/ets/verifier_acc_type1.ets index 9d08705bc8c684934359ce5b1b6f877a8ba9641f..cc3af85756a278011447c6de0b7f430e2529fcbc 100644 --- a/ets2panda/test/runtime/ets/verifier_acc_type1.ets +++ b/ets2panda/test/runtime/ets/verifier_acc_type1.ets @@ -31,7 +31,7 @@ class B extends A { } } function foo(a: int, ...p: boolean[]): int { - return a + p.length as int + return Double.toInt(a + p.length) } function main() { diff --git a/ets2panda/test/test-lists/astchecker/astchecker-ets-ignored.txt b/ets2panda/test/test-lists/astchecker/astchecker-ets-ignored.txt index aca6e7b95ff22549d1240b7a5e751e5017a8e92d..8b4d8d1d6b080cfb103df5fba6d8c4f34061f829 100644 --- a/ets2panda/test/test-lists/astchecker/astchecker-ets-ignored.txt +++ b/ets2panda/test/test-lists/astchecker/astchecker-ets-ignored.txt @@ -121,22 +121,13 @@ ast/parser/ets/InvalidExpressions1.ets ast/parser/ets/MultipleParserErrors.ets ast/parser/ets/SmartCast_1.ets ast/parser/ets/SmartCast_2.ets -ast/parser/ets/array_new_failed.ets ast/parser/ets/constFloatInSwitch.ets ast/parser/ets/enum28.ets ast/parser/ets/enum29.ets ast/parser/ets/enum30.ets ast/parser/ets/enum31.ets -ast/parser/ets/enum7.ets ast/parser/ets/for_of_04.ets ast/parser/ets/function_implicit_return_type7.ets -ast/parser/ets/import_tests/import_name_conflicts/main_2.ets -ast/parser/ets/import_tests/import_name_conflicts/main_3.ets -ast/parser/ets/import_tests/import_name_conflicts/main_4.ets -ast/parser/ets/import_tests/import_name_conflicts/main_5.ets -ast/parser/ets/import_tests/import_name_conflicts/main_6.ets -ast/parser/ets/import_tests/import_name_conflicts/main_7.ets -ast/parser/ets/import_tests/import_name_conflicts/main_8.ets ast/parser/ets/import_tests/import_type_error_in_class.ets ast/parser/ets/import_tests/import_type_error_top_level.ets ast/parser/ets/index_not_support_such_type.ets @@ -149,10 +140,8 @@ ast/parser/ets/keyof_parameter.ets ast/parser/ets/lambda_infer_type_neg_1.ets ast/parser/ets/lambda_omit_parentheses_parameter_neg_3.ets ast/parser/ets/multi_typeerror_function_implicit_return_value.ets -ast/parser/ets/n_arrayHoldingNullValue.ets ast/parser/ets/new_object_1.ets ast/parser/ets/new_object_2.ets -ast/parser/ets/nonIntegralIndex.ets ast/parser/ets/non_proper_index_method.ets ast/parser/ets/overrideFuncWithGetter_n.ets ast/parser/ets/override_method.ets @@ -187,7 +176,6 @@ ast/parser/ets/unexpected_token_35.ets ast/parser/ets/unexpected_token_36.ets ast/parser/ets/unexpected_token_41.ets ast/parser/ets/unexpected_token_42.ets -ast/parser/ets/unexpected_token_47.ets ast/parser/ets/unexpected_token_53.ets ast/parser/ets/unexpected_token_55.ets ast/parser/ets/unexpected_token_61.ets @@ -199,3 +187,40 @@ ast/parser/ets/wrong_context_function_2.ets ast/parser/ets/FixedArray/ets_never_type_without_affect_other.ets ast/parser/ets/ets_never_type_without_affect_other.ets ast/parser/ets/non_constant_expression.ets + + +# No-primitives #25023 [start] +ast/compiler/ets/enum-argument-private-method-call.ets +ast/parser/ets/FixedArray/illegal_union_member_exp.ets +ast/parser/ets/illegal_union_member_exp.ets +ast/compiler/ets/same_assembly_overload/callExpr_pos.ets +ast/compiler/ets/func_as_param.ets +ast/compiler/ets/assertInTopLevelStatement.ets + +# New error: annotations: expected a constant literal +ast/parser/ets/annotations_tests/annotationDecl_bad_initializer03.ets +ast/parser/ets/annotations_tests/annotationDecl_bad_initializer04.ets +ast/parser/ets/annotations_tests/annotationDecl_bad_initializer05.ets +ast/compiler/ets/annotation_tests/annotation_as_negative_case.ets + +# Invalid position (0:0) not printed +ast/compiler/ets/union_string_literals_4.ets +ast/compiler/ets/MultiPropertyWithSameName.ets +ast/compiler/ets/objectLiteralInterface3.ets + +# Call to `log` is ambiguous as `2` versions of `log` are available +ast/compiler/ets/import_tests/import_distant_package/master_file.ets + +# Call to ... is ambiguous +ast/compiler/ets/FixedArray/most_specific_method_with_empty_rest_param.ets +ast/compiler/ets/annotation_tests/annotation_src.ets + +# Enum: Array element at index 0 with type '"1"' is not compatible with the target array element type 'Color' +ast/compiler/ets/FixedArray/annotation_tests/annotation_src.ets + +# ABORT_FAIL +ast/compiler/ets/optionalClassProperty1.ets +ast/parser/ets/for_of_02.ets +ast/parser/ets/for_of_loop_variable.ets + +# No-primitives #25023 [end] diff --git a/ets2panda/test/test-lists/ets-runtime/ets-runtime-ignored.txt b/ets2panda/test/test-lists/ets-runtime/ets-runtime-ignored.txt index a36afab8f5e421e0f62cc1a0393a1f3fb0dc63ab..e9022bb77bdf7ed15d085c3bbaf0b0cbefdd33f3 100644 --- a/ets2panda/test/test-lists/ets-runtime/ets-runtime-ignored.txt +++ b/ets2panda/test/test-lists/ets-runtime/ets-runtime-ignored.txt @@ -109,14 +109,8 @@ nullishTypeCodesamples.ets instanceof.ets # Rebase no-primitives pathch onto master with merger Array refactoring -AnnotationConstExpression.ets -annotation_tests/AnnotationForClass.ets annotation_tests/AnnotationForLambdaExpression.ets -annotation_tests/AnnotationNoNeedToSetProperties03.ets -annotation_tests/AnnotationsFieldType03.ets -annotation_tests/AnnotationsFieldType04.ets annotation_tests/EmitAnnotationToBytecode.ets -annotation_tests/annotationUsageSingleFileds05.ets namespace_tests/namespace_with_annotations.ets lambda_with_rest_param_resizablearray.ets type_from_primitive_type.ets @@ -124,10 +118,35 @@ lambda_with_rest_param_fixedarray.ets lambda_with_restparameter_object_fixedarray.ets lambda_with_restparameter_predefinedtypes_fixedarray.ets annotation_tests/AnnotationForTypesInAnnotation.ets -annotation_tests/annotationUsageSingleFileds06.ets annotation_tests/annotationUsageSingleFileds07.ets -enum-relational-operators.ets -local-enum-relational-operators.ets rest_object_literal.ets union_generic_class.ets stringliteral_to_char.ets + +# No-primitives #25023 [start] +enum_as_key_of_record.ets +enum-initialize-with-itself.ets + +# Call to ... is ambiguous +mostSpecificMethod.ets +skippedTest.ets + +# New failures at #FailKind.VERIFIER_FAIL - 5 tests: +classGetterSetter.ets +getterSetterImplementationWithConstructor.ets +interfacePropertyTypeAnnotationWithParameter.ets +interface_prop.ets +multisource_inheritance-2.ets + +# New failures at #FailKind.ABORT_FAIL - 4 tests: +NullishCoalescing_01.ets +inherited_getter_setter_implementation_1.ets +inherited_getter_setter_implementation_2.ets +multisource_inheritance.ets + +# New failures at #FailKind.RUNTIME_FAIL - 2 tests: +23258.ets +GenericBridges_03.ets +conversionFromInfinity.ets + +# No-primitives #25023 [end] diff --git a/ets2panda/test/test-lists/parser/parser-ets-ignored.txt b/ets2panda/test/test-lists/parser/parser-ets-ignored.txt index 9a38c3a7f2b589e4d2ed365dc2991d5611c5ed51..f47860a3c928f90d4aaa2bc5db43c8928c945565 100644 --- a/ets2panda/test/test-lists/parser/parser-ets-ignored.txt +++ b/ets2panda/test/test-lists/parser/parser-ets-ignored.txt @@ -24,9 +24,6 @@ parser/ts/test_generic.ts compiler/ts/functionCall.ts #24986 -compiler/ets/dynamicLambdaJSValue.ets -parser/ets/switch2.ets -parser/ets/switch_char_compare_num.ets ark_tests/parser/js/expressions/binary/test-binary-expression.js ark_tests/parser/js/expressions/binary/test-logical-expression.js ark_tests/parser/js/expressions/binary/test-nullish-coalescing.js @@ -38,5 +35,14 @@ parser/js/test-conditional-expression.js parser/js/test-grouping-level.js parser/js/test-logical-expression.js parser/js/test-nullish-coalescing.js -compiler/ets/dynamic_instanceof_error.ets parser/ets/tuple_type_1.ets + +# No-primitives #25023 [start] + +# Assertion failed: tsAsExpression.cpp:80... +parser/ets/test_jsvalue_get_double.ets + +# Expected CTE "Cannot infer type" +parser/ets/lambda-type-inference-overloaded.ets + +# No-primitives #25023 [end] diff --git a/ets2panda/util/diagnostic/syntax.yaml b/ets2panda/util/diagnostic/syntax.yaml index 76cf99ce6526146098b5ebcca034a251caa28805..7850e3f9e28a4a72ea6ccf4c8c12f34a20ce633d 100644 --- a/ets2panda/util/diagnostic/syntax.yaml +++ b/ets2panda/util/diagnostic/syntax.yaml @@ -1102,7 +1102,7 @@ syntax: - name: DIVISION_BY_ZERO id: 273 - message: "Division by zero are not allowed." + message: "Division by zero is not allowed." - name: UNSUPPORTED_OPERATOR_FOR_STRING id: 274