From 76cb8f6ed7fca3d4071a24451bcf2488e6170b3c Mon Sep 17 00:00:00 2001 From: Eric McCarthy Date: Sat, 21 Aug 2021 17:53:34 -0700 Subject: [PATCH 01/13] Update nonprinting.leo Change duplicate 'in32' to 'in33' --- tests/compiler/char/nonprinting.leo | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/compiler/char/nonprinting.leo b/tests/compiler/char/nonprinting.leo index 381d3e6cb4..2c91babb7c 100644 --- a/tests/compiler/char/nonprinting.leo +++ b/tests/compiler/char/nonprinting.leo @@ -37,7 +37,7 @@ function main( in30: char, in31: char, in32: char, - in32: char, + in33: char, ) -> ([char; 33], bool) { let str = [ in1, @@ -72,8 +72,8 @@ function main( in30, in31, in32, - in32, + in33, ]; console.log("{}", str); return (str, in1 == '\x00'); -} \ No newline at end of file +} From 26cbb3ffcf439e011dd5937f4c58ea30e9cc884d Mon Sep 17 00:00:00 2001 From: Eric McCarthy Date: Sat, 21 Aug 2021 22:08:46 -0700 Subject: [PATCH 02/13] Update circuit.leo Change the 2nd variable named `character` in scope to be `character2`. --- tests/compiler/char/circuit.leo | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/compiler/char/circuit.leo b/tests/compiler/char/circuit.leo index b3f7f3c7cd..ab40365545 100644 --- a/tests/compiler/char/circuit.leo +++ b/tests/compiler/char/circuit.leo @@ -26,6 +26,6 @@ circuit Foo { function main(character: char) -> char { let f = Foo { character }; - let character = f.character == 'a' ? 'a' : f.character; - return character; -} \ No newline at end of file + let character2 = f.character == 'a' ? 'a' : f.character; + return character2; +} From 2abc553d02c5f0124dda2ab4429a8e5984de9b3d Mon Sep 17 00:00:00 2001 From: Eric McCarthy Date: Mon, 23 Aug 2021 10:26:06 -0700 Subject: [PATCH 03/13] update ast checksum expectations --- tests/expectations/compiler/compiler/char/circuit.leo.out | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/expectations/compiler/compiler/char/circuit.leo.out b/tests/expectations/compiler/compiler/char/circuit.leo.out index 727dce531b..04bca65fa2 100644 --- a/tests/expectations/compiler/compiler/char/circuit.leo.out +++ b/tests/expectations/compiler/compiler/char/circuit.leo.out @@ -100,6 +100,6 @@ outputs: r: type: char value: "'\\u{1f62d}'" - initial_ast: aa3eb0c4de0eebada9490b11e35c36923316559727a3afce28fe3852a805354a - canonicalized_ast: aa3eb0c4de0eebada9490b11e35c36923316559727a3afce28fe3852a805354a - type_inferenced_ast: 73309200d30bf2831847477f3da7ede4ba9f4aa377e6ebf15c9c34774f53bcb5 + initial_ast: 304211ce3e3a21bc75ea5c869f3148df5f4a24a075b885c617080b907c479590 + canonicalized_ast: 304211ce3e3a21bc75ea5c869f3148df5f4a24a075b885c617080b907c479590 + type_inferenced_ast: 88dbe3f5b1d5ea9532ff5f18c9d707e84126baa99db9689b3d0cfe892e61ba62 From b516a8449db6ea59b316beb971775301a1341a33 Mon Sep 17 00:00:00 2001 From: Eric McCarthy Date: Mon, 23 Aug 2021 10:32:21 -0700 Subject: [PATCH 04/13] update ast checksum expectations --- .../expectations/compiler/compiler/char/nonprinting.leo.out | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/expectations/compiler/compiler/char/nonprinting.leo.out b/tests/expectations/compiler/compiler/char/nonprinting.leo.out index 3ab1b59a50..3a88ee8d8b 100644 --- a/tests/expectations/compiler/compiler/char/nonprinting.leo.out +++ b/tests/expectations/compiler/compiler/char/nonprinting.leo.out @@ -19,6 +19,6 @@ outputs: r1: type: bool value: "true" - initial_ast: b03b0ea8ad821952fa64e477900b43c830e9fbd9693478018ad4b13abd12b027 - canonicalized_ast: b03b0ea8ad821952fa64e477900b43c830e9fbd9693478018ad4b13abd12b027 - type_inferenced_ast: 4ded1909fcd3fa1edf7de8111d3f7b97fced37b5b2d18b316f9fee3aad246f5e + initial_ast: 4e9ef2d8121eabed385e2d358e2d9ed1dc64d88894c3dbfc078d5da34902ce4c + canonicalized_ast: 4e9ef2d8121eabed385e2d358e2d9ed1dc64d88894c3dbfc078d5da34902ce4c + type_inferenced_ast: 489e02b2ed42362bf493fe2fb58cf03ab06cfb95abd49b7ba0329a8e8d7c3daa From d8c89f257d5b26f3e851966dcd9c4fdd480c9bda Mon Sep 17 00:00:00 2001 From: Eric McCarthy Date: Mon, 23 Aug 2021 10:41:39 -0700 Subject: [PATCH 05/13] also update number of private variables and R1CS checksum expectations --- .../compiler/compiler/char/nonprinting.leo.out | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/expectations/compiler/compiler/char/nonprinting.leo.out b/tests/expectations/compiler/compiler/char/nonprinting.leo.out index 3a88ee8d8b..d38c31d75c 100644 --- a/tests/expectations/compiler/compiler/char/nonprinting.leo.out +++ b/tests/expectations/compiler/compiler/char/nonprinting.leo.out @@ -4,18 +4,18 @@ expectation: Pass outputs: - circuit: num_public_variables: 0 - num_private_variables: 35 + num_private_variables: 36 num_constraints: 3 - at: 27242eeb2faf33996c0329ac2ec3b337434f78d392ff29465d3508084de6c721 - bt: 4727127f178bb02895a615bf38a4aa3c5cb9d2b076eca15ebe6fea741b48ce98 - ct: cae904ba23a045f4438177f10211a50ae29eee49d08211c731aee88353dc0cfb + at: 25579220a31118007fe071d3083ad5a5503f7dc6bd4d51abf15f1a7778a99c86 + bt: 8f5bf097224289e45b78e01a711900a993240585fe13744f9ab71a9c5c4d9111 + ct: df019f90846f94966d481bfb6d579bee9c47d281176e210ccd973210afc957a1 output: - input_file: inputs/nonprinting.in output: registers: r0: type: "[char; 33]" - value: "\"\\u{0}\\u{1}\\u{2}\\u{3}\\u{4}\\u{5}\\u{6}\\u{7}\\u{8}\\t\\n\\u{b}\\u{c}\\r\\u{e}\\u{f}\\u{10}\\u{11}\\u{12}\\u{13}\\u{14}\\u{15}\\u{16}\\u{17}\\u{18}\\u{19}\\u{1a}\\u{1b}\\u{1c}\\u{1d}\\u{1e}\\u{1f}\\u{1f}\"" + value: "\"\\u{0}\\u{1}\\u{2}\\u{3}\\u{4}\\u{5}\\u{6}\\u{7}\\u{8}\\t\\n\\u{b}\\u{c}\\r\\u{e}\\u{f}\\u{10}\\u{11}\\u{12}\\u{13}\\u{14}\\u{15}\\u{16}\\u{17}\\u{18}\\u{19}\\u{1a}\\u{1b}\\u{1c}\\u{1d}\\u{1e}\\u{1f} \"" r1: type: bool value: "true" From b2cce0e14024727a0b75261787cce603c629fe6a Mon Sep 17 00:00:00 2001 From: Alessandro Coglio Date: Mon, 23 Aug 2021 14:25:15 -0700 Subject: [PATCH 06/13] [RFC] Avoid repeated word. --- docs/rfc/007-type-aliases.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/rfc/007-type-aliases.md b/docs/rfc/007-type-aliases.md index 4929e56a72..c4ed3c259a 100644 --- a/docs/rfc/007-type-aliases.md +++ b/docs/rfc/007-type-aliases.md @@ -28,7 +28,7 @@ Many programming languages provide the ability to create aliases (i.e. synonyms) The purpose may be to abbreviate a longer type, such as an alias `matrix` for `[i32; (3, 3)]` in an application in which 3x3 matrices of 32-bit integers are relevant (e.g. for 3-D rotations, even though fractional numbers may be more realistic). -The purpose may also be to clarify the purpose and use of an existing type, +The purpose may also be to clarify the intent and use of an existing type, such as an alias `balance` for `u64` in an application that keeps track of balances. The initial motivation that inspired this RFC (along with other RFCs) From 378599afbad2cacd0ce262b5a6d61067b5c566fe Mon Sep 17 00:00:00 2001 From: Alessandro Coglio Date: Mon, 23 Aug 2021 14:39:59 -0700 Subject: [PATCH 07/13] [RFC] Add more proposed mods to ABNF grammar. --- docs/rfc/007-type-aliases.md | 53 +++++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/docs/rfc/007-type-aliases.md b/docs/rfc/007-type-aliases.md index c4ed3c259a..38aa272287 100644 --- a/docs/rfc/007-type-aliases.md +++ b/docs/rfc/007-type-aliases.md @@ -42,7 +42,7 @@ With the array types of unspecified size proposed in RFC 006, ## Syntax The ABNF grammar changes as follows: -```ts +``` ; modified rule: keyword = ... / %s"true" @@ -59,12 +59,63 @@ declaration = import-declaration / circuit-declaration / constant-declaration / type-alias-declaration ; new + + ``` A type alias declaration introduces the identifier to stand for the type. Only top-level type alias declarations are supported; they are not supported inside functions or circuit types. +In addition, the following changes to the grammar are appropriate. + +First, the rule +``` +circuit-type = identifier / self-type ; replace with the one below +``` +should be replaced with the rule +``` +circuit-or-alias-type = identifier / self-type +``` +The reason is that, at parsing time, an identifier is not necessarily a circuit type; +it may be a type alias that may expand to a (circuit or non-circuit type). +Thus, the nomenclature `circuit-or-alias-type` is appropriate. +Consequently, references to `circuit-type` in the following rules must be replaced with `circuit-or-alias-type`: +``` +; modified rule: +circuit-construction = circuit-or-alias-type "{" ; modified + circuit-inline-element + *( "," circuit-inline-element ) [ "," ] + "}" + +; modified rule: +postfix-expression = primary-expression + / postfix-expression "." natural + / postfix-expression "." identifier + / identifier function-arguments + / postfix-expression "." identifier function-arguments + / circuit-or-alias-type "::" identifier function-arguments ; modified + / postfix-expression "[" expression "]" + / postfix-expression "[" [expression] ".." [expression] "]" +``` + +Second, the rule +``` +aggregate-type = tuple-type / array-type / circuit-type +``` +should be removed, because if we replaced `circuit-type` with `circuit-or-alias-type` there, +the identifier could be a type alias, not necessarily an aggregate type. +(The notion of aggregate type remains at a semantic level, but has no longer a place in the grammar.) +Consequently, the rule +``` +type = scalar-type / aggregate-type +``` +should be rephrased as +``` +type = scalar-type / tuple-type / array-type / circuit-or-alias-type +``` +which "inlines" the previous `aggregate-type` with `circuit-type` replaced with `circuit-or-alias-type`. + ## Semantics There must be no direct or indirect circularity in the type aliases. From 31786a9180a5612394ad9ba82b6fef22bcc4014b Mon Sep 17 00:00:00 2001 From: damirka Date: Tue, 24 Aug 2021 21:57:50 +0300 Subject: [PATCH 08/13] try acl2 version v0.1.1 --- .github/workflows/acl2.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/acl2.yml b/.github/workflows/acl2.yml index d9fc9c4af4..b28be4c842 100644 --- a/.github/workflows/acl2.yml +++ b/.github/workflows/acl2.yml @@ -37,7 +37,9 @@ jobs: - name: Pull tgc executable run: | mkdir acl2 && cd acl2; - wget $(curl -s https://api.github.com/repos/AleoHQ/leo-acl2-bin/releases/latest \ + # temporarily changing this line to v0.1.1 instead of latest + # wget $(curl -s https://api.github.com/repos/AleoHQ/leo-acl2-bin/releases/latest \ + wget $(curl -s https://api.github.com/repos/AleoHQ/leo-acl2-bin/releases/47557967 \ | grep "browser_download_url.*.tgz" \ | cut -d : -f 2,3 \ | tr -d \" \ From e0c2f6470f33f934a09ddf0bb9d5f6be919264cc Mon Sep 17 00:00:00 2001 From: damirka Date: Tue, 24 Aug 2021 22:09:32 +0300 Subject: [PATCH 09/13] Revert "try acl2 version v0.1.1" This reverts commit 31786a9180a5612394ad9ba82b6fef22bcc4014b. --- .github/workflows/acl2.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/acl2.yml b/.github/workflows/acl2.yml index b28be4c842..d9fc9c4af4 100644 --- a/.github/workflows/acl2.yml +++ b/.github/workflows/acl2.yml @@ -37,9 +37,7 @@ jobs: - name: Pull tgc executable run: | mkdir acl2 && cd acl2; - # temporarily changing this line to v0.1.1 instead of latest - # wget $(curl -s https://api.github.com/repos/AleoHQ/leo-acl2-bin/releases/latest \ - wget $(curl -s https://api.github.com/repos/AleoHQ/leo-acl2-bin/releases/47557967 \ + wget $(curl -s https://api.github.com/repos/AleoHQ/leo-acl2-bin/releases/latest \ | grep "browser_download_url.*.tgz" \ | cut -d : -f 2,3 \ | tr -d \" \ From dfa15b1a4fdb0a8d9f07358a5dfea37f854ada91 Mon Sep 17 00:00:00 2001 From: damirka Date: Tue, 24 Aug 2021 22:21:40 +0300 Subject: [PATCH 10/13] Squashed commit of the following: commit 7a5979660b7c4200fc3c8feb3263dbadd04daf0a Merge: 695a949c 88bd065d Author: Alessandro Coglio Date: Mon Aug 23 08:50:41 2021 -0700 Merge pull request #1272 from AleoHQ/feature/call-expressions-ast-store-type [Implmentation] Adds Type to Circuit Member Access Expressions commit 695a949cffee7b33f6a814debbb55c942d7a3c25 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon Aug 23 17:25:19 2021 +0300 Bump serde from 1.0.127 to 1.0.128 (#1288) Bumps [serde](https://github.com/serde-rs/serde) from 1.0.127 to 1.0.128. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.127...v1.0.128) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> commit fd3d7d0624c786e241b270847bbeb273f888b0c8 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon Aug 23 17:25:05 2021 +0300 Bump serde_yaml from 0.8.18 to 0.8.19 (#1289) Bumps [serde_yaml](https://github.com/dtolnay/serde-yaml) from 0.8.18 to 0.8.19. - [Release notes](https://github.com/dtolnay/serde-yaml/releases) - [Commits](https://github.com/dtolnay/serde-yaml/compare/0.8.18...0.8.19) --- updated-dependencies: - dependency-name: serde_yaml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> commit 84e972c9ad48e6f36bfa73268ee7ec425a985f6a Merge: d609bb28 fbc3dfb4 Author: Alessandro Coglio Date: Sat Aug 21 18:44:39 2021 -0700 Merge pull request #1267 from AleoHQ/bug/implicit-ternary-type-inference [Bugfix] Ternary Implicit and Explicit Unkown Type commit 88bd065d8a97c0be2cf4848d631cf5da69f3e7a1 Merge: 56c66fa4 235daa9e Author: gluaxspeed Date: Wed Aug 18 16:25:23 2021 -0700 merge master, regen tests commit fbc3dfb4c90aa289ebeffe79d74552aef3137826 Merge: 56996f98 235daa9e Author: gluaxspeed Date: Wed Aug 18 16:14:14 2021 -0700 merge master, regen tests commit 56c66fa4ba4ef8e031b80215617d9ba7a4085fc9 Author: gluaxspeed Date: Wed Aug 18 14:31:06 2021 -0700 testing and clean up commit a91c8b9e6ad5a19585f8343f98c37a4e265e8ea5 Author: gluaxspeed Date: Wed Aug 18 13:38:50 2021 -0700 Revert "type on call expression" This reverts commit cf5a23b38f4c76a1f7e3a4aec5ee52af11598ed6. commit cf5a23b38f4c76a1f7e3a4aec5ee52af11598ed6 Author: gluaxspeed Date: Wed Aug 18 02:04:41 2021 -0700 type on call expression commit 56996f989e7265121bb861faa81623ace4a71bd8 Author: gluaxspeed Date: Wed Aug 18 01:09:45 2021 -0700 fix ternary bug --- Cargo.lock | 14 ++++---- asg/src/expression/call.rs | 1 + asg/src/expression/circuit_access.rs | 1 + asg/src/expression/ternary.rs | 10 +++++- asg/src/statement/mod.rs | 2 +- ast/src/expression/circuit_member_access.rs | 1 + ast/src/reducer/canonicalization.rs | 2 ++ ast/src/reducer/reconstructing_director.rs | 7 +++- ast/src/reducer/reconstructing_reducer.rs | 2 ++ compiler/src/phases/reducing_director.rs | 33 +++++++++++++++---- errors/Cargo.toml | 2 +- parser/src/parser/expression.rs | 1 + .../inputs/ternary_explicit_and_implicit.in | 6 ++++ .../ternary_explicit_and_implicit.leo | 9 +++++ .../compiler/array/complex_access.leo.out | 6 ++-- .../compiler/compiler/array/registers.leo.out | 6 ++-- .../compiler/compiler/char/circuit.leo.out | 6 ++-- .../big_self_in_circuit_replacement.leo.out | 6 ++-- .../circuits/const_self_variable.leo.out | 6 ++-- ...ne_circuit_inside_circuit_function.leo.out | 6 ++-- .../compiler/compiler/circuits/inline.leo.out | 6 ++-- .../circuits/inline_member_pass.leo.out | 6 ++-- .../compiler/circuits/member_function.leo.out | 6 ++-- .../circuits/member_function_nested.leo.out | 6 ++-- .../compiler/circuits/member_variable.leo.out | 6 ++-- .../member_variable_and_function.leo.out | 6 ++-- .../circuits/mut_self_variable.leo.out | 6 ++-- .../circuits/mut_self_variable_branch.leo.out | 6 ++-- .../mut_self_variable_conditional.leo.out | 6 ++-- .../compiler/circuits/mut_variable.leo.out | 6 ++-- .../mutable_call_immutable_context.leo.out | 6 ++-- .../compiler/circuits/pedersen_mock.leo.out | 6 ++-- .../compiler/circuits/self_member.leo.out | 6 ++-- .../function/multiple_returns_main.leo.out | 6 ++-- .../global_consts/global_const_types.leo.out | 6 ++-- .../basic.leo.out | 6 ++-- .../token_withdraw.leo.out | 6 ++-- .../program_state/access_all.leo.out | 6 ++-- .../program_state/access_state.leo.out | 6 ++-- .../mutability/circuit_function_mut.leo.out | 6 ++-- .../mutability/circuit_variable_mut.leo.out | 6 ++-- .../statements/assign_ternary.leo.out | 2 +- .../statements/compound_assignment.leo.out | 6 ++-- .../ternary_explicit_and_implicit.leo.out | 21 ++++++++++++ .../compiler/compiler/string/circuit.leo.out | 6 ++-- .../access/array_range_access.leo.out | 8 +++++ .../parser/expression/access/circuit.leo.out | 7 ++++ .../parser/expression/unary/negate.leo.out | 1 + .../parser/expression/unary/not.leo.out | 1 + 49 files changed, 199 insertions(+), 106 deletions(-) create mode 100644 tests/compiler/statements/inputs/ternary_explicit_and_implicit.in create mode 100644 tests/compiler/statements/ternary_explicit_and_implicit.leo create mode 100644 tests/expectations/compiler/compiler/statements/ternary_explicit_and_implicit.leo.out diff --git a/Cargo.lock b/Cargo.lock index d76817cbf0..701dc9d718 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2361,9 +2361,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.127" +version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f03b9878abf6d14e6779d3f24f07b2cfa90352cfec4acc5aab8f1ac7f146fae8" +checksum = "1056a0db1978e9dbf0f6e4fca677f6f9143dc1c19de346f22cac23e422196834" dependencies = [ "serde_derive", ] @@ -2380,9 +2380,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.127" +version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a024926d3432516606328597e0f224a51355a493b49fdd67e9209187cbe55ecc" +checksum = "13af2fbb8b60a8950d6c72a56d2095c28870367cc8e10c55e9745bac4995a2c4" dependencies = [ "proc-macro2 1.0.27", "quote 1.0.9", @@ -2414,12 +2414,12 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.8.18" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "039ba818c784248423789eec090aab9fb566c7b94d6ebbfa1814a9fd52c8afb2" +checksum = "6375dbd828ed6964c3748e4ef6d18e7a175d408ffe184bca01698d0c73f915a9" dependencies = [ "dtoa", - "linked-hash-map", + "indexmap", "serde", "yaml-rust", ] diff --git a/asg/src/expression/call.rs b/asg/src/expression/call.rs index 1673096204..1ffee942d7 100644 --- a/asg/src/expression/call.rs +++ b/asg/src/expression/call.rs @@ -91,6 +91,7 @@ impl<'a> FromAst<'a, leo_ast::CallExpression> for CallExpression<'a> { circuit: ast_circuit, name, span, + .. }) => { let target = <&Expression<'a>>::from_ast(scope, &**ast_circuit, None)?; let circuit = match target.get_type() { diff --git a/asg/src/expression/circuit_access.rs b/asg/src/expression/circuit_access.rs index 5152f2b9c5..b01dca1ff3 100644 --- a/asg/src/expression/circuit_access.rs +++ b/asg/src/expression/circuit_access.rs @@ -203,6 +203,7 @@ impl<'a> Into for &CircuitAccessExpression<'a> { circuit: Box::new(target.into()), name: self.member.clone(), span: self.span.clone().unwrap_or_default(), + type_: None, }) } else { leo_ast::Expression::CircuitStaticFunctionAccess(leo_ast::CircuitStaticFunctionAccessExpression { diff --git a/asg/src/expression/ternary.rs b/asg/src/expression/ternary.rs index 8f286d4559..4e26d254aa 100644 --- a/asg/src/expression/ternary.rs +++ b/asg/src/expression/ternary.rs @@ -87,7 +87,15 @@ impl<'a> FromAst<'a, leo_ast::TernaryExpression> for TernaryExpression<'a> { )?); let left: PartialType = if_true.get().get_type().unwrap().into(); - let if_false = Cell::new(<&Expression<'a>>::from_ast(scope, &*value.if_false, expected_type)?); + let if_false = if expected_type.is_none() { + Cell::new(<&Expression<'a>>::from_ast( + scope, + &*value.if_false, + Some(left.clone()), + )?) + } else { + Cell::new(<&Expression<'a>>::from_ast(scope, &*value.if_false, expected_type)?) + }; let right = if_false.get().get_type().unwrap().into(); if left != right { diff --git a/asg/src/statement/mod.rs b/asg/src/statement/mod.rs index e9da0f591b..2ababe353c 100644 --- a/asg/src/statement/mod.rs +++ b/asg/src/statement/mod.rs @@ -95,7 +95,7 @@ impl<'a> FromAst<'a, leo_ast::Statement> for &'a Statement<'a> { scope, statement, None, )?)) } - Iteration(statement) => Self::from_ast(scope, &**statement, None)?, + Iteration(ref statement) => Self::from_ast(scope, &**statement, None)?, Console(statement) => scope .context .alloc_statement(Statement::Console(ConsoleStatement::from_ast(scope, statement, None)?)), diff --git a/ast/src/expression/circuit_member_access.rs b/ast/src/expression/circuit_member_access.rs index a86c5a85d1..8592a3f1b0 100644 --- a/ast/src/expression/circuit_member_access.rs +++ b/ast/src/expression/circuit_member_access.rs @@ -21,6 +21,7 @@ pub struct CircuitMemberAccessExpression { pub circuit: Box, pub name: Identifier, pub span: Span, + pub type_: Option, } impl fmt::Display for CircuitMemberAccessExpression { diff --git a/ast/src/reducer/canonicalization.rs b/ast/src/reducer/canonicalization.rs index 1f2ec23b74..d657c17206 100644 --- a/ast/src/reducer/canonicalization.rs +++ b/ast/src/reducer/canonicalization.rs @@ -76,6 +76,7 @@ impl Canonicalizer { circuit: left, name: identifier, span: span.clone(), + type_: None, })); } } @@ -270,6 +271,7 @@ impl Canonicalizer { circuit: Box::new(self.canonicalize_expression(&circuit_member_access.circuit)), name: circuit_member_access.name.clone(), span: circuit_member_access.span.clone(), + type_: None, }); } Expression::CircuitStaticFunctionAccess(circuit_static_func_access) => { diff --git a/ast/src/reducer/reconstructing_director.rs b/ast/src/reducer/reconstructing_director.rs index 85e28c98f7..129c6342f7 100644 --- a/ast/src/reducer/reconstructing_director.rs +++ b/ast/src/reducer/reconstructing_director.rs @@ -241,9 +241,14 @@ impl ReconstructingDirector { ) -> Result { let circuit = self.reduce_expression(&circuit_member_access.circuit)?; let name = self.reduce_identifier(&circuit_member_access.name)?; + let type_ = circuit_member_access + .type_ + .as_ref() + .map(|type_| self.reduce_type(type_, &circuit_member_access.span)) + .transpose()?; self.reducer - .reduce_circuit_member_access(circuit_member_access, circuit, name) + .reduce_circuit_member_access(circuit_member_access, circuit, name, type_) } pub fn reduce_circuit_static_fn_access( diff --git a/ast/src/reducer/reconstructing_reducer.rs b/ast/src/reducer/reconstructing_reducer.rs index 36acacf7e3..1a091857a4 100644 --- a/ast/src/reducer/reconstructing_reducer.rs +++ b/ast/src/reducer/reconstructing_reducer.rs @@ -215,11 +215,13 @@ pub trait ReconstructingReducer { circuit_member_access: &CircuitMemberAccessExpression, circuit: Expression, name: Identifier, + type_: Option, ) -> Result { Ok(CircuitMemberAccessExpression { circuit: Box::new(circuit), name, span: circuit_member_access.span.clone(), + type_, }) } diff --git a/compiler/src/phases/reducing_director.rs b/compiler/src/phases/reducing_director.rs index 380f6e577c..1f9bb68952 100644 --- a/compiler/src/phases/reducing_director.rs +++ b/compiler/src/phases/reducing_director.rs @@ -225,17 +225,31 @@ impl CombineAstAsgDirector { } pub fn reduce_call(&mut self, ast: &AstCallExpression, asg: &AsgCallExpression) -> Result { - // TODO FIGURE IT OUT - // let function = self.reduce_expression(&ast.function, asg.function.get())?; - // let target = asg.target.get().map(|exp| self.reduce_expression()) - // Is this needed? + let mut function = *ast.function.clone(); + + if self.options.type_inference_enabled() { + let function_type: Option = asg + .target + .get() + .map(|target| { + (target as &dyn leo_asg::ExpressionNode) + .get_type() + .as_ref() + .map(|t| t.into()) + }) + .flatten(); + if let AstExpression::CircuitMemberAccess(mut access) = function { + access.type_ = function_type; + function = AstExpression::CircuitMemberAccess(access); + } + } let mut arguments = vec![]; for (ast_arg, asg_arg) in ast.arguments.iter().zip(asg.arguments.iter()) { arguments.push(self.reduce_expression(ast_arg, asg_arg.get())?); } - self.ast_reducer.reduce_call(ast, *ast.function.clone(), arguments) + self.ast_reducer.reduce_call(ast, function, arguments) } pub fn reduce_cast(&mut self, ast: &AstCastExpression, asg: &AsgCastExpression) -> Result { @@ -248,14 +262,19 @@ impl CombineAstAsgDirector { pub fn reduce_circuit_member_access( &mut self, ast: &CircuitMemberAccessExpression, - _asg: &AsgCircuitAccessExpression, + asg: &AsgCircuitAccessExpression, ) -> Result { // let circuit = self.reduce_expression(&circuit_member_access.circuit)?; // let name = self.reduce_identifier(&circuit_member_access.name)?; // let target = input.target.get().map(|e| self.reduce_expression(e)); + let type_ = if self.options.type_inference_enabled() { + Some(leo_ast::Type::Circuit(asg.circuit.get().name.borrow().clone())) + } else { + None + }; self.ast_reducer - .reduce_circuit_member_access(ast, *ast.circuit.clone(), ast.name.clone()) + .reduce_circuit_member_access(ast, *ast.circuit.clone(), ast.name.clone(), type_) } pub fn reduce_circuit_static_fn_access( diff --git a/errors/Cargo.toml b/errors/Cargo.toml index 362716882b..79da65dc14 100644 --- a/errors/Cargo.toml +++ b/errors/Cargo.toml @@ -41,7 +41,7 @@ version = "0.3.61" version = "2.0" [dependencies.serde] -version = "1.0.126" +version = "1.0.128" features = [ "derive", "rc" ] [dependencies.tendril] diff --git a/parser/src/parser/expression.rs b/parser/src/parser/expression.rs index d257da3718..d9ebcfc944 100644 --- a/parser/src/parser/expression.rs +++ b/parser/src/parser/expression.rs @@ -452,6 +452,7 @@ impl ParserContext { span: expr.span() + &ident.span, circuit: Box::new(expr), name: ident, + type_: None, }); } else if let Some((num, span)) = self.eat_int() { expr = Expression::TupleAccess(TupleAccessExpression { diff --git a/tests/compiler/statements/inputs/ternary_explicit_and_implicit.in b/tests/compiler/statements/inputs/ternary_explicit_and_implicit.in new file mode 100644 index 0000000000..ef82e41af8 --- /dev/null +++ b/tests/compiler/statements/inputs/ternary_explicit_and_implicit.in @@ -0,0 +1,6 @@ +[main] +x: u8 = 3; +y: bool = true; + +[registers] +a: u8 = 0; \ No newline at end of file diff --git a/tests/compiler/statements/ternary_explicit_and_implicit.leo b/tests/compiler/statements/ternary_explicit_and_implicit.leo new file mode 100644 index 0000000000..d092bc2928 --- /dev/null +++ b/tests/compiler/statements/ternary_explicit_and_implicit.leo @@ -0,0 +1,9 @@ +/* +namespace: Compile +expectation: Pass +input_file: inputs/ternary_explicit_and_implicit.in +*/ + +function main(x: u8, y: bool) -> u8 { + return y ? x : 2; +} diff --git a/tests/expectations/compiler/compiler/array/complex_access.leo.out b/tests/expectations/compiler/compiler/array/complex_access.leo.out index d3cd24862e..4cd59df22f 100644 --- a/tests/expectations/compiler/compiler/array/complex_access.leo.out +++ b/tests/expectations/compiler/compiler/array/complex_access.leo.out @@ -16,6 +16,6 @@ outputs: out: type: bool value: "true" - initial_ast: 589670c04ad13f8dbe2ea01562fa6bdff1c6dfaf118730e60d0a55e5bb2168b9 - canonicalized_ast: 82fd732401abaced235b6522298a454fd0491ea1dc0a80170773e1a129320657 - type_inferenced_ast: 14321d2bd1a2d9da60f52372feee4c8bf6aa98d516c01bf309d219c903b7f241 + initial_ast: 9a4630fa0959a626a26800f00d05a203e35f4389a9d17a6dc491eb725ef3a529 + canonicalized_ast: 6c7df16234b6b4d8aaa6ca1d761bcffb5b05893cc515b6f4d72118bc8e495b7e + type_inferenced_ast: 4aa60801f15fb817e16eb9f9bd4d6bed555c9130d88edebb3ba78302879703a1 diff --git a/tests/expectations/compiler/compiler/array/registers.leo.out b/tests/expectations/compiler/compiler/array/registers.leo.out index f03de935e4..6d859f9cb0 100644 --- a/tests/expectations/compiler/compiler/array/registers.leo.out +++ b/tests/expectations/compiler/compiler/array/registers.leo.out @@ -22,6 +22,6 @@ outputs: r: type: "[u8; 3]" value: "\"123\"" - initial_ast: c6b18b6fca7fda77a9eba151f4d27d084e1ad7aa616e6ec9deb1ef5f4bff2d24 - canonicalized_ast: c6b18b6fca7fda77a9eba151f4d27d084e1ad7aa616e6ec9deb1ef5f4bff2d24 - type_inferenced_ast: 6f6e6b35b55543bc87589005ac9a47830e3f65680a4db82e3f17d9280d6fa4ad + initial_ast: 1c07965336635dce8cd66c67eddf25a51f61a3b90513f87ef123c642a9b5b18a + canonicalized_ast: 1c07965336635dce8cd66c67eddf25a51f61a3b90513f87ef123c642a9b5b18a + type_inferenced_ast: cf35fa9ca18f19ac75ca522a77e310b02ff56ac1d748cd5df5c2204bba4a4802 diff --git a/tests/expectations/compiler/compiler/char/circuit.leo.out b/tests/expectations/compiler/compiler/char/circuit.leo.out index 727dce531b..baf73f9b0a 100644 --- a/tests/expectations/compiler/compiler/char/circuit.leo.out +++ b/tests/expectations/compiler/compiler/char/circuit.leo.out @@ -100,6 +100,6 @@ outputs: r: type: char value: "'\\u{1f62d}'" - initial_ast: aa3eb0c4de0eebada9490b11e35c36923316559727a3afce28fe3852a805354a - canonicalized_ast: aa3eb0c4de0eebada9490b11e35c36923316559727a3afce28fe3852a805354a - type_inferenced_ast: 73309200d30bf2831847477f3da7ede4ba9f4aa377e6ebf15c9c34774f53bcb5 + initial_ast: 715a33d0032f02d69d13687ac98005a789b6bcb63ff619865b21f0c691f14a75 + canonicalized_ast: 715a33d0032f02d69d13687ac98005a789b6bcb63ff619865b21f0c691f14a75 + type_inferenced_ast: d04164068277e88b5529f1072b512ffadc7eaaf704c8a3e394a409e783cc1e27 diff --git a/tests/expectations/compiler/compiler/circuits/big_self_in_circuit_replacement.leo.out b/tests/expectations/compiler/compiler/circuits/big_self_in_circuit_replacement.leo.out index 25c76f1edc..11d7c42755 100644 --- a/tests/expectations/compiler/compiler/circuits/big_self_in_circuit_replacement.leo.out +++ b/tests/expectations/compiler/compiler/circuits/big_self_in_circuit_replacement.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 776ea4bb946bb5d56430c22be58f3539dbecb25a11ec07e5e8bd3db49be7f937 - canonicalized_ast: 6a95acbcb25193b7b9f9e7a2bbcaeafa83ec09163e097b12076ea512a9daaf14 - type_inferenced_ast: d71ab34660bf998f236dfe59e55050f9f5fba8671bacbbdde04b4902927ec571 + initial_ast: bc330763338677f23601b03f5665bd8f42f8143f59cc9b4803fb693b3cfa0311 + canonicalized_ast: fbff610ef772ee7f997b4bc4cd7c2a3f2024d70af35b94a966ca6a0f19f15194 + type_inferenced_ast: f6b0159f6bffeff8e3cde7f13c97ac5d537b40855271a4a13d07a84d24d78504 diff --git a/tests/expectations/compiler/compiler/circuits/const_self_variable.leo.out b/tests/expectations/compiler/compiler/circuits/const_self_variable.leo.out index cd5036c8e5..9261e9d0ff 100644 --- a/tests/expectations/compiler/compiler/circuits/const_self_variable.leo.out +++ b/tests/expectations/compiler/compiler/circuits/const_self_variable.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: b438fb664bd7b8683beabd5044efba7669d3fcab093994b1c386a30ad63fff14 - canonicalized_ast: b438fb664bd7b8683beabd5044efba7669d3fcab093994b1c386a30ad63fff14 - type_inferenced_ast: 9094424be690a804ae2e5d3ca2787104de01dc6bca89fe6d349db5709c5161ac + initial_ast: 601fb882472ee0ff4aea3330822936a9df64bfc8ceefcd83f000bb3094878d47 + canonicalized_ast: 601fb882472ee0ff4aea3330822936a9df64bfc8ceefcd83f000bb3094878d47 + type_inferenced_ast: 110a4e51c4c0ace6c0f3aa385e1735cb4ecf3cfea2a9d2ab7591da3826582c31 diff --git a/tests/expectations/compiler/compiler/circuits/define_circuit_inside_circuit_function.leo.out b/tests/expectations/compiler/compiler/circuits/define_circuit_inside_circuit_function.leo.out index cc4b1e0369..8ec377987f 100644 --- a/tests/expectations/compiler/compiler/circuits/define_circuit_inside_circuit_function.leo.out +++ b/tests/expectations/compiler/compiler/circuits/define_circuit_inside_circuit_function.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 7221141253b1998cbddad5f0c1385e7b53450a535112c0eb112b5af01474ce20 - canonicalized_ast: 7221141253b1998cbddad5f0c1385e7b53450a535112c0eb112b5af01474ce20 - type_inferenced_ast: f208046c46de9c4a42c47079504791711c9b0c8b3fb35dd413243fcbfd7dbd90 + initial_ast: 63f34a3b537f3221e8711828f7d0953c0766627c0cdb2e37933b88a93550e261 + canonicalized_ast: 63f34a3b537f3221e8711828f7d0953c0766627c0cdb2e37933b88a93550e261 + type_inferenced_ast: 29604fd57ee8658f83e552bc6496541ebcebb91afa313a1706b285fe18385c4c diff --git a/tests/expectations/compiler/compiler/circuits/inline.leo.out b/tests/expectations/compiler/compiler/circuits/inline.leo.out index f5649f0b60..ed4bcd5da5 100644 --- a/tests/expectations/compiler/compiler/circuits/inline.leo.out +++ b/tests/expectations/compiler/compiler/circuits/inline.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: u32 value: "100" - initial_ast: ba821e922e3b934581e39a58e2ef08d14b6cb0355500ed79f017dc0ecd39651c - canonicalized_ast: ba821e922e3b934581e39a58e2ef08d14b6cb0355500ed79f017dc0ecd39651c - type_inferenced_ast: 03fadaa1772f83ffa18a67a2279a65bad0715a6077f7219ff8955b45707c0437 + initial_ast: c76bd461573b9bb3622a74b5c5a10a98402b8c86c13086c01c161b77aac0c642 + canonicalized_ast: c76bd461573b9bb3622a74b5c5a10a98402b8c86c13086c01c161b77aac0c642 + type_inferenced_ast: 213f747571838133c62a73574f769d25fd42afce151e580be42d1d9d7b62033b diff --git a/tests/expectations/compiler/compiler/circuits/inline_member_pass.leo.out b/tests/expectations/compiler/compiler/circuits/inline_member_pass.leo.out index 024e4f07b1..4ee319c61d 100644 --- a/tests/expectations/compiler/compiler/circuits/inline_member_pass.leo.out +++ b/tests/expectations/compiler/compiler/circuits/inline_member_pass.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 58d028cbd020f04ef3b1025a07dabbc8bc4f5a2adf7e2ca4bb67cc229d4f64cd - canonicalized_ast: 5e72d67df40e8ecd2ae9999419888ade6ebf1c054f1f80f91a274360e294d361 - type_inferenced_ast: 177f3be4bed2ca8e1a9543b8bb71a75a751d6835dcac15910bc4bd5fa9e25897 + initial_ast: 3b07cdd6e203ad5775a6c75a4598330e4bf7b04616bdbd532df20bd7bba1981d + canonicalized_ast: f87f269c06e5eb1d6802b4a92c9a4af2a3966583dbaa2454b5468b3f56114a15 + type_inferenced_ast: 73ed7092d40d9b7e5be744e14da191eaa7f0758b6027c7e984365bd33e07ae2d diff --git a/tests/expectations/compiler/compiler/circuits/member_function.leo.out b/tests/expectations/compiler/compiler/circuits/member_function.leo.out index 0f4bb0e507..23b1484e46 100644 --- a/tests/expectations/compiler/compiler/circuits/member_function.leo.out +++ b/tests/expectations/compiler/compiler/circuits/member_function.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 681bcdc031155971ce0dab8c8ee659df3f09b97b4e6b4525d47f4a045765a57c - canonicalized_ast: 681bcdc031155971ce0dab8c8ee659df3f09b97b4e6b4525d47f4a045765a57c - type_inferenced_ast: 40920da878d0316ea8fd4d1963e53843b1d8933441fd568adba5f11e4ded7246 + initial_ast: b53c2c321c3f6ee2202eaca1e709607f5e82f9e456be132b08493de57b1c4089 + canonicalized_ast: b53c2c321c3f6ee2202eaca1e709607f5e82f9e456be132b08493de57b1c4089 + type_inferenced_ast: a94dfe431aa43189323427aadb33120d4ac03e19b9a898353858c26b624869ed diff --git a/tests/expectations/compiler/compiler/circuits/member_function_nested.leo.out b/tests/expectations/compiler/compiler/circuits/member_function_nested.leo.out index 7869be8c61..6760a49a72 100644 --- a/tests/expectations/compiler/compiler/circuits/member_function_nested.leo.out +++ b/tests/expectations/compiler/compiler/circuits/member_function_nested.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 05ea77fc193abe91954fc2fcd338d3ebfaff6bb7939339e9dcc78e514802dd42 - canonicalized_ast: 05ea77fc193abe91954fc2fcd338d3ebfaff6bb7939339e9dcc78e514802dd42 - type_inferenced_ast: 9827f4b622a95714f55620295e8ce9d9cf6fc85603a869b178825c818d64d768 + initial_ast: 8b7192c1472be002b294589105832ae0e979e964fc62e63ba22b1f0cf3b762e5 + canonicalized_ast: 8b7192c1472be002b294589105832ae0e979e964fc62e63ba22b1f0cf3b762e5 + type_inferenced_ast: 14d9f0f0a222b6ec4236b0eb75e0740d624279181bb7ab9281752529b0a0f417 diff --git a/tests/expectations/compiler/compiler/circuits/member_variable.leo.out b/tests/expectations/compiler/compiler/circuits/member_variable.leo.out index ff6d455507..b048ef8625 100644 --- a/tests/expectations/compiler/compiler/circuits/member_variable.leo.out +++ b/tests/expectations/compiler/compiler/circuits/member_variable.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 0723285d6c4dac924f6c86e0a6fd57eb78947cfcecd45f2520b7b0f0029f3279 - canonicalized_ast: 0723285d6c4dac924f6c86e0a6fd57eb78947cfcecd45f2520b7b0f0029f3279 - type_inferenced_ast: c42738de8987ca76cacc30dbf86688ff11d5dbf7dccba67947cc78eb452460fd + initial_ast: 7abdf292d56f99ef05e39c1a55a6071d9d69ca8c8e537e08201472f057e7a127 + canonicalized_ast: 7abdf292d56f99ef05e39c1a55a6071d9d69ca8c8e537e08201472f057e7a127 + type_inferenced_ast: db8685abd4ffc32fa55786b847eff1d0694b871c1757eec70757879d82856872 diff --git a/tests/expectations/compiler/compiler/circuits/member_variable_and_function.leo.out b/tests/expectations/compiler/compiler/circuits/member_variable_and_function.leo.out index 402638f498..17d2be5676 100644 --- a/tests/expectations/compiler/compiler/circuits/member_variable_and_function.leo.out +++ b/tests/expectations/compiler/compiler/circuits/member_variable_and_function.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: bbad7fd765dee42c9ebaca7e07201d61befefa5e7d5af700130954ac29cdd27c - canonicalized_ast: bbad7fd765dee42c9ebaca7e07201d61befefa5e7d5af700130954ac29cdd27c - type_inferenced_ast: cb8745ad419c19ad007a9d9d905f01c0d85d2e78cb82be0b82342c44015c322e + initial_ast: ca98bec50adc76ce348e28e7020d6e99cb6aa8fb733e0e0bce023ca8d1e3e4b6 + canonicalized_ast: ca98bec50adc76ce348e28e7020d6e99cb6aa8fb733e0e0bce023ca8d1e3e4b6 + type_inferenced_ast: ec5aad932c3d0d016142a7d288328547949da8add55025076c5d404d2451917d diff --git a/tests/expectations/compiler/compiler/circuits/mut_self_variable.leo.out b/tests/expectations/compiler/compiler/circuits/mut_self_variable.leo.out index 4dbac2b20a..82325e1425 100644 --- a/tests/expectations/compiler/compiler/circuits/mut_self_variable.leo.out +++ b/tests/expectations/compiler/compiler/circuits/mut_self_variable.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: d2d5680f0e011b93b2e55aebb62f51b4e78cf68289ffd84a80f852d2a82a6723 - canonicalized_ast: 57c2e52b3f73e7052fdc92d0c668b598b282321cd390ed836f20b92bc528b6e0 - type_inferenced_ast: 4f8c32d94398d49ffb9b1eab3639076e77d77159411c1891d814b4946751e554 + initial_ast: a9313db75382b5afb38e9453bdb0dd6c0aa7368cf11e208eb0ca8124ea615d8b + canonicalized_ast: 3d4bb330e687601978d3f68544582d93c3bace6c0d3e8808c409b8534c563403 + type_inferenced_ast: 14b0aa9c6d83ca85c625cdc78e4cf96dcbe1672b98c379e8783744d59d699bb1 diff --git a/tests/expectations/compiler/compiler/circuits/mut_self_variable_branch.leo.out b/tests/expectations/compiler/compiler/circuits/mut_self_variable_branch.leo.out index 301d38f9ac..ed07a0a376 100644 --- a/tests/expectations/compiler/compiler/circuits/mut_self_variable_branch.leo.out +++ b/tests/expectations/compiler/compiler/circuits/mut_self_variable_branch.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 15da2283babf7f4a490bd7bdc0331522107f7ce4c88949863178ba4a00419ead - canonicalized_ast: 96a167f8b897e9973bb7b9d13faa81da0b635a6611ef09124a5d12f817b35254 - type_inferenced_ast: 82c54a8e54820fc234a7029cb4c6018df99e7a3d4b47f418efc8835889b1c6cc + initial_ast: ff029cd4035cb046857e7e8c0ff56c843969d2f04db76ced2698a20cf0491485 + canonicalized_ast: 88447a6c1f7b92f4af7d9cecd7fd8d6fa5e96ed5dd6c6fde5897cf3df3f5cbc5 + type_inferenced_ast: 51a081de631b9b95b2055ea5ba6a52d17972caf8bf7c70dadd49801af9d011f9 diff --git a/tests/expectations/compiler/compiler/circuits/mut_self_variable_conditional.leo.out b/tests/expectations/compiler/compiler/circuits/mut_self_variable_conditional.leo.out index b9b10201cb..eb9e16f4fd 100644 --- a/tests/expectations/compiler/compiler/circuits/mut_self_variable_conditional.leo.out +++ b/tests/expectations/compiler/compiler/circuits/mut_self_variable_conditional.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 6fd3b11431e3e71f2b628bc9c64cb51d04c77df08d7584503b76b3dff7bc90cc - canonicalized_ast: a7a942a8a40f7cf8bfd79fdea0ed81fb6b56cfd9009b01b3d0225b427ef583cd - type_inferenced_ast: d3cc0e19adac957e11d520bf727133bfcc85eef5f306373cb5057b840b1a41f6 + initial_ast: 5d815c98c76a76dd93051902eae718df3db66e0268ba9af8ae62ef7af19b1d48 + canonicalized_ast: 798961ad9da5a767a98882ff36944483f1f1412dcf10f67acf1f390a19bfc138 + type_inferenced_ast: 6dbfd429fa50f0017a01dae57ae2a98e7452ab7c54bfcd251e1ed40e5f28176c diff --git a/tests/expectations/compiler/compiler/circuits/mut_variable.leo.out b/tests/expectations/compiler/compiler/circuits/mut_variable.leo.out index 8afebb1042..23dca1d641 100644 --- a/tests/expectations/compiler/compiler/circuits/mut_variable.leo.out +++ b/tests/expectations/compiler/compiler/circuits/mut_variable.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 48713617e0f06ade7b443ec779e646b0ff82e025f040c8a28bf2ea7eb37f3399 - canonicalized_ast: 48713617e0f06ade7b443ec779e646b0ff82e025f040c8a28bf2ea7eb37f3399 - type_inferenced_ast: 68e4f8baf01d452f42d0765f2819783adb55000238d5d57304a314fb5cff3c22 + initial_ast: 357f19fd5e1fbbbeec8a18bcf14c30a7504feacbc88ffbd26e78eedf1d593275 + canonicalized_ast: 357f19fd5e1fbbbeec8a18bcf14c30a7504feacbc88ffbd26e78eedf1d593275 + type_inferenced_ast: aa3bf1734030119bb595a42d268b30509506ee06cf413b14bcde4e9056679dac diff --git a/tests/expectations/compiler/compiler/circuits/mutable_call_immutable_context.leo.out b/tests/expectations/compiler/compiler/circuits/mutable_call_immutable_context.leo.out index 5f12f27e1c..6dcfa937a1 100644 --- a/tests/expectations/compiler/compiler/circuits/mutable_call_immutable_context.leo.out +++ b/tests/expectations/compiler/compiler/circuits/mutable_call_immutable_context.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 2f6262df5e4a39a662b85cff0985d297fa2628d56fc3c036b5beb31d683a8574 - canonicalized_ast: 4bb2ac425c192058af2f97684019d74959bc40abc0f886a741894a89cc8e8d4f - type_inferenced_ast: 6c3c3d16ba595ab33902ece671d2460c3a25347e1e33e35ec82ff8622926afd2 + initial_ast: bb1ea12ac46ffd912b45b6febd71de41691c9aa064d07d5492e31845e72d00f2 + canonicalized_ast: ad957837a54fca62c6da8665a04dbf57cb87b5c5a000038a1b900c2be359a178 + type_inferenced_ast: 0fe1f5ac625424734a5140253228e3a6cde9f548b6deb18907f3ac49871180cc diff --git a/tests/expectations/compiler/compiler/circuits/pedersen_mock.leo.out b/tests/expectations/compiler/compiler/circuits/pedersen_mock.leo.out index d77bccc2b7..60234864fe 100644 --- a/tests/expectations/compiler/compiler/circuits/pedersen_mock.leo.out +++ b/tests/expectations/compiler/compiler/circuits/pedersen_mock.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 591aa0cc25f8c009c7df6425697003904e97e74c55f887c5ed3b27984fda4176 - canonicalized_ast: 7232353691a314166deb747de9046b05e507b581d35132479b01c6db41e72df6 - type_inferenced_ast: ae5cb090082e845a9a058a15de6345a672864bf2ad2061930922475cc2c3f8e1 + initial_ast: 41a569090cff5eba31d9640b3f9e8d8585dfcd817d25a42a48edcd2d522fbb72 + canonicalized_ast: 5150d7b2463ec10096f925fde523a4b956093ca44579487a82f15554fd7c32ed + type_inferenced_ast: 71d1f128ff9c4fa1df5189139360f4ccb3a460e83034c635952e6875c7fe41bb diff --git a/tests/expectations/compiler/compiler/circuits/self_member.leo.out b/tests/expectations/compiler/compiler/circuits/self_member.leo.out index d51b0bc9b9..cbe4c9f992 100644 --- a/tests/expectations/compiler/compiler/circuits/self_member.leo.out +++ b/tests/expectations/compiler/compiler/circuits/self_member.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 6b54a642c55d3a7991a063c5346797a4d7facf21533c8ec7b2e22eb9394caba0 - canonicalized_ast: 6b54a642c55d3a7991a063c5346797a4d7facf21533c8ec7b2e22eb9394caba0 - type_inferenced_ast: 5b4b8ea9431aca05e19fcf8987c4f4c824c065e2ed6fc7198cd769b8829ee4f1 + initial_ast: 5627039d5f3151255d4c7fff31fa548febc788fe2717606a4814a91937fee405 + canonicalized_ast: 5627039d5f3151255d4c7fff31fa548febc788fe2717606a4814a91937fee405 + type_inferenced_ast: 88e398f6f173de48fb7a6109fe886fd59b2fae70d1b9ccc53fd447d9b46ad0a3 diff --git a/tests/expectations/compiler/compiler/function/multiple_returns_main.leo.out b/tests/expectations/compiler/compiler/function/multiple_returns_main.leo.out index 208288b578..3743c4a177 100644 --- a/tests/expectations/compiler/compiler/function/multiple_returns_main.leo.out +++ b/tests/expectations/compiler/compiler/function/multiple_returns_main.leo.out @@ -19,6 +19,6 @@ outputs: r1: type: bool value: "true" - initial_ast: f982480cc10a58594b1ed75be2d2dcd29ed874fa666497f2c14b58c338a4443f - canonicalized_ast: f982480cc10a58594b1ed75be2d2dcd29ed874fa666497f2c14b58c338a4443f - type_inferenced_ast: f70e1d694f99f56777ac863e764615c6bc496ebb4f476c2faf8356e9246f4d24 + initial_ast: db801c467c6e6bd413b951d6a8f95e841e0254a3f00a3e1ff903ab2dcd63b253 + canonicalized_ast: db801c467c6e6bd413b951d6a8f95e841e0254a3f00a3e1ff903ab2dcd63b253 + type_inferenced_ast: 575c9b880a4a061bce5ace598d6d4195ca0f41278afc2b1a950c74052b2b9cef diff --git a/tests/expectations/compiler/compiler/global_consts/global_const_types.leo.out b/tests/expectations/compiler/compiler/global_consts/global_const_types.leo.out index bfc4883877..c5b40f6b38 100644 --- a/tests/expectations/compiler/compiler/global_consts/global_const_types.leo.out +++ b/tests/expectations/compiler/compiler/global_consts/global_const_types.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "false" - initial_ast: 97024a9c26e890afe8f4dc64b727a72e837f46b27ff56cddc1231c29671dc2b4 - canonicalized_ast: 8674af05f953dfda5eb360e367447912e9d0ec5abf513eaba14444bd66bd9cae - type_inferenced_ast: 33017f3824095dcb4431f73db16a3fe1e845d30d7a6366182b247a23445eb26d + initial_ast: d8d093539faee853421ce529aec6b222a651c494ca9f2a6eb4faafc443bbc02d + canonicalized_ast: 0556a49c8e1ef663c4428d9c5c315dcfa0721a000d0d482bc10f9c164ef1a4de + type_inferenced_ast: bb15e2202bb322be9f823823c780b5771854cebc311f107d51a88d0e601fa41e diff --git a/tests/expectations/compiler/compiler/input_files/program_input_and_program_state/basic.leo.out b/tests/expectations/compiler/compiler/input_files/program_input_and_program_state/basic.leo.out index 1b01d3a1c3..8bcc498211 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input_and_program_state/basic.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_input_and_program_state/basic.leo.out @@ -16,6 +16,6 @@ outputs: b: type: bool value: "true" - initial_ast: 2cfed669110dc972ec11a67149117c6dd2f4d09d7791d7d3cdfe334c32bfc3eb - canonicalized_ast: 2cfed669110dc972ec11a67149117c6dd2f4d09d7791d7d3cdfe334c32bfc3eb - type_inferenced_ast: 4df0dad517cafd4f8f4e9a9717e0b4d3decd2c07091338cd65fe97fdcc5e8778 + initial_ast: 2e0d03e2ad668ec5149102d0f9de870d0b3d263fb5c460471db913b5c15e153b + canonicalized_ast: 2e0d03e2ad668ec5149102d0f9de870d0b3d263fb5c460471db913b5c15e153b + type_inferenced_ast: ab37500c6660ca13113fe642160046179b9713d848ab712cd1c57b6e82ac7916 diff --git a/tests/expectations/compiler/compiler/input_files/program_input_and_program_state/token_withdraw.leo.out b/tests/expectations/compiler/compiler/input_files/program_input_and_program_state/token_withdraw.leo.out index f3559fa361..96eda6bbd7 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input_and_program_state/token_withdraw.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_input_and_program_state/token_withdraw.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 2a87c1d20941f840d6e6535b0145568e8aea7f87466c5e313329e3844efeef82 - canonicalized_ast: 2a87c1d20941f840d6e6535b0145568e8aea7f87466c5e313329e3844efeef82 - type_inferenced_ast: 34a0270bb47f0ba1b72f8789a1223084b6719933dd937f6703759502ace7a346 + initial_ast: 7c42b985a3e0013f38398639442535e6f40af6f379d9af65387e707cd97fb146 + canonicalized_ast: 7c42b985a3e0013f38398639442535e6f40af6f379d9af65387e707cd97fb146 + type_inferenced_ast: aeb12c856d7aa61002723056fc228fa4d342076b7c2bac597269f426a29a4cb2 diff --git a/tests/expectations/compiler/compiler/input_files/program_state/access_all.leo.out b/tests/expectations/compiler/compiler/input_files/program_state/access_all.leo.out index e53c68cb4a..3c62376b0f 100644 --- a/tests/expectations/compiler/compiler/input_files/program_state/access_all.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_state/access_all.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 6fd4f46e0a795fd0edef840925c6a152c8b69685f30b42b1dc5aeaf2e0f1296a - canonicalized_ast: 6fd4f46e0a795fd0edef840925c6a152c8b69685f30b42b1dc5aeaf2e0f1296a - type_inferenced_ast: ad948d43d662198b33e752ac1c20807b5d79525c4cc61f15d41155f31ade71c4 + initial_ast: 9cca50f35319c4b4e776c170a2936cb7e0a82c2d458bd725a282f1eaa3f01391 + canonicalized_ast: 9cca50f35319c4b4e776c170a2936cb7e0a82c2d458bd725a282f1eaa3f01391 + type_inferenced_ast: d75b58e775d20e72834683792cbf09339bb9f07ce05501d0331026cc0fe859cf diff --git a/tests/expectations/compiler/compiler/input_files/program_state/access_state.leo.out b/tests/expectations/compiler/compiler/input_files/program_state/access_state.leo.out index e5a5c707d0..56a1a0a81d 100644 --- a/tests/expectations/compiler/compiler/input_files/program_state/access_state.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_state/access_state.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 14d707805bc7e51b4b01dc9272ce7e7f1018c52a885a14177acb4e7ca34174f5 - canonicalized_ast: 14d707805bc7e51b4b01dc9272ce7e7f1018c52a885a14177acb4e7ca34174f5 - type_inferenced_ast: b399e663877ab10bb59844997e4a6a94e53c67cec20112a125906087a91f3a32 + initial_ast: 21381595616fc58e28df26f9c89b4cddcd8219703cd877523c55c80617288e07 + canonicalized_ast: 21381595616fc58e28df26f9c89b4cddcd8219703cd877523c55c80617288e07 + type_inferenced_ast: 981b4059bbf5feaa39719dfd802585fca3ee841c3e78792eb7b68470a015a41a diff --git a/tests/expectations/compiler/compiler/mutability/circuit_function_mut.leo.out b/tests/expectations/compiler/compiler/mutability/circuit_function_mut.leo.out index fe01ab791e..a0dc3d36ae 100644 --- a/tests/expectations/compiler/compiler/mutability/circuit_function_mut.leo.out +++ b/tests/expectations/compiler/compiler/mutability/circuit_function_mut.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: afde0187f805e33f804917815a52421a2662aa029b182be76c39f4ce5f3f453a - canonicalized_ast: 9dfd8d93fa20899e9d146d65b2564f1275cfb73158d8d96ed09f7157ff327e39 - type_inferenced_ast: e59a2cba730871aba6258b78f469b9df7763f8d78ad6bbda5c6026a989bc3d88 + initial_ast: f98b76f43ddfdf48c6ae59d240f8cc5435af4af4d858b42a215b6c7cdc62cbe0 + canonicalized_ast: 9322ad9c85e77f9491596f2edf8fbe28e1843e79467a26c700adc1674362cc81 + type_inferenced_ast: f1ca7540ea64649a3b8fa23be49593b001eb6b46be162701481d2bad4b2fea09 diff --git a/tests/expectations/compiler/compiler/mutability/circuit_variable_mut.leo.out b/tests/expectations/compiler/compiler/mutability/circuit_variable_mut.leo.out index 2658736d93..e8d582d714 100644 --- a/tests/expectations/compiler/compiler/mutability/circuit_variable_mut.leo.out +++ b/tests/expectations/compiler/compiler/mutability/circuit_variable_mut.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: db9400fc979f1cfd8eea30945594b0e8d2f4138bb32021b9086021b492e2e246 - canonicalized_ast: db9400fc979f1cfd8eea30945594b0e8d2f4138bb32021b9086021b492e2e246 - type_inferenced_ast: 24783ef52315a02bb2f2e34f5a4020f09f4573ae6d182cab699bf45235e1c4a3 + initial_ast: 1341a7e36aa9a9d76d032b4245ac4cecf8c62938cd921be44fc13a736cd21daf + canonicalized_ast: 1341a7e36aa9a9d76d032b4245ac4cecf8c62938cd921be44fc13a736cd21daf + type_inferenced_ast: 3e10385fa57b142f27bf8b9d9141ca83fece80755ac4643743f9db3824817750 diff --git a/tests/expectations/compiler/compiler/statements/assign_ternary.leo.out b/tests/expectations/compiler/compiler/statements/assign_ternary.leo.out index 659cb7e8b4..9a641be8e0 100644 --- a/tests/expectations/compiler/compiler/statements/assign_ternary.leo.out +++ b/tests/expectations/compiler/compiler/statements/assign_ternary.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EASG0373021]: ternary sides had different types: left u32, right bool\n --> compiler-test:4:13\n |\n 4 | let x = true ? x: true;\n | ^^^^^^^^^^^^^^" + - "Error [EASG0373026]: unexpected type, expected: 'u32', received: 'bool'\n --> compiler-test:4:23\n |\n 4 | let x = true ? x: true;\n | ^^^^" diff --git a/tests/expectations/compiler/compiler/statements/compound_assignment.leo.out b/tests/expectations/compiler/compiler/statements/compound_assignment.leo.out index c171430d72..5d973b2ebf 100644 --- a/tests/expectations/compiler/compiler/statements/compound_assignment.leo.out +++ b/tests/expectations/compiler/compiler/statements/compound_assignment.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: b260517dc70a401c68acfc09bd6434b55b61446e27bd940ad339987eb22ff85e - canonicalized_ast: eb5f37501878e5f97180a6f289f29795e09cb2da6fb031ed7ccb83681b407123 - type_inferenced_ast: 3abe1f8136d17844e2d11db603945fc06365cf91b51b9df0a2f700be94df8766 + initial_ast: 39a18b43d3d5a65507b9a4bc6558efe27509fa16006de6a98a47c67b6085667c + canonicalized_ast: 25c0175f87357fe5a14e48159c69eb636bfd6836706203d0a30dfbd0ccf9fff3 + type_inferenced_ast: ef74c4307c4124ce11ed81e98e0cc555a306c94505d7e40025e66655dac155a8 diff --git a/tests/expectations/compiler/compiler/statements/ternary_explicit_and_implicit.leo.out b/tests/expectations/compiler/compiler/statements/ternary_explicit_and_implicit.leo.out new file mode 100644 index 0000000000..2486b2233d --- /dev/null +++ b/tests/expectations/compiler/compiler/statements/ternary_explicit_and_implicit.leo.out @@ -0,0 +1,21 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - circuit: + num_public_variables: 0 + num_private_variables: 25 + num_constraints: 33 + at: 00318b0f80b01b9e2d5a8154a536deb1545f04abd493a84071ef13dce1a9d92d + bt: 799ee4dc07f6320b8c3dcbd5ebdf6de8a4cf5af8b1edc45dbe5621c8a34fa38d + ct: 7b6ec9eacd65cfa47dfe7e73eb7c8fa4be804a9fb878fddf59fe5d06e7c04489 + output: + - input_file: inputs/ternary_explicit_and_implicit.in + output: + registers: + a: + type: u8 + value: "3" + initial_ast: 29b5d6188c9fe56eaee3024a900b92e4bd9445364551b85e924fe9a392bac35d + canonicalized_ast: 29b5d6188c9fe56eaee3024a900b92e4bd9445364551b85e924fe9a392bac35d + type_inferenced_ast: 02edde30e615a1ac3e87818daa6fca7e4d7c0c0c0a1a9d9159a0a4190c11ec8a diff --git a/tests/expectations/compiler/compiler/string/circuit.leo.out b/tests/expectations/compiler/compiler/string/circuit.leo.out index 00776b17f3..b047ba8a7f 100644 --- a/tests/expectations/compiler/compiler/string/circuit.leo.out +++ b/tests/expectations/compiler/compiler/string/circuit.leo.out @@ -16,6 +16,6 @@ outputs: out: type: "[char; 13]" value: "\"Hello, World!\"" - initial_ast: 3ece39236ca03d9f6e4a89ae1a5f27cdbc8036eb1485913a2043d1e0a44beb3c - canonicalized_ast: b3df972e5b9658b6addba6f82e972043620a591f5981ac009b56fb6965742695 - type_inferenced_ast: 22fdc2ba01f04dbe8140df231d6f8c77ad4b5e62a12dfb45a67686830ebee455 + initial_ast: 70c3f622477262389299233a81c02174f0af3c99eb9aea42c2be73f191f44673 + canonicalized_ast: e8a3e9c427681a58127b088b0053cbc2f80c859a7081636fceb59dd0cc6cfee7 + type_inferenced_ast: db96adeedf84f21908b53bd7db4c4941396afc5fe592012109069186fa066b1a diff --git a/tests/expectations/parser/parser/expression/access/array_range_access.leo.out b/tests/expectations/parser/parser/expression/access/array_range_access.leo.out index 01765075b3..75b88359a2 100644 --- a/tests/expectations/parser/parser/expression/access/array_range_access.leo.out +++ b/tests/expectations/parser/parser/expression/access/array_range_access.leo.out @@ -280,6 +280,7 @@ outputs: col_stop: 6 path: "" content: "x[x.y..]" + type_: ~ right: ~ span: line_start: 1 @@ -304,6 +305,7 @@ outputs: col_stop: 8 path: "" content: "x[..y.x]" + type_: ~ span: line_start: 1 line_stop: 1 @@ -326,6 +328,7 @@ outputs: col_stop: 6 path: "" content: "x[x.y..y.x]" + type_: ~ right: CircuitMemberAccess: circuit: @@ -338,6 +341,7 @@ outputs: col_stop: 11 path: "" content: "x[x.y..y.x]" + type_: ~ span: line_start: 1 line_stop: 1 @@ -362,6 +366,7 @@ outputs: col_stop: 6 path: "" content: "x[x.y.x..y.x.y]" + type_: ~ name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x.y.x..y.x.y]\\\"}\"}" span: line_start: 1 @@ -370,6 +375,7 @@ outputs: col_stop: 8 path: "" content: "x[x.y.x..y.x.y]" + type_: ~ right: CircuitMemberAccess: circuit: @@ -384,6 +390,7 @@ outputs: col_stop: 13 path: "" content: "x[x.y.x..y.x.y]" + type_: ~ name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x.y.x..y.x.y]\\\"}\"}" span: line_start: 1 @@ -392,6 +399,7 @@ outputs: col_stop: 15 path: "" content: "x[x.y.x..y.x.y]" + type_: ~ span: line_start: 1 line_stop: 1 diff --git a/tests/expectations/parser/parser/expression/access/circuit.leo.out b/tests/expectations/parser/parser/expression/access/circuit.leo.out index 8498601d1e..5b53aecb5a 100644 --- a/tests/expectations/parser/parser/expression/access/circuit.leo.out +++ b/tests/expectations/parser/parser/expression/access/circuit.leo.out @@ -13,6 +13,7 @@ outputs: col_stop: 4 path: "" content: x.y + type_: ~ - CircuitMemberAccess: circuit: Identifier: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"X.Y\\\"}\"}" @@ -24,6 +25,7 @@ outputs: col_stop: 4 path: "" content: X.Y + type_: ~ - CircuitMemberAccess: circuit: CircuitMemberAccess: @@ -37,6 +39,7 @@ outputs: col_stop: 4 path: "" content: x.y.z + type_: ~ name: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x.y.z\\\"}\"}" span: line_start: 1 @@ -45,6 +48,7 @@ outputs: col_stop: 6 path: "" content: x.y.z + type_: ~ - Call: function: CircuitMemberAccess: @@ -58,6 +62,7 @@ outputs: col_stop: 4 path: "" content: x.y() + type_: ~ arguments: [] span: line_start: 1 @@ -79,6 +84,7 @@ outputs: col_stop: 4 path: "" content: x.y.0 + type_: ~ index: value: "0" span: @@ -101,6 +107,7 @@ outputs: col_stop: 4 path: "" content: "x.y[1]" + type_: ~ index: Value: Implicit: diff --git a/tests/expectations/parser/parser/expression/unary/negate.leo.out b/tests/expectations/parser/parser/expression/unary/negate.leo.out index fc683e6957..9fe8865d44 100644 --- a/tests/expectations/parser/parser/expression/unary/negate.leo.out +++ b/tests/expectations/parser/parser/expression/unary/negate.leo.out @@ -26,6 +26,7 @@ outputs: col_stop: 5 path: "" content: "-x.y" + type_: ~ op: Negate span: line_start: 1 diff --git a/tests/expectations/parser/parser/expression/unary/not.leo.out b/tests/expectations/parser/parser/expression/unary/not.leo.out index 15d331191c..04de6a3e4c 100644 --- a/tests/expectations/parser/parser/expression/unary/not.leo.out +++ b/tests/expectations/parser/parser/expression/unary/not.leo.out @@ -26,6 +26,7 @@ outputs: col_stop: 5 path: "" content: "!x.y" + type_: ~ op: Not span: line_start: 1 From 034ef90e624f64750997af37bcfddf80b3e82d40 Mon Sep 17 00:00:00 2001 From: damirka Date: Tue, 24 Aug 2021 22:27:37 +0300 Subject: [PATCH 11/13] Revert "Squashed commit of the following:" This reverts commit dfa15b1a4fdb0a8d9f07358a5dfea37f854ada91. --- Cargo.lock | 14 ++++---- asg/src/expression/call.rs | 1 - asg/src/expression/circuit_access.rs | 1 - asg/src/expression/ternary.rs | 10 +----- asg/src/statement/mod.rs | 2 +- ast/src/expression/circuit_member_access.rs | 1 - ast/src/reducer/canonicalization.rs | 2 -- ast/src/reducer/reconstructing_director.rs | 7 +--- ast/src/reducer/reconstructing_reducer.rs | 2 -- compiler/src/phases/reducing_director.rs | 33 ++++--------------- errors/Cargo.toml | 2 +- parser/src/parser/expression.rs | 1 - .../inputs/ternary_explicit_and_implicit.in | 6 ---- .../ternary_explicit_and_implicit.leo | 9 ----- .../compiler/array/complex_access.leo.out | 6 ++-- .../compiler/compiler/array/registers.leo.out | 6 ++-- .../compiler/compiler/char/circuit.leo.out | 6 ++-- .../big_self_in_circuit_replacement.leo.out | 6 ++-- .../circuits/const_self_variable.leo.out | 6 ++-- ...ne_circuit_inside_circuit_function.leo.out | 6 ++-- .../compiler/compiler/circuits/inline.leo.out | 6 ++-- .../circuits/inline_member_pass.leo.out | 6 ++-- .../compiler/circuits/member_function.leo.out | 6 ++-- .../circuits/member_function_nested.leo.out | 6 ++-- .../compiler/circuits/member_variable.leo.out | 6 ++-- .../member_variable_and_function.leo.out | 6 ++-- .../circuits/mut_self_variable.leo.out | 6 ++-- .../circuits/mut_self_variable_branch.leo.out | 6 ++-- .../mut_self_variable_conditional.leo.out | 6 ++-- .../compiler/circuits/mut_variable.leo.out | 6 ++-- .../mutable_call_immutable_context.leo.out | 6 ++-- .../compiler/circuits/pedersen_mock.leo.out | 6 ++-- .../compiler/circuits/self_member.leo.out | 6 ++-- .../function/multiple_returns_main.leo.out | 6 ++-- .../global_consts/global_const_types.leo.out | 6 ++-- .../basic.leo.out | 6 ++-- .../token_withdraw.leo.out | 6 ++-- .../program_state/access_all.leo.out | 6 ++-- .../program_state/access_state.leo.out | 6 ++-- .../mutability/circuit_function_mut.leo.out | 6 ++-- .../mutability/circuit_variable_mut.leo.out | 6 ++-- .../statements/assign_ternary.leo.out | 2 +- .../statements/compound_assignment.leo.out | 6 ++-- .../ternary_explicit_and_implicit.leo.out | 21 ------------ .../compiler/compiler/string/circuit.leo.out | 6 ++-- .../access/array_range_access.leo.out | 8 ----- .../parser/expression/access/circuit.leo.out | 7 ---- .../parser/expression/unary/negate.leo.out | 1 - .../parser/expression/unary/not.leo.out | 1 - 49 files changed, 106 insertions(+), 199 deletions(-) delete mode 100644 tests/compiler/statements/inputs/ternary_explicit_and_implicit.in delete mode 100644 tests/compiler/statements/ternary_explicit_and_implicit.leo delete mode 100644 tests/expectations/compiler/compiler/statements/ternary_explicit_and_implicit.leo.out diff --git a/Cargo.lock b/Cargo.lock index 701dc9d718..d76817cbf0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2361,9 +2361,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.128" +version = "1.0.127" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1056a0db1978e9dbf0f6e4fca677f6f9143dc1c19de346f22cac23e422196834" +checksum = "f03b9878abf6d14e6779d3f24f07b2cfa90352cfec4acc5aab8f1ac7f146fae8" dependencies = [ "serde_derive", ] @@ -2380,9 +2380,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.128" +version = "1.0.127" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13af2fbb8b60a8950d6c72a56d2095c28870367cc8e10c55e9745bac4995a2c4" +checksum = "a024926d3432516606328597e0f224a51355a493b49fdd67e9209187cbe55ecc" dependencies = [ "proc-macro2 1.0.27", "quote 1.0.9", @@ -2414,12 +2414,12 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.8.19" +version = "0.8.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6375dbd828ed6964c3748e4ef6d18e7a175d408ffe184bca01698d0c73f915a9" +checksum = "039ba818c784248423789eec090aab9fb566c7b94d6ebbfa1814a9fd52c8afb2" dependencies = [ "dtoa", - "indexmap", + "linked-hash-map", "serde", "yaml-rust", ] diff --git a/asg/src/expression/call.rs b/asg/src/expression/call.rs index 1ffee942d7..1673096204 100644 --- a/asg/src/expression/call.rs +++ b/asg/src/expression/call.rs @@ -91,7 +91,6 @@ impl<'a> FromAst<'a, leo_ast::CallExpression> for CallExpression<'a> { circuit: ast_circuit, name, span, - .. }) => { let target = <&Expression<'a>>::from_ast(scope, &**ast_circuit, None)?; let circuit = match target.get_type() { diff --git a/asg/src/expression/circuit_access.rs b/asg/src/expression/circuit_access.rs index b01dca1ff3..5152f2b9c5 100644 --- a/asg/src/expression/circuit_access.rs +++ b/asg/src/expression/circuit_access.rs @@ -203,7 +203,6 @@ impl<'a> Into for &CircuitAccessExpression<'a> { circuit: Box::new(target.into()), name: self.member.clone(), span: self.span.clone().unwrap_or_default(), - type_: None, }) } else { leo_ast::Expression::CircuitStaticFunctionAccess(leo_ast::CircuitStaticFunctionAccessExpression { diff --git a/asg/src/expression/ternary.rs b/asg/src/expression/ternary.rs index 4e26d254aa..8f286d4559 100644 --- a/asg/src/expression/ternary.rs +++ b/asg/src/expression/ternary.rs @@ -87,15 +87,7 @@ impl<'a> FromAst<'a, leo_ast::TernaryExpression> for TernaryExpression<'a> { )?); let left: PartialType = if_true.get().get_type().unwrap().into(); - let if_false = if expected_type.is_none() { - Cell::new(<&Expression<'a>>::from_ast( - scope, - &*value.if_false, - Some(left.clone()), - )?) - } else { - Cell::new(<&Expression<'a>>::from_ast(scope, &*value.if_false, expected_type)?) - }; + let if_false = Cell::new(<&Expression<'a>>::from_ast(scope, &*value.if_false, expected_type)?); let right = if_false.get().get_type().unwrap().into(); if left != right { diff --git a/asg/src/statement/mod.rs b/asg/src/statement/mod.rs index 2ababe353c..e9da0f591b 100644 --- a/asg/src/statement/mod.rs +++ b/asg/src/statement/mod.rs @@ -95,7 +95,7 @@ impl<'a> FromAst<'a, leo_ast::Statement> for &'a Statement<'a> { scope, statement, None, )?)) } - Iteration(ref statement) => Self::from_ast(scope, &**statement, None)?, + Iteration(statement) => Self::from_ast(scope, &**statement, None)?, Console(statement) => scope .context .alloc_statement(Statement::Console(ConsoleStatement::from_ast(scope, statement, None)?)), diff --git a/ast/src/expression/circuit_member_access.rs b/ast/src/expression/circuit_member_access.rs index 8592a3f1b0..a86c5a85d1 100644 --- a/ast/src/expression/circuit_member_access.rs +++ b/ast/src/expression/circuit_member_access.rs @@ -21,7 +21,6 @@ pub struct CircuitMemberAccessExpression { pub circuit: Box, pub name: Identifier, pub span: Span, - pub type_: Option, } impl fmt::Display for CircuitMemberAccessExpression { diff --git a/ast/src/reducer/canonicalization.rs b/ast/src/reducer/canonicalization.rs index d657c17206..1f2ec23b74 100644 --- a/ast/src/reducer/canonicalization.rs +++ b/ast/src/reducer/canonicalization.rs @@ -76,7 +76,6 @@ impl Canonicalizer { circuit: left, name: identifier, span: span.clone(), - type_: None, })); } } @@ -271,7 +270,6 @@ impl Canonicalizer { circuit: Box::new(self.canonicalize_expression(&circuit_member_access.circuit)), name: circuit_member_access.name.clone(), span: circuit_member_access.span.clone(), - type_: None, }); } Expression::CircuitStaticFunctionAccess(circuit_static_func_access) => { diff --git a/ast/src/reducer/reconstructing_director.rs b/ast/src/reducer/reconstructing_director.rs index 129c6342f7..85e28c98f7 100644 --- a/ast/src/reducer/reconstructing_director.rs +++ b/ast/src/reducer/reconstructing_director.rs @@ -241,14 +241,9 @@ impl ReconstructingDirector { ) -> Result { let circuit = self.reduce_expression(&circuit_member_access.circuit)?; let name = self.reduce_identifier(&circuit_member_access.name)?; - let type_ = circuit_member_access - .type_ - .as_ref() - .map(|type_| self.reduce_type(type_, &circuit_member_access.span)) - .transpose()?; self.reducer - .reduce_circuit_member_access(circuit_member_access, circuit, name, type_) + .reduce_circuit_member_access(circuit_member_access, circuit, name) } pub fn reduce_circuit_static_fn_access( diff --git a/ast/src/reducer/reconstructing_reducer.rs b/ast/src/reducer/reconstructing_reducer.rs index 1a091857a4..36acacf7e3 100644 --- a/ast/src/reducer/reconstructing_reducer.rs +++ b/ast/src/reducer/reconstructing_reducer.rs @@ -215,13 +215,11 @@ pub trait ReconstructingReducer { circuit_member_access: &CircuitMemberAccessExpression, circuit: Expression, name: Identifier, - type_: Option, ) -> Result { Ok(CircuitMemberAccessExpression { circuit: Box::new(circuit), name, span: circuit_member_access.span.clone(), - type_, }) } diff --git a/compiler/src/phases/reducing_director.rs b/compiler/src/phases/reducing_director.rs index 1f9bb68952..380f6e577c 100644 --- a/compiler/src/phases/reducing_director.rs +++ b/compiler/src/phases/reducing_director.rs @@ -225,31 +225,17 @@ impl CombineAstAsgDirector { } pub fn reduce_call(&mut self, ast: &AstCallExpression, asg: &AsgCallExpression) -> Result { - let mut function = *ast.function.clone(); - - if self.options.type_inference_enabled() { - let function_type: Option = asg - .target - .get() - .map(|target| { - (target as &dyn leo_asg::ExpressionNode) - .get_type() - .as_ref() - .map(|t| t.into()) - }) - .flatten(); - if let AstExpression::CircuitMemberAccess(mut access) = function { - access.type_ = function_type; - function = AstExpression::CircuitMemberAccess(access); - } - } + // TODO FIGURE IT OUT + // let function = self.reduce_expression(&ast.function, asg.function.get())?; + // let target = asg.target.get().map(|exp| self.reduce_expression()) + // Is this needed? let mut arguments = vec![]; for (ast_arg, asg_arg) in ast.arguments.iter().zip(asg.arguments.iter()) { arguments.push(self.reduce_expression(ast_arg, asg_arg.get())?); } - self.ast_reducer.reduce_call(ast, function, arguments) + self.ast_reducer.reduce_call(ast, *ast.function.clone(), arguments) } pub fn reduce_cast(&mut self, ast: &AstCastExpression, asg: &AsgCastExpression) -> Result { @@ -262,19 +248,14 @@ impl CombineAstAsgDirector { pub fn reduce_circuit_member_access( &mut self, ast: &CircuitMemberAccessExpression, - asg: &AsgCircuitAccessExpression, + _asg: &AsgCircuitAccessExpression, ) -> Result { // let circuit = self.reduce_expression(&circuit_member_access.circuit)?; // let name = self.reduce_identifier(&circuit_member_access.name)?; // let target = input.target.get().map(|e| self.reduce_expression(e)); - let type_ = if self.options.type_inference_enabled() { - Some(leo_ast::Type::Circuit(asg.circuit.get().name.borrow().clone())) - } else { - None - }; self.ast_reducer - .reduce_circuit_member_access(ast, *ast.circuit.clone(), ast.name.clone(), type_) + .reduce_circuit_member_access(ast, *ast.circuit.clone(), ast.name.clone()) } pub fn reduce_circuit_static_fn_access( diff --git a/errors/Cargo.toml b/errors/Cargo.toml index 79da65dc14..362716882b 100644 --- a/errors/Cargo.toml +++ b/errors/Cargo.toml @@ -41,7 +41,7 @@ version = "0.3.61" version = "2.0" [dependencies.serde] -version = "1.0.128" +version = "1.0.126" features = [ "derive", "rc" ] [dependencies.tendril] diff --git a/parser/src/parser/expression.rs b/parser/src/parser/expression.rs index d9ebcfc944..d257da3718 100644 --- a/parser/src/parser/expression.rs +++ b/parser/src/parser/expression.rs @@ -452,7 +452,6 @@ impl ParserContext { span: expr.span() + &ident.span, circuit: Box::new(expr), name: ident, - type_: None, }); } else if let Some((num, span)) = self.eat_int() { expr = Expression::TupleAccess(TupleAccessExpression { diff --git a/tests/compiler/statements/inputs/ternary_explicit_and_implicit.in b/tests/compiler/statements/inputs/ternary_explicit_and_implicit.in deleted file mode 100644 index ef82e41af8..0000000000 --- a/tests/compiler/statements/inputs/ternary_explicit_and_implicit.in +++ /dev/null @@ -1,6 +0,0 @@ -[main] -x: u8 = 3; -y: bool = true; - -[registers] -a: u8 = 0; \ No newline at end of file diff --git a/tests/compiler/statements/ternary_explicit_and_implicit.leo b/tests/compiler/statements/ternary_explicit_and_implicit.leo deleted file mode 100644 index d092bc2928..0000000000 --- a/tests/compiler/statements/ternary_explicit_and_implicit.leo +++ /dev/null @@ -1,9 +0,0 @@ -/* -namespace: Compile -expectation: Pass -input_file: inputs/ternary_explicit_and_implicit.in -*/ - -function main(x: u8, y: bool) -> u8 { - return y ? x : 2; -} diff --git a/tests/expectations/compiler/compiler/array/complex_access.leo.out b/tests/expectations/compiler/compiler/array/complex_access.leo.out index 4cd59df22f..d3cd24862e 100644 --- a/tests/expectations/compiler/compiler/array/complex_access.leo.out +++ b/tests/expectations/compiler/compiler/array/complex_access.leo.out @@ -16,6 +16,6 @@ outputs: out: type: bool value: "true" - initial_ast: 9a4630fa0959a626a26800f00d05a203e35f4389a9d17a6dc491eb725ef3a529 - canonicalized_ast: 6c7df16234b6b4d8aaa6ca1d761bcffb5b05893cc515b6f4d72118bc8e495b7e - type_inferenced_ast: 4aa60801f15fb817e16eb9f9bd4d6bed555c9130d88edebb3ba78302879703a1 + initial_ast: 589670c04ad13f8dbe2ea01562fa6bdff1c6dfaf118730e60d0a55e5bb2168b9 + canonicalized_ast: 82fd732401abaced235b6522298a454fd0491ea1dc0a80170773e1a129320657 + type_inferenced_ast: 14321d2bd1a2d9da60f52372feee4c8bf6aa98d516c01bf309d219c903b7f241 diff --git a/tests/expectations/compiler/compiler/array/registers.leo.out b/tests/expectations/compiler/compiler/array/registers.leo.out index 6d859f9cb0..f03de935e4 100644 --- a/tests/expectations/compiler/compiler/array/registers.leo.out +++ b/tests/expectations/compiler/compiler/array/registers.leo.out @@ -22,6 +22,6 @@ outputs: r: type: "[u8; 3]" value: "\"123\"" - initial_ast: 1c07965336635dce8cd66c67eddf25a51f61a3b90513f87ef123c642a9b5b18a - canonicalized_ast: 1c07965336635dce8cd66c67eddf25a51f61a3b90513f87ef123c642a9b5b18a - type_inferenced_ast: cf35fa9ca18f19ac75ca522a77e310b02ff56ac1d748cd5df5c2204bba4a4802 + initial_ast: c6b18b6fca7fda77a9eba151f4d27d084e1ad7aa616e6ec9deb1ef5f4bff2d24 + canonicalized_ast: c6b18b6fca7fda77a9eba151f4d27d084e1ad7aa616e6ec9deb1ef5f4bff2d24 + type_inferenced_ast: 6f6e6b35b55543bc87589005ac9a47830e3f65680a4db82e3f17d9280d6fa4ad diff --git a/tests/expectations/compiler/compiler/char/circuit.leo.out b/tests/expectations/compiler/compiler/char/circuit.leo.out index baf73f9b0a..727dce531b 100644 --- a/tests/expectations/compiler/compiler/char/circuit.leo.out +++ b/tests/expectations/compiler/compiler/char/circuit.leo.out @@ -100,6 +100,6 @@ outputs: r: type: char value: "'\\u{1f62d}'" - initial_ast: 715a33d0032f02d69d13687ac98005a789b6bcb63ff619865b21f0c691f14a75 - canonicalized_ast: 715a33d0032f02d69d13687ac98005a789b6bcb63ff619865b21f0c691f14a75 - type_inferenced_ast: d04164068277e88b5529f1072b512ffadc7eaaf704c8a3e394a409e783cc1e27 + initial_ast: aa3eb0c4de0eebada9490b11e35c36923316559727a3afce28fe3852a805354a + canonicalized_ast: aa3eb0c4de0eebada9490b11e35c36923316559727a3afce28fe3852a805354a + type_inferenced_ast: 73309200d30bf2831847477f3da7ede4ba9f4aa377e6ebf15c9c34774f53bcb5 diff --git a/tests/expectations/compiler/compiler/circuits/big_self_in_circuit_replacement.leo.out b/tests/expectations/compiler/compiler/circuits/big_self_in_circuit_replacement.leo.out index 11d7c42755..25c76f1edc 100644 --- a/tests/expectations/compiler/compiler/circuits/big_self_in_circuit_replacement.leo.out +++ b/tests/expectations/compiler/compiler/circuits/big_self_in_circuit_replacement.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: bc330763338677f23601b03f5665bd8f42f8143f59cc9b4803fb693b3cfa0311 - canonicalized_ast: fbff610ef772ee7f997b4bc4cd7c2a3f2024d70af35b94a966ca6a0f19f15194 - type_inferenced_ast: f6b0159f6bffeff8e3cde7f13c97ac5d537b40855271a4a13d07a84d24d78504 + initial_ast: 776ea4bb946bb5d56430c22be58f3539dbecb25a11ec07e5e8bd3db49be7f937 + canonicalized_ast: 6a95acbcb25193b7b9f9e7a2bbcaeafa83ec09163e097b12076ea512a9daaf14 + type_inferenced_ast: d71ab34660bf998f236dfe59e55050f9f5fba8671bacbbdde04b4902927ec571 diff --git a/tests/expectations/compiler/compiler/circuits/const_self_variable.leo.out b/tests/expectations/compiler/compiler/circuits/const_self_variable.leo.out index 9261e9d0ff..cd5036c8e5 100644 --- a/tests/expectations/compiler/compiler/circuits/const_self_variable.leo.out +++ b/tests/expectations/compiler/compiler/circuits/const_self_variable.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 601fb882472ee0ff4aea3330822936a9df64bfc8ceefcd83f000bb3094878d47 - canonicalized_ast: 601fb882472ee0ff4aea3330822936a9df64bfc8ceefcd83f000bb3094878d47 - type_inferenced_ast: 110a4e51c4c0ace6c0f3aa385e1735cb4ecf3cfea2a9d2ab7591da3826582c31 + initial_ast: b438fb664bd7b8683beabd5044efba7669d3fcab093994b1c386a30ad63fff14 + canonicalized_ast: b438fb664bd7b8683beabd5044efba7669d3fcab093994b1c386a30ad63fff14 + type_inferenced_ast: 9094424be690a804ae2e5d3ca2787104de01dc6bca89fe6d349db5709c5161ac diff --git a/tests/expectations/compiler/compiler/circuits/define_circuit_inside_circuit_function.leo.out b/tests/expectations/compiler/compiler/circuits/define_circuit_inside_circuit_function.leo.out index 8ec377987f..cc4b1e0369 100644 --- a/tests/expectations/compiler/compiler/circuits/define_circuit_inside_circuit_function.leo.out +++ b/tests/expectations/compiler/compiler/circuits/define_circuit_inside_circuit_function.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 63f34a3b537f3221e8711828f7d0953c0766627c0cdb2e37933b88a93550e261 - canonicalized_ast: 63f34a3b537f3221e8711828f7d0953c0766627c0cdb2e37933b88a93550e261 - type_inferenced_ast: 29604fd57ee8658f83e552bc6496541ebcebb91afa313a1706b285fe18385c4c + initial_ast: 7221141253b1998cbddad5f0c1385e7b53450a535112c0eb112b5af01474ce20 + canonicalized_ast: 7221141253b1998cbddad5f0c1385e7b53450a535112c0eb112b5af01474ce20 + type_inferenced_ast: f208046c46de9c4a42c47079504791711c9b0c8b3fb35dd413243fcbfd7dbd90 diff --git a/tests/expectations/compiler/compiler/circuits/inline.leo.out b/tests/expectations/compiler/compiler/circuits/inline.leo.out index ed4bcd5da5..f5649f0b60 100644 --- a/tests/expectations/compiler/compiler/circuits/inline.leo.out +++ b/tests/expectations/compiler/compiler/circuits/inline.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: u32 value: "100" - initial_ast: c76bd461573b9bb3622a74b5c5a10a98402b8c86c13086c01c161b77aac0c642 - canonicalized_ast: c76bd461573b9bb3622a74b5c5a10a98402b8c86c13086c01c161b77aac0c642 - type_inferenced_ast: 213f747571838133c62a73574f769d25fd42afce151e580be42d1d9d7b62033b + initial_ast: ba821e922e3b934581e39a58e2ef08d14b6cb0355500ed79f017dc0ecd39651c + canonicalized_ast: ba821e922e3b934581e39a58e2ef08d14b6cb0355500ed79f017dc0ecd39651c + type_inferenced_ast: 03fadaa1772f83ffa18a67a2279a65bad0715a6077f7219ff8955b45707c0437 diff --git a/tests/expectations/compiler/compiler/circuits/inline_member_pass.leo.out b/tests/expectations/compiler/compiler/circuits/inline_member_pass.leo.out index 4ee319c61d..024e4f07b1 100644 --- a/tests/expectations/compiler/compiler/circuits/inline_member_pass.leo.out +++ b/tests/expectations/compiler/compiler/circuits/inline_member_pass.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 3b07cdd6e203ad5775a6c75a4598330e4bf7b04616bdbd532df20bd7bba1981d - canonicalized_ast: f87f269c06e5eb1d6802b4a92c9a4af2a3966583dbaa2454b5468b3f56114a15 - type_inferenced_ast: 73ed7092d40d9b7e5be744e14da191eaa7f0758b6027c7e984365bd33e07ae2d + initial_ast: 58d028cbd020f04ef3b1025a07dabbc8bc4f5a2adf7e2ca4bb67cc229d4f64cd + canonicalized_ast: 5e72d67df40e8ecd2ae9999419888ade6ebf1c054f1f80f91a274360e294d361 + type_inferenced_ast: 177f3be4bed2ca8e1a9543b8bb71a75a751d6835dcac15910bc4bd5fa9e25897 diff --git a/tests/expectations/compiler/compiler/circuits/member_function.leo.out b/tests/expectations/compiler/compiler/circuits/member_function.leo.out index 23b1484e46..0f4bb0e507 100644 --- a/tests/expectations/compiler/compiler/circuits/member_function.leo.out +++ b/tests/expectations/compiler/compiler/circuits/member_function.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: b53c2c321c3f6ee2202eaca1e709607f5e82f9e456be132b08493de57b1c4089 - canonicalized_ast: b53c2c321c3f6ee2202eaca1e709607f5e82f9e456be132b08493de57b1c4089 - type_inferenced_ast: a94dfe431aa43189323427aadb33120d4ac03e19b9a898353858c26b624869ed + initial_ast: 681bcdc031155971ce0dab8c8ee659df3f09b97b4e6b4525d47f4a045765a57c + canonicalized_ast: 681bcdc031155971ce0dab8c8ee659df3f09b97b4e6b4525d47f4a045765a57c + type_inferenced_ast: 40920da878d0316ea8fd4d1963e53843b1d8933441fd568adba5f11e4ded7246 diff --git a/tests/expectations/compiler/compiler/circuits/member_function_nested.leo.out b/tests/expectations/compiler/compiler/circuits/member_function_nested.leo.out index 6760a49a72..7869be8c61 100644 --- a/tests/expectations/compiler/compiler/circuits/member_function_nested.leo.out +++ b/tests/expectations/compiler/compiler/circuits/member_function_nested.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 8b7192c1472be002b294589105832ae0e979e964fc62e63ba22b1f0cf3b762e5 - canonicalized_ast: 8b7192c1472be002b294589105832ae0e979e964fc62e63ba22b1f0cf3b762e5 - type_inferenced_ast: 14d9f0f0a222b6ec4236b0eb75e0740d624279181bb7ab9281752529b0a0f417 + initial_ast: 05ea77fc193abe91954fc2fcd338d3ebfaff6bb7939339e9dcc78e514802dd42 + canonicalized_ast: 05ea77fc193abe91954fc2fcd338d3ebfaff6bb7939339e9dcc78e514802dd42 + type_inferenced_ast: 9827f4b622a95714f55620295e8ce9d9cf6fc85603a869b178825c818d64d768 diff --git a/tests/expectations/compiler/compiler/circuits/member_variable.leo.out b/tests/expectations/compiler/compiler/circuits/member_variable.leo.out index b048ef8625..ff6d455507 100644 --- a/tests/expectations/compiler/compiler/circuits/member_variable.leo.out +++ b/tests/expectations/compiler/compiler/circuits/member_variable.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 7abdf292d56f99ef05e39c1a55a6071d9d69ca8c8e537e08201472f057e7a127 - canonicalized_ast: 7abdf292d56f99ef05e39c1a55a6071d9d69ca8c8e537e08201472f057e7a127 - type_inferenced_ast: db8685abd4ffc32fa55786b847eff1d0694b871c1757eec70757879d82856872 + initial_ast: 0723285d6c4dac924f6c86e0a6fd57eb78947cfcecd45f2520b7b0f0029f3279 + canonicalized_ast: 0723285d6c4dac924f6c86e0a6fd57eb78947cfcecd45f2520b7b0f0029f3279 + type_inferenced_ast: c42738de8987ca76cacc30dbf86688ff11d5dbf7dccba67947cc78eb452460fd diff --git a/tests/expectations/compiler/compiler/circuits/member_variable_and_function.leo.out b/tests/expectations/compiler/compiler/circuits/member_variable_and_function.leo.out index 17d2be5676..402638f498 100644 --- a/tests/expectations/compiler/compiler/circuits/member_variable_and_function.leo.out +++ b/tests/expectations/compiler/compiler/circuits/member_variable_and_function.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: ca98bec50adc76ce348e28e7020d6e99cb6aa8fb733e0e0bce023ca8d1e3e4b6 - canonicalized_ast: ca98bec50adc76ce348e28e7020d6e99cb6aa8fb733e0e0bce023ca8d1e3e4b6 - type_inferenced_ast: ec5aad932c3d0d016142a7d288328547949da8add55025076c5d404d2451917d + initial_ast: bbad7fd765dee42c9ebaca7e07201d61befefa5e7d5af700130954ac29cdd27c + canonicalized_ast: bbad7fd765dee42c9ebaca7e07201d61befefa5e7d5af700130954ac29cdd27c + type_inferenced_ast: cb8745ad419c19ad007a9d9d905f01c0d85d2e78cb82be0b82342c44015c322e diff --git a/tests/expectations/compiler/compiler/circuits/mut_self_variable.leo.out b/tests/expectations/compiler/compiler/circuits/mut_self_variable.leo.out index 82325e1425..4dbac2b20a 100644 --- a/tests/expectations/compiler/compiler/circuits/mut_self_variable.leo.out +++ b/tests/expectations/compiler/compiler/circuits/mut_self_variable.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: a9313db75382b5afb38e9453bdb0dd6c0aa7368cf11e208eb0ca8124ea615d8b - canonicalized_ast: 3d4bb330e687601978d3f68544582d93c3bace6c0d3e8808c409b8534c563403 - type_inferenced_ast: 14b0aa9c6d83ca85c625cdc78e4cf96dcbe1672b98c379e8783744d59d699bb1 + initial_ast: d2d5680f0e011b93b2e55aebb62f51b4e78cf68289ffd84a80f852d2a82a6723 + canonicalized_ast: 57c2e52b3f73e7052fdc92d0c668b598b282321cd390ed836f20b92bc528b6e0 + type_inferenced_ast: 4f8c32d94398d49ffb9b1eab3639076e77d77159411c1891d814b4946751e554 diff --git a/tests/expectations/compiler/compiler/circuits/mut_self_variable_branch.leo.out b/tests/expectations/compiler/compiler/circuits/mut_self_variable_branch.leo.out index ed07a0a376..301d38f9ac 100644 --- a/tests/expectations/compiler/compiler/circuits/mut_self_variable_branch.leo.out +++ b/tests/expectations/compiler/compiler/circuits/mut_self_variable_branch.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: ff029cd4035cb046857e7e8c0ff56c843969d2f04db76ced2698a20cf0491485 - canonicalized_ast: 88447a6c1f7b92f4af7d9cecd7fd8d6fa5e96ed5dd6c6fde5897cf3df3f5cbc5 - type_inferenced_ast: 51a081de631b9b95b2055ea5ba6a52d17972caf8bf7c70dadd49801af9d011f9 + initial_ast: 15da2283babf7f4a490bd7bdc0331522107f7ce4c88949863178ba4a00419ead + canonicalized_ast: 96a167f8b897e9973bb7b9d13faa81da0b635a6611ef09124a5d12f817b35254 + type_inferenced_ast: 82c54a8e54820fc234a7029cb4c6018df99e7a3d4b47f418efc8835889b1c6cc diff --git a/tests/expectations/compiler/compiler/circuits/mut_self_variable_conditional.leo.out b/tests/expectations/compiler/compiler/circuits/mut_self_variable_conditional.leo.out index eb9e16f4fd..b9b10201cb 100644 --- a/tests/expectations/compiler/compiler/circuits/mut_self_variable_conditional.leo.out +++ b/tests/expectations/compiler/compiler/circuits/mut_self_variable_conditional.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 5d815c98c76a76dd93051902eae718df3db66e0268ba9af8ae62ef7af19b1d48 - canonicalized_ast: 798961ad9da5a767a98882ff36944483f1f1412dcf10f67acf1f390a19bfc138 - type_inferenced_ast: 6dbfd429fa50f0017a01dae57ae2a98e7452ab7c54bfcd251e1ed40e5f28176c + initial_ast: 6fd3b11431e3e71f2b628bc9c64cb51d04c77df08d7584503b76b3dff7bc90cc + canonicalized_ast: a7a942a8a40f7cf8bfd79fdea0ed81fb6b56cfd9009b01b3d0225b427ef583cd + type_inferenced_ast: d3cc0e19adac957e11d520bf727133bfcc85eef5f306373cb5057b840b1a41f6 diff --git a/tests/expectations/compiler/compiler/circuits/mut_variable.leo.out b/tests/expectations/compiler/compiler/circuits/mut_variable.leo.out index 23dca1d641..8afebb1042 100644 --- a/tests/expectations/compiler/compiler/circuits/mut_variable.leo.out +++ b/tests/expectations/compiler/compiler/circuits/mut_variable.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 357f19fd5e1fbbbeec8a18bcf14c30a7504feacbc88ffbd26e78eedf1d593275 - canonicalized_ast: 357f19fd5e1fbbbeec8a18bcf14c30a7504feacbc88ffbd26e78eedf1d593275 - type_inferenced_ast: aa3bf1734030119bb595a42d268b30509506ee06cf413b14bcde4e9056679dac + initial_ast: 48713617e0f06ade7b443ec779e646b0ff82e025f040c8a28bf2ea7eb37f3399 + canonicalized_ast: 48713617e0f06ade7b443ec779e646b0ff82e025f040c8a28bf2ea7eb37f3399 + type_inferenced_ast: 68e4f8baf01d452f42d0765f2819783adb55000238d5d57304a314fb5cff3c22 diff --git a/tests/expectations/compiler/compiler/circuits/mutable_call_immutable_context.leo.out b/tests/expectations/compiler/compiler/circuits/mutable_call_immutable_context.leo.out index 6dcfa937a1..5f12f27e1c 100644 --- a/tests/expectations/compiler/compiler/circuits/mutable_call_immutable_context.leo.out +++ b/tests/expectations/compiler/compiler/circuits/mutable_call_immutable_context.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: bb1ea12ac46ffd912b45b6febd71de41691c9aa064d07d5492e31845e72d00f2 - canonicalized_ast: ad957837a54fca62c6da8665a04dbf57cb87b5c5a000038a1b900c2be359a178 - type_inferenced_ast: 0fe1f5ac625424734a5140253228e3a6cde9f548b6deb18907f3ac49871180cc + initial_ast: 2f6262df5e4a39a662b85cff0985d297fa2628d56fc3c036b5beb31d683a8574 + canonicalized_ast: 4bb2ac425c192058af2f97684019d74959bc40abc0f886a741894a89cc8e8d4f + type_inferenced_ast: 6c3c3d16ba595ab33902ece671d2460c3a25347e1e33e35ec82ff8622926afd2 diff --git a/tests/expectations/compiler/compiler/circuits/pedersen_mock.leo.out b/tests/expectations/compiler/compiler/circuits/pedersen_mock.leo.out index 60234864fe..d77bccc2b7 100644 --- a/tests/expectations/compiler/compiler/circuits/pedersen_mock.leo.out +++ b/tests/expectations/compiler/compiler/circuits/pedersen_mock.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 41a569090cff5eba31d9640b3f9e8d8585dfcd817d25a42a48edcd2d522fbb72 - canonicalized_ast: 5150d7b2463ec10096f925fde523a4b956093ca44579487a82f15554fd7c32ed - type_inferenced_ast: 71d1f128ff9c4fa1df5189139360f4ccb3a460e83034c635952e6875c7fe41bb + initial_ast: 591aa0cc25f8c009c7df6425697003904e97e74c55f887c5ed3b27984fda4176 + canonicalized_ast: 7232353691a314166deb747de9046b05e507b581d35132479b01c6db41e72df6 + type_inferenced_ast: ae5cb090082e845a9a058a15de6345a672864bf2ad2061930922475cc2c3f8e1 diff --git a/tests/expectations/compiler/compiler/circuits/self_member.leo.out b/tests/expectations/compiler/compiler/circuits/self_member.leo.out index cbe4c9f992..d51b0bc9b9 100644 --- a/tests/expectations/compiler/compiler/circuits/self_member.leo.out +++ b/tests/expectations/compiler/compiler/circuits/self_member.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 5627039d5f3151255d4c7fff31fa548febc788fe2717606a4814a91937fee405 - canonicalized_ast: 5627039d5f3151255d4c7fff31fa548febc788fe2717606a4814a91937fee405 - type_inferenced_ast: 88e398f6f173de48fb7a6109fe886fd59b2fae70d1b9ccc53fd447d9b46ad0a3 + initial_ast: 6b54a642c55d3a7991a063c5346797a4d7facf21533c8ec7b2e22eb9394caba0 + canonicalized_ast: 6b54a642c55d3a7991a063c5346797a4d7facf21533c8ec7b2e22eb9394caba0 + type_inferenced_ast: 5b4b8ea9431aca05e19fcf8987c4f4c824c065e2ed6fc7198cd769b8829ee4f1 diff --git a/tests/expectations/compiler/compiler/function/multiple_returns_main.leo.out b/tests/expectations/compiler/compiler/function/multiple_returns_main.leo.out index 3743c4a177..208288b578 100644 --- a/tests/expectations/compiler/compiler/function/multiple_returns_main.leo.out +++ b/tests/expectations/compiler/compiler/function/multiple_returns_main.leo.out @@ -19,6 +19,6 @@ outputs: r1: type: bool value: "true" - initial_ast: db801c467c6e6bd413b951d6a8f95e841e0254a3f00a3e1ff903ab2dcd63b253 - canonicalized_ast: db801c467c6e6bd413b951d6a8f95e841e0254a3f00a3e1ff903ab2dcd63b253 - type_inferenced_ast: 575c9b880a4a061bce5ace598d6d4195ca0f41278afc2b1a950c74052b2b9cef + initial_ast: f982480cc10a58594b1ed75be2d2dcd29ed874fa666497f2c14b58c338a4443f + canonicalized_ast: f982480cc10a58594b1ed75be2d2dcd29ed874fa666497f2c14b58c338a4443f + type_inferenced_ast: f70e1d694f99f56777ac863e764615c6bc496ebb4f476c2faf8356e9246f4d24 diff --git a/tests/expectations/compiler/compiler/global_consts/global_const_types.leo.out b/tests/expectations/compiler/compiler/global_consts/global_const_types.leo.out index c5b40f6b38..bfc4883877 100644 --- a/tests/expectations/compiler/compiler/global_consts/global_const_types.leo.out +++ b/tests/expectations/compiler/compiler/global_consts/global_const_types.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "false" - initial_ast: d8d093539faee853421ce529aec6b222a651c494ca9f2a6eb4faafc443bbc02d - canonicalized_ast: 0556a49c8e1ef663c4428d9c5c315dcfa0721a000d0d482bc10f9c164ef1a4de - type_inferenced_ast: bb15e2202bb322be9f823823c780b5771854cebc311f107d51a88d0e601fa41e + initial_ast: 97024a9c26e890afe8f4dc64b727a72e837f46b27ff56cddc1231c29671dc2b4 + canonicalized_ast: 8674af05f953dfda5eb360e367447912e9d0ec5abf513eaba14444bd66bd9cae + type_inferenced_ast: 33017f3824095dcb4431f73db16a3fe1e845d30d7a6366182b247a23445eb26d diff --git a/tests/expectations/compiler/compiler/input_files/program_input_and_program_state/basic.leo.out b/tests/expectations/compiler/compiler/input_files/program_input_and_program_state/basic.leo.out index 8bcc498211..1b01d3a1c3 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input_and_program_state/basic.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_input_and_program_state/basic.leo.out @@ -16,6 +16,6 @@ outputs: b: type: bool value: "true" - initial_ast: 2e0d03e2ad668ec5149102d0f9de870d0b3d263fb5c460471db913b5c15e153b - canonicalized_ast: 2e0d03e2ad668ec5149102d0f9de870d0b3d263fb5c460471db913b5c15e153b - type_inferenced_ast: ab37500c6660ca13113fe642160046179b9713d848ab712cd1c57b6e82ac7916 + initial_ast: 2cfed669110dc972ec11a67149117c6dd2f4d09d7791d7d3cdfe334c32bfc3eb + canonicalized_ast: 2cfed669110dc972ec11a67149117c6dd2f4d09d7791d7d3cdfe334c32bfc3eb + type_inferenced_ast: 4df0dad517cafd4f8f4e9a9717e0b4d3decd2c07091338cd65fe97fdcc5e8778 diff --git a/tests/expectations/compiler/compiler/input_files/program_input_and_program_state/token_withdraw.leo.out b/tests/expectations/compiler/compiler/input_files/program_input_and_program_state/token_withdraw.leo.out index 96eda6bbd7..f3559fa361 100644 --- a/tests/expectations/compiler/compiler/input_files/program_input_and_program_state/token_withdraw.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_input_and_program_state/token_withdraw.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 7c42b985a3e0013f38398639442535e6f40af6f379d9af65387e707cd97fb146 - canonicalized_ast: 7c42b985a3e0013f38398639442535e6f40af6f379d9af65387e707cd97fb146 - type_inferenced_ast: aeb12c856d7aa61002723056fc228fa4d342076b7c2bac597269f426a29a4cb2 + initial_ast: 2a87c1d20941f840d6e6535b0145568e8aea7f87466c5e313329e3844efeef82 + canonicalized_ast: 2a87c1d20941f840d6e6535b0145568e8aea7f87466c5e313329e3844efeef82 + type_inferenced_ast: 34a0270bb47f0ba1b72f8789a1223084b6719933dd937f6703759502ace7a346 diff --git a/tests/expectations/compiler/compiler/input_files/program_state/access_all.leo.out b/tests/expectations/compiler/compiler/input_files/program_state/access_all.leo.out index 3c62376b0f..e53c68cb4a 100644 --- a/tests/expectations/compiler/compiler/input_files/program_state/access_all.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_state/access_all.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 9cca50f35319c4b4e776c170a2936cb7e0a82c2d458bd725a282f1eaa3f01391 - canonicalized_ast: 9cca50f35319c4b4e776c170a2936cb7e0a82c2d458bd725a282f1eaa3f01391 - type_inferenced_ast: d75b58e775d20e72834683792cbf09339bb9f07ce05501d0331026cc0fe859cf + initial_ast: 6fd4f46e0a795fd0edef840925c6a152c8b69685f30b42b1dc5aeaf2e0f1296a + canonicalized_ast: 6fd4f46e0a795fd0edef840925c6a152c8b69685f30b42b1dc5aeaf2e0f1296a + type_inferenced_ast: ad948d43d662198b33e752ac1c20807b5d79525c4cc61f15d41155f31ade71c4 diff --git a/tests/expectations/compiler/compiler/input_files/program_state/access_state.leo.out b/tests/expectations/compiler/compiler/input_files/program_state/access_state.leo.out index 56a1a0a81d..e5a5c707d0 100644 --- a/tests/expectations/compiler/compiler/input_files/program_state/access_state.leo.out +++ b/tests/expectations/compiler/compiler/input_files/program_state/access_state.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 21381595616fc58e28df26f9c89b4cddcd8219703cd877523c55c80617288e07 - canonicalized_ast: 21381595616fc58e28df26f9c89b4cddcd8219703cd877523c55c80617288e07 - type_inferenced_ast: 981b4059bbf5feaa39719dfd802585fca3ee841c3e78792eb7b68470a015a41a + initial_ast: 14d707805bc7e51b4b01dc9272ce7e7f1018c52a885a14177acb4e7ca34174f5 + canonicalized_ast: 14d707805bc7e51b4b01dc9272ce7e7f1018c52a885a14177acb4e7ca34174f5 + type_inferenced_ast: b399e663877ab10bb59844997e4a6a94e53c67cec20112a125906087a91f3a32 diff --git a/tests/expectations/compiler/compiler/mutability/circuit_function_mut.leo.out b/tests/expectations/compiler/compiler/mutability/circuit_function_mut.leo.out index a0dc3d36ae..fe01ab791e 100644 --- a/tests/expectations/compiler/compiler/mutability/circuit_function_mut.leo.out +++ b/tests/expectations/compiler/compiler/mutability/circuit_function_mut.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: f98b76f43ddfdf48c6ae59d240f8cc5435af4af4d858b42a215b6c7cdc62cbe0 - canonicalized_ast: 9322ad9c85e77f9491596f2edf8fbe28e1843e79467a26c700adc1674362cc81 - type_inferenced_ast: f1ca7540ea64649a3b8fa23be49593b001eb6b46be162701481d2bad4b2fea09 + initial_ast: afde0187f805e33f804917815a52421a2662aa029b182be76c39f4ce5f3f453a + canonicalized_ast: 9dfd8d93fa20899e9d146d65b2564f1275cfb73158d8d96ed09f7157ff327e39 + type_inferenced_ast: e59a2cba730871aba6258b78f469b9df7763f8d78ad6bbda5c6026a989bc3d88 diff --git a/tests/expectations/compiler/compiler/mutability/circuit_variable_mut.leo.out b/tests/expectations/compiler/compiler/mutability/circuit_variable_mut.leo.out index e8d582d714..2658736d93 100644 --- a/tests/expectations/compiler/compiler/mutability/circuit_variable_mut.leo.out +++ b/tests/expectations/compiler/compiler/mutability/circuit_variable_mut.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 1341a7e36aa9a9d76d032b4245ac4cecf8c62938cd921be44fc13a736cd21daf - canonicalized_ast: 1341a7e36aa9a9d76d032b4245ac4cecf8c62938cd921be44fc13a736cd21daf - type_inferenced_ast: 3e10385fa57b142f27bf8b9d9141ca83fece80755ac4643743f9db3824817750 + initial_ast: db9400fc979f1cfd8eea30945594b0e8d2f4138bb32021b9086021b492e2e246 + canonicalized_ast: db9400fc979f1cfd8eea30945594b0e8d2f4138bb32021b9086021b492e2e246 + type_inferenced_ast: 24783ef52315a02bb2f2e34f5a4020f09f4573ae6d182cab699bf45235e1c4a3 diff --git a/tests/expectations/compiler/compiler/statements/assign_ternary.leo.out b/tests/expectations/compiler/compiler/statements/assign_ternary.leo.out index 9a641be8e0..659cb7e8b4 100644 --- a/tests/expectations/compiler/compiler/statements/assign_ternary.leo.out +++ b/tests/expectations/compiler/compiler/statements/assign_ternary.leo.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EASG0373026]: unexpected type, expected: 'u32', received: 'bool'\n --> compiler-test:4:23\n |\n 4 | let x = true ? x: true;\n | ^^^^" + - "Error [EASG0373021]: ternary sides had different types: left u32, right bool\n --> compiler-test:4:13\n |\n 4 | let x = true ? x: true;\n | ^^^^^^^^^^^^^^" diff --git a/tests/expectations/compiler/compiler/statements/compound_assignment.leo.out b/tests/expectations/compiler/compiler/statements/compound_assignment.leo.out index 5d973b2ebf..c171430d72 100644 --- a/tests/expectations/compiler/compiler/statements/compound_assignment.leo.out +++ b/tests/expectations/compiler/compiler/statements/compound_assignment.leo.out @@ -16,6 +16,6 @@ outputs: r0: type: bool value: "true" - initial_ast: 39a18b43d3d5a65507b9a4bc6558efe27509fa16006de6a98a47c67b6085667c - canonicalized_ast: 25c0175f87357fe5a14e48159c69eb636bfd6836706203d0a30dfbd0ccf9fff3 - type_inferenced_ast: ef74c4307c4124ce11ed81e98e0cc555a306c94505d7e40025e66655dac155a8 + initial_ast: b260517dc70a401c68acfc09bd6434b55b61446e27bd940ad339987eb22ff85e + canonicalized_ast: eb5f37501878e5f97180a6f289f29795e09cb2da6fb031ed7ccb83681b407123 + type_inferenced_ast: 3abe1f8136d17844e2d11db603945fc06365cf91b51b9df0a2f700be94df8766 diff --git a/tests/expectations/compiler/compiler/statements/ternary_explicit_and_implicit.leo.out b/tests/expectations/compiler/compiler/statements/ternary_explicit_and_implicit.leo.out deleted file mode 100644 index 2486b2233d..0000000000 --- a/tests/expectations/compiler/compiler/statements/ternary_explicit_and_implicit.leo.out +++ /dev/null @@ -1,21 +0,0 @@ ---- -namespace: Compile -expectation: Pass -outputs: - - circuit: - num_public_variables: 0 - num_private_variables: 25 - num_constraints: 33 - at: 00318b0f80b01b9e2d5a8154a536deb1545f04abd493a84071ef13dce1a9d92d - bt: 799ee4dc07f6320b8c3dcbd5ebdf6de8a4cf5af8b1edc45dbe5621c8a34fa38d - ct: 7b6ec9eacd65cfa47dfe7e73eb7c8fa4be804a9fb878fddf59fe5d06e7c04489 - output: - - input_file: inputs/ternary_explicit_and_implicit.in - output: - registers: - a: - type: u8 - value: "3" - initial_ast: 29b5d6188c9fe56eaee3024a900b92e4bd9445364551b85e924fe9a392bac35d - canonicalized_ast: 29b5d6188c9fe56eaee3024a900b92e4bd9445364551b85e924fe9a392bac35d - type_inferenced_ast: 02edde30e615a1ac3e87818daa6fca7e4d7c0c0c0a1a9d9159a0a4190c11ec8a diff --git a/tests/expectations/compiler/compiler/string/circuit.leo.out b/tests/expectations/compiler/compiler/string/circuit.leo.out index b047ba8a7f..00776b17f3 100644 --- a/tests/expectations/compiler/compiler/string/circuit.leo.out +++ b/tests/expectations/compiler/compiler/string/circuit.leo.out @@ -16,6 +16,6 @@ outputs: out: type: "[char; 13]" value: "\"Hello, World!\"" - initial_ast: 70c3f622477262389299233a81c02174f0af3c99eb9aea42c2be73f191f44673 - canonicalized_ast: e8a3e9c427681a58127b088b0053cbc2f80c859a7081636fceb59dd0cc6cfee7 - type_inferenced_ast: db96adeedf84f21908b53bd7db4c4941396afc5fe592012109069186fa066b1a + initial_ast: 3ece39236ca03d9f6e4a89ae1a5f27cdbc8036eb1485913a2043d1e0a44beb3c + canonicalized_ast: b3df972e5b9658b6addba6f82e972043620a591f5981ac009b56fb6965742695 + type_inferenced_ast: 22fdc2ba01f04dbe8140df231d6f8c77ad4b5e62a12dfb45a67686830ebee455 diff --git a/tests/expectations/parser/parser/expression/access/array_range_access.leo.out b/tests/expectations/parser/parser/expression/access/array_range_access.leo.out index 75b88359a2..01765075b3 100644 --- a/tests/expectations/parser/parser/expression/access/array_range_access.leo.out +++ b/tests/expectations/parser/parser/expression/access/array_range_access.leo.out @@ -280,7 +280,6 @@ outputs: col_stop: 6 path: "" content: "x[x.y..]" - type_: ~ right: ~ span: line_start: 1 @@ -305,7 +304,6 @@ outputs: col_stop: 8 path: "" content: "x[..y.x]" - type_: ~ span: line_start: 1 line_stop: 1 @@ -328,7 +326,6 @@ outputs: col_stop: 6 path: "" content: "x[x.y..y.x]" - type_: ~ right: CircuitMemberAccess: circuit: @@ -341,7 +338,6 @@ outputs: col_stop: 11 path: "" content: "x[x.y..y.x]" - type_: ~ span: line_start: 1 line_stop: 1 @@ -366,7 +362,6 @@ outputs: col_stop: 6 path: "" content: "x[x.y.x..y.x.y]" - type_: ~ name: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x.y.x..y.x.y]\\\"}\"}" span: line_start: 1 @@ -375,7 +370,6 @@ outputs: col_stop: 8 path: "" content: "x[x.y.x..y.x.y]" - type_: ~ right: CircuitMemberAccess: circuit: @@ -390,7 +384,6 @@ outputs: col_stop: 13 path: "" content: "x[x.y.x..y.x.y]" - type_: ~ name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x[x.y.x..y.x.y]\\\"}\"}" span: line_start: 1 @@ -399,7 +392,6 @@ outputs: col_stop: 15 path: "" content: "x[x.y.x..y.x.y]" - type_: ~ span: line_start: 1 line_stop: 1 diff --git a/tests/expectations/parser/parser/expression/access/circuit.leo.out b/tests/expectations/parser/parser/expression/access/circuit.leo.out index 5b53aecb5a..8498601d1e 100644 --- a/tests/expectations/parser/parser/expression/access/circuit.leo.out +++ b/tests/expectations/parser/parser/expression/access/circuit.leo.out @@ -13,7 +13,6 @@ outputs: col_stop: 4 path: "" content: x.y - type_: ~ - CircuitMemberAccess: circuit: Identifier: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"X.Y\\\"}\"}" @@ -25,7 +24,6 @@ outputs: col_stop: 4 path: "" content: X.Y - type_: ~ - CircuitMemberAccess: circuit: CircuitMemberAccess: @@ -39,7 +37,6 @@ outputs: col_stop: 4 path: "" content: x.y.z - type_: ~ name: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x.y.z\\\"}\"}" span: line_start: 1 @@ -48,7 +45,6 @@ outputs: col_stop: 6 path: "" content: x.y.z - type_: ~ - Call: function: CircuitMemberAccess: @@ -62,7 +58,6 @@ outputs: col_stop: 4 path: "" content: x.y() - type_: ~ arguments: [] span: line_start: 1 @@ -84,7 +79,6 @@ outputs: col_stop: 4 path: "" content: x.y.0 - type_: ~ index: value: "0" span: @@ -107,7 +101,6 @@ outputs: col_stop: 4 path: "" content: "x.y[1]" - type_: ~ index: Value: Implicit: diff --git a/tests/expectations/parser/parser/expression/unary/negate.leo.out b/tests/expectations/parser/parser/expression/unary/negate.leo.out index 9fe8865d44..fc683e6957 100644 --- a/tests/expectations/parser/parser/expression/unary/negate.leo.out +++ b/tests/expectations/parser/parser/expression/unary/negate.leo.out @@ -26,7 +26,6 @@ outputs: col_stop: 5 path: "" content: "-x.y" - type_: ~ op: Negate span: line_start: 1 diff --git a/tests/expectations/parser/parser/expression/unary/not.leo.out b/tests/expectations/parser/parser/expression/unary/not.leo.out index 04de6a3e4c..15d331191c 100644 --- a/tests/expectations/parser/parser/expression/unary/not.leo.out +++ b/tests/expectations/parser/parser/expression/unary/not.leo.out @@ -26,7 +26,6 @@ outputs: col_stop: 5 path: "" content: "!x.y" - type_: ~ op: Not span: line_start: 1 From 9579a430d75d4f367254cd436ab6c556842cfff3 Mon Sep 17 00:00:00 2001 From: damirka Date: Tue, 24 Aug 2021 22:34:00 +0300 Subject: [PATCH 12/13] attach theorem.lisp file --- .github/workflows/acl2.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/acl2.yml b/.github/workflows/acl2.yml index d9fc9c4af4..bc9aabf1b5 100644 --- a/.github/workflows/acl2.yml +++ b/.github/workflows/acl2.yml @@ -72,6 +72,7 @@ jobs: for dir in ${canonicalization_errors[@]}; do cat tmp/tgc/$dir/canonicalization_result.out + cat tmp/tgc/$dir/canonicalization-theorem.lisp done; exit 1 fi From 9d05b02ef3ea82da736bb0e55d0d5808e10b56f9 Mon Sep 17 00:00:00 2001 From: Eric McCarthy Date: Thu, 26 Aug 2021 20:33:00 -0700 Subject: [PATCH 13/13] update expectations based on results after merging master --- tests/expectations/compiler/compiler/char/circuit.leo.out | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/expectations/compiler/compiler/char/circuit.leo.out b/tests/expectations/compiler/compiler/char/circuit.leo.out index baf73f9b0a..fa42a4859a 100644 --- a/tests/expectations/compiler/compiler/char/circuit.leo.out +++ b/tests/expectations/compiler/compiler/char/circuit.leo.out @@ -100,6 +100,6 @@ outputs: r: type: char value: "'\\u{1f62d}'" - initial_ast: 715a33d0032f02d69d13687ac98005a789b6bcb63ff619865b21f0c691f14a75 - canonicalized_ast: 715a33d0032f02d69d13687ac98005a789b6bcb63ff619865b21f0c691f14a75 - type_inferenced_ast: d04164068277e88b5529f1072b512ffadc7eaaf704c8a3e394a409e783cc1e27 + initial_ast: 41f5ad78f58a182b6b99dd22151fabb0dc621c4a45c39d087cbc05f89c99eccc + canonicalized_ast: 41f5ad78f58a182b6b99dd22151fabb0dc621c4a45c39d087cbc05f89c99eccc + type_inferenced_ast: 0463676a90b25002f29b0c056e44945f9c461c535bdf11b47112ace4c3e0eac1