diff --git a/ets2panda/test/compiler/ets/conversion-w-ASExpr-expected.txt b/ets2panda/test/compiler/ets/conversion-w-ASExpr-expected.txt index e77bd7128750c71b08404a0018d74de762fc921e..be4ca35299ea206fe43be909e6222fae31d8fe68 100644 --- a/ets2panda/test/compiler/ets/conversion-w-ASExpr-expected.txt +++ b/ets2panda/test/compiler/ets/conversion-w-ASExpr-expected.txt @@ -982,38 +982,8 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "NumberLiteral", - "value": 4, - "loc": { - "start": { - "line": 22, - "column": 23, - "program": "conversion-w-ASExpr.ets" - }, - "end": { - "line": 22, - "column": 26, - "program": "conversion-w-ASExpr.ets" - } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 22, - "column": 30, - "program": "conversion-w-ASExpr.ets" - }, - "end": { - "line": 22, - "column": 35, - "program": "conversion-w-ASExpr.ets" - } - } - }, + "type": "NumberLiteral", + "value": 4, "loc": { "start": { "line": 22, @@ -1022,7 +992,7 @@ }, "end": { "line": 22, - "column": 26, + "column": 27, "program": "conversion-w-ASExpr.ets" } } @@ -1035,7 +1005,7 @@ }, "end": { "line": 22, - "column": 26, + "column": 27, "program": "conversion-w-ASExpr.ets" } } @@ -1050,7 +1020,7 @@ }, "end": { "line": 22, - "column": 36, + "column": 28, "program": "conversion-w-ASExpr.ets" } } @@ -1554,38 +1524,59 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 28, - "column": 29, - "program": "conversion-w-ASExpr.ets" - }, - "end": { - "line": 28, - "column": 32, - "program": "conversion-w-ASExpr.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "NumberLiteral", + "value": 1, + "loc": { + "start": { + "line": 28, + "column": 29, + "program": "conversion-w-ASExpr.ets" + }, + "end": { + "line": 28, + "column": 34, + "program": "conversion-w-ASExpr.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toShort", + "decorators": [], + "loc": { + "start": { + "line": 28, + "column": 35, + "program": "conversion-w-ASExpr.ets" + }, + "end": { + "line": 28, + "column": 42, + "program": "conversion-w-ASExpr.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 28, - "column": 36, + "column": 29, "program": "conversion-w-ASExpr.ets" }, "end": { "line": 28, - "column": 41, + "column": 42, "program": "conversion-w-ASExpr.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 28, @@ -1594,7 +1585,7 @@ }, "end": { "line": 28, - "column": 32, + "column": 44, "program": "conversion-w-ASExpr.ets" } } @@ -1607,7 +1598,7 @@ }, "end": { "line": 28, - "column": 32, + "column": 44, "program": "conversion-w-ASExpr.ets" } } @@ -1622,7 +1613,7 @@ }, "end": { "line": 28, - "column": 42, + "column": 45, "program": "conversion-w-ASExpr.ets" } } @@ -1697,38 +1688,59 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 29, - "column": 28, - "program": "conversion-w-ASExpr.ets" - }, - "end": { - "line": 29, - "column": 31, - "program": "conversion-w-ASExpr.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "NumberLiteral", + "value": 2, + "loc": { + "start": { + "line": 29, + "column": 28, + "program": "conversion-w-ASExpr.ets" + }, + "end": { + "line": 29, + "column": 33, + "program": "conversion-w-ASExpr.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toInt", + "decorators": [], + "loc": { + "start": { + "line": 29, + "column": 34, + "program": "conversion-w-ASExpr.ets" + }, + "end": { + "line": 29, + "column": 39, + "program": "conversion-w-ASExpr.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 29, - "column": 35, + "column": 28, "program": "conversion-w-ASExpr.ets" }, "end": { "line": 29, - "column": 38, + "column": 39, "program": "conversion-w-ASExpr.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 29, @@ -1737,7 +1749,7 @@ }, "end": { "line": 29, - "column": 31, + "column": 41, "program": "conversion-w-ASExpr.ets" } } @@ -1750,7 +1762,7 @@ }, "end": { "line": 29, - "column": 31, + "column": 41, "program": "conversion-w-ASExpr.ets" } } @@ -1765,7 +1777,7 @@ }, "end": { "line": 29, - "column": 39, + "column": 42, "program": "conversion-w-ASExpr.ets" } } @@ -1840,38 +1852,59 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "NumberLiteral", - "value": 3, - "loc": { - "start": { - "line": 30, - "column": 25, - "program": "conversion-w-ASExpr.ets" - }, - "end": { - "line": 30, - "column": 28, - "program": "conversion-w-ASExpr.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "NumberLiteral", + "value": 3, + "loc": { + "start": { + "line": 30, + "column": 25, + "program": "conversion-w-ASExpr.ets" + }, + "end": { + "line": 30, + "column": 30, + "program": "conversion-w-ASExpr.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toLong", + "decorators": [], + "loc": { + "start": { + "line": 30, + "column": 31, + "program": "conversion-w-ASExpr.ets" + }, + "end": { + "line": 30, + "column": 37, + "program": "conversion-w-ASExpr.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 30, - "column": 32, + "column": 25, "program": "conversion-w-ASExpr.ets" }, "end": { "line": 30, - "column": 36, + "column": 37, "program": "conversion-w-ASExpr.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 30, @@ -1880,7 +1913,7 @@ }, "end": { "line": 30, - "column": 28, + "column": 39, "program": "conversion-w-ASExpr.ets" } } @@ -1893,7 +1926,7 @@ }, "end": { "line": 30, - "column": 28, + "column": 39, "program": "conversion-w-ASExpr.ets" } } @@ -1908,7 +1941,7 @@ }, "end": { "line": 30, - "column": 37, + "column": 40, "program": "conversion-w-ASExpr.ets" } } @@ -1983,38 +2016,59 @@ } }, "init": { - "type": "TSAsExpression", - "expression": { - "type": "NumberLiteral", - "value": 65, - "loc": { - "start": { - "line": 31, - "column": 28, - "program": "conversion-w-ASExpr.ets" - }, - "end": { - "line": 31, - "column": 32, - "program": "conversion-w-ASExpr.ets" + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "NumberLiteral", + "value": 65, + "loc": { + "start": { + "line": 31, + "column": 28, + "program": "conversion-w-ASExpr.ets" + }, + "end": { + "line": 31, + "column": 34, + "program": "conversion-w-ASExpr.ets" + } } - } - }, - "typeAnnotation": { - "type": "ETSPrimitiveType", + }, + "property": { + "type": "Identifier", + "name": "toChar", + "decorators": [], + "loc": { + "start": { + "line": 31, + "column": 35, + "program": "conversion-w-ASExpr.ets" + }, + "end": { + "line": 31, + "column": 41, + "program": "conversion-w-ASExpr.ets" + } + } + }, + "computed": false, + "optional": false, "loc": { "start": { "line": 31, - "column": 36, + "column": 28, "program": "conversion-w-ASExpr.ets" }, "end": { "line": 31, - "column": 40, + "column": 41, "program": "conversion-w-ASExpr.ets" } } }, + "arguments": [], + "optional": false, "loc": { "start": { "line": 31, @@ -2023,7 +2077,7 @@ }, "end": { "line": 31, - "column": 32, + "column": 43, "program": "conversion-w-ASExpr.ets" } } @@ -2036,7 +2090,7 @@ }, "end": { "line": 31, - "column": 32, + "column": 43, "program": "conversion-w-ASExpr.ets" } } @@ -2051,7 +2105,7 @@ }, "end": { "line": 31, - "column": 41, + "column": 44, "program": "conversion-w-ASExpr.ets" } } diff --git a/ets2panda/test/compiler/ets/conversion-w-ASExpr.ets b/ets2panda/test/compiler/ets/conversion-w-ASExpr.ets index bdcb43e93168124dfd67ace91b22a99249e9fad8..2d7b0a7313ea11578b9be977e1b919c9871ef089 100644 --- a/ets2panda/test/compiler/ets/conversion-w-ASExpr.ets +++ b/ets2panda/test/compiler/ets/conversion-w-ASExpr.ets @@ -19,16 +19,16 @@ function main(): void { let cherry : Int = 2 as int; let date : Long = 3 as long; let elderberry : Float = 4 as float; - let fig : Float = 4.0 as float; + let fig : Float = 4.0f; let grape : Double = 5 as double; let honeydewmelon : Double = 5.0 as double; let indian_fig : Char = 65 as char; - let raspberry : Short = 1.0 as short; - let strawberry : Int = 2.0 as int; - let tomato : Long = 3.0 as long; - let uglifruit : Char = 65.0 as char; + let raspberry : Short = (1.0).toShort(); + let strawberry : Int = (2.0).toInt(); + let tomato : Long = (3.0).toLong(); + let uglifruit : Char = (65.0).toChar(); return; } 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 d0643f53ed218e4124ecef10e10bc2a2a4ebcd7f..8e6ce2b5034e9d57e6683c40897cec4e4b7843ee 100644 --- a/ets2panda/test/test-lists/ets-runtime/ets-runtime-ignored.txt +++ b/ets2panda/test/test-lists/ets-runtime/ets-runtime-ignored.txt @@ -114,45 +114,22 @@ type_from_primitive_type.ets lambda_with_rest_param_fixedarray.ets lambda_with_restparameter_object_fixedarray.ets lambda_with_restparameter_predefinedtypes_fixedarray.ets -rest_object_literal.ets union_generic_class.ets stringliteral_to_char.ets # No-primitives #24986 [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 -boxingConversions3.ets -char-type.ets -looseReferenceEquality.ets -non-const-capture.ets # runtime rimeout -AccessFannkuch.ets -AccessNSieve.ets -BitopsBitsInByte.ets -BitopsNSieveBits.ets # New failures at #FailKind.ES2PANDA_FAIL const_variable_in_switch_statement/code_point_at.ets @@ -161,7 +138,12 @@ const_variable_in_switch_statement/code_point_at.ets inferTypeLambda_14.ets ArrayLiteral.ets -Enum2.ets -string_from_nullish.ets - -# No-primitives #24986 [end] +EnumConstExpression1.ets +annotation_tests/annotationConstAs.ets +constant_boolean.ets +constant_char_asexpression.ets +enum_const_variable.ets +enumConstExpression.ets +local_enum03.ets + +# No-primitives #24986 [end] \ No newline at end of file