diff --git a/src/awst/node-factory.ts b/src/awst/node-factory.ts index 036b8747..200b6393 100644 --- a/src/awst/node-factory.ts +++ b/src/awst/node-factory.ts @@ -252,13 +252,6 @@ const explicitNodeFactory = { sourceLocation, }) } - if (expr instanceof IntegerConstant) { - return new IntegerConstant({ - ...expr, - wtype, - sourceLocation, - }) - } return new ReinterpretCast({ expr, diff --git a/tests/approvals/out/byte-expressions.awst b/tests/approvals/out/byte-expressions.awst index b440d55c..b305d34f 100644 --- a/tests/approvals/out/byte-expressions.awst +++ b/tests/approvals/out/byte-expressions.awst @@ -3,7 +3,7 @@ subroutine test(a: uint64, b: biguint, c: string): void assert(len(0x) == 0) assert(itob(a) == itob(a)) assert(0x01 == 0x0000000000000001) - assert(256 == 0x0100) + assert(reinterpret_cast(256) == 0x0100) assert(reinterpret_cast(reinterpret_cast(b)) == b) assert(reinterpret_cast(reinterpret_cast(c)) == c) assert("123" == "123") diff --git a/tests/approvals/out/byte-expressions.awst.json b/tests/approvals/out/byte-expressions.awst.json index a591fe37..99703c9a 100644 --- a/tests/approvals/out/byte-expressions.awst.json +++ b/tests/approvals/out/byte-expressions.awst.json @@ -454,7 +454,7 @@ "scalar_type": 2 }, "lhs": { - "_type": "IntegerConstant", + "_type": "ReinterpretCast", "source_location": { "file": "tests/approvals/byte-expressions.algo.ts", "line": 8, @@ -469,8 +469,25 @@ "ephemeral": false, "scalar_type": 1 }, - "value": "256", - "teal_alias": null + "expr": { + "_type": "IntegerConstant", + "source_location": { + "file": "tests/approvals/byte-expressions.algo.ts", + "line": 8, + "end_line": 8, + "column": 15, + "end_column": 27 + }, + "wtype": { + "_type": "WType", + "name": "biguint", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "value": "256", + "teal_alias": null + } }, "operator": "==", "rhs": {