From 00a79437461feceb6071c17329e36386da6d5f3a Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu Date: Tue, 4 Apr 2023 16:14:00 -0700 Subject: [PATCH] Regen expectations --- .../compiler/finalize/decrement.out | 11 ----------- .../finalize/decrement_incorrect_type.out | 5 ----- .../finalize/decrement_incorrect_type_fail.out | 2 +- .../expectations/compiler/finalize/finalize.out | 11 ----------- .../compiler/finalize/finalize_with_return.out | 11 ----------- .../compiler/finalize/increment.out | 11 ----------- .../finalize/increment_incorrect_type.out | 2 +- .../expectations/compiler/finalize/mapping.out | 14 +++++++------- .../compiler/finalize/mapping_fail.out | 2 +- tests/tests/compiler/finalize/mapping.leo | 13 +------------ tests/tests/compiler/finalize/mapping_fail.leo | 17 ++++++++++++++++- 11 files changed, 27 insertions(+), 72 deletions(-) delete mode 100644 tests/expectations/compiler/finalize/decrement.out delete mode 100644 tests/expectations/compiler/finalize/decrement_incorrect_type.out delete mode 100644 tests/expectations/compiler/finalize/finalize.out delete mode 100644 tests/expectations/compiler/finalize/finalize_with_return.out delete mode 100644 tests/expectations/compiler/finalize/increment.out diff --git a/tests/expectations/compiler/finalize/decrement.out b/tests/expectations/compiler/finalize/decrement.out deleted file mode 100644 index e96a912fae..0000000000 --- a/tests/expectations/compiler/finalize/decrement.out +++ /dev/null @@ -1,11 +0,0 @@ ---- -namespace: Compile -expectation: Pass -outputs: - - - initial_ast: 6fa465e63f2b8e880d621cb1758b3d1c0edfa9ce09e6d4f0f28bbe6c2ca2b955 - unrolled_ast: 6fa465e63f2b8e880d621cb1758b3d1c0edfa9ce09e6d4f0f28bbe6c2ca2b955 - ssa_ast: 6fa465e63f2b8e880d621cb1758b3d1c0edfa9ce09e6d4f0f28bbe6c2ca2b955 - flattened_ast: 4b8969d1adf68074bc7a8458a9146e128041bf929f2f6a4e76a16ad2769b81b1 - inlined_ast: 4b8969d1adf68074bc7a8458a9146e128041bf929f2f6a4e76a16ad2769b81b1 - dce_ast: 4b8969d1adf68074bc7a8458a9146e128041bf929f2f6a4e76a16ad2769b81b1 - bytecode: 39aa8516297ece27331b633a72466d2ff0122d36beca663a48bc07589e2d3e15 diff --git a/tests/expectations/compiler/finalize/decrement_incorrect_type.out b/tests/expectations/compiler/finalize/decrement_incorrect_type.out deleted file mode 100644 index 5b6559e151..0000000000 --- a/tests/expectations/compiler/finalize/decrement_incorrect_type.out +++ /dev/null @@ -1,5 +0,0 @@ ---- -namespace: Compile -expectation: Fail -outputs: - - "Error [ETYC0372007]: Expected one type from `Token`, but got `u128`\n --> compiler-test:18:33\n |\n 18 | decrement(tokens, addr, amount);\n | ^^^^^^\nError [ETYC0372007]: Expected one type from `address`, but got `u8`\n --> compiler-test:19:28\n |\n 19 | decrement(amounts, 1u8, amount);\n | ^^^\nError [ETYC0372007]: Expected one type from `u128`, but got `u8`\n --> compiler-test:20:34\n |\n 20 | decrement(amounts, addr, 1u8);\n | ^^^\nError [ETYC0372003]: Expected type `u64` but type `u8` was found\n --> compiler-test:21:61\n |\n 21 | decrement(tokens, addr, Token { owner: addr, gates: 1u8, amount: 1u8 });\n | ^^^\nError [ETYC0372003]: Expected type `u128` but type `u8` was found\n --> compiler-test:21:74\n |\n 21 | decrement(tokens, addr, Token { owner: addr, gates: 1u8, amount: 1u8 });\n | ^^^\nError [ETYC0372007]: Expected one type from `field, group, scalar, i8, i16, i32, i64, i128, u8, u16, u32, u64, u128`, but got `Token`\n --> compiler-test:21:33\n |\n 21 | decrement(tokens, addr, Token { owner: addr, gates: 1u8, amount: 1u8 });\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372005]: Unknown variable `foo`\n --> compiler-test:22:19\n |\n 22 | decrement(foo, addr, amount);\n | ^^^\nError [ETYC0372004]: Could not determine the type of `foo`\n --> compiler-test:22:19\n |\n 22 | decrement(foo, addr, amount);\n | ^^^\n" diff --git a/tests/expectations/compiler/finalize/decrement_incorrect_type_fail.out b/tests/expectations/compiler/finalize/decrement_incorrect_type_fail.out index e293576af5..82c6790d7e 100644 --- a/tests/expectations/compiler/finalize/decrement_incorrect_type_fail.out +++ b/tests/expectations/compiler/finalize/decrement_incorrect_type_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372005]: Unknown function `decrement`\n --> compiler-test:18:9\n |\n 18 | decrement(tokens, addr, amount);\n | ^^^^^^^^^\nError [ETYC0372005]: Unknown function `decrement`\n --> compiler-test:19:9\n |\n 19 | decrement(amounts, 1u8, amount);\n | ^^^^^^^^^\nError [ETYC0372005]: Unknown function `decrement`\n --> compiler-test:20:9\n |\n 20 | decrement(amounts, addr, 1u8);\n | ^^^^^^^^^\nError [ETYC0372005]: Unknown function `decrement`\n --> compiler-test:21:9\n |\n 21 | decrement(tokens, addr, Token { owner: addr, gates: 1u8, amount: 1u8 });\n | ^^^^^^^^^\nError [ETYC0372005]: Unknown function `decrement`\n --> compiler-test:22:9\n |\n 22 | decrement(foo, addr, amount);\n | ^^^^^^^^^\nWarning [WPAR0370001]: The keyword `decrement` is deprecated.\n --> compiler-test:18:9\n |\n 18 | decrement(tokens, addr, amount);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = Use `Mapping::{get, get_or, put}` for manipulating on-chain mappings.\nWarning [WPAR0370001]: The keyword `decrement` is deprecated.\n --> compiler-test:19:9\n |\n 19 | decrement(amounts, 1u8, amount);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = Use `Mapping::{get, get_or, put}` for manipulating on-chain mappings.\nWarning [WPAR0370001]: The keyword `decrement` is deprecated.\n --> compiler-test:20:9\n |\n 20 | decrement(amounts, addr, 1u8);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = Use `Mapping::{get, get_or, put}` for manipulating on-chain mappings.\nWarning [WPAR0370001]: The keyword `decrement` is deprecated.\n --> compiler-test:21:9\n |\n 21 | decrement(tokens, addr, Token { owner: addr, gates: 1u8, amount: 1u8 });\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = Use `Mapping::{get, get_or, put}` for manipulating on-chain mappings.\nWarning [WPAR0370001]: The keyword `decrement` is deprecated.\n --> compiler-test:22:9\n |\n 22 | decrement(foo, addr, amount);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = Use `Mapping::{get, get_or, put}` for manipulating on-chain mappings." + - "Error [ETYC0372030]: A mapping's value cannot be a record\n --> compiler-test:11:5\n |\n 11 | mapping tokens: address => Token;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372005]: Unknown function `decrement`\n --> compiler-test:18:9\n |\n 18 | decrement(tokens, addr, amount);\n | ^^^^^^^^^\nError [ETYC0372005]: Unknown function `decrement`\n --> compiler-test:19:9\n |\n 19 | decrement(amounts, 1u8, amount);\n | ^^^^^^^^^\nError [ETYC0372005]: Unknown function `decrement`\n --> compiler-test:20:9\n |\n 20 | decrement(amounts, addr, 1u8);\n | ^^^^^^^^^\nError [ETYC0372005]: Unknown function `decrement`\n --> compiler-test:21:9\n |\n 21 | decrement(tokens, addr, Token { owner: addr, gates: 1u8, amount: 1u8 });\n | ^^^^^^^^^\nError [ETYC0372005]: Unknown function `decrement`\n --> compiler-test:22:9\n |\n 22 | decrement(foo, addr, amount);\n | ^^^^^^^^^\nWarning [WPAR0370001]: The keyword `decrement` is deprecated.\n --> compiler-test:18:9\n |\n 18 | decrement(tokens, addr, amount);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = Use `Mapping::{get, get_or, put}` for manipulating on-chain mappings.\nWarning [WPAR0370001]: The keyword `decrement` is deprecated.\n --> compiler-test:19:9\n |\n 19 | decrement(amounts, 1u8, amount);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = Use `Mapping::{get, get_or, put}` for manipulating on-chain mappings.\nWarning [WPAR0370001]: The keyword `decrement` is deprecated.\n --> compiler-test:20:9\n |\n 20 | decrement(amounts, addr, 1u8);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = Use `Mapping::{get, get_or, put}` for manipulating on-chain mappings.\nWarning [WPAR0370001]: The keyword `decrement` is deprecated.\n --> compiler-test:21:9\n |\n 21 | decrement(tokens, addr, Token { owner: addr, gates: 1u8, amount: 1u8 });\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = Use `Mapping::{get, get_or, put}` for manipulating on-chain mappings.\nWarning [WPAR0370001]: The keyword `decrement` is deprecated.\n --> compiler-test:22:9\n |\n 22 | decrement(foo, addr, amount);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = Use `Mapping::{get, get_or, put}` for manipulating on-chain mappings." diff --git a/tests/expectations/compiler/finalize/finalize.out b/tests/expectations/compiler/finalize/finalize.out deleted file mode 100644 index e4bf4bba1e..0000000000 --- a/tests/expectations/compiler/finalize/finalize.out +++ /dev/null @@ -1,11 +0,0 @@ ---- -namespace: Compile -expectation: Pass -outputs: - - - initial_ast: 9ffd4f34e261ee315a2ee29353e707b35c300e928aca532743142a538957c4ce - unrolled_ast: 9ffd4f34e261ee315a2ee29353e707b35c300e928aca532743142a538957c4ce - ssa_ast: 9ea8f3743b9bcf1584319472ca0a80707f117616d687d4c401b34fb10b44703a - flattened_ast: a4eca8b80af9863d59ebfb837fa5dae061fca7d52315d3a9f5778e6dc4b75716 - inlined_ast: a4eca8b80af9863d59ebfb837fa5dae061fca7d52315d3a9f5778e6dc4b75716 - dce_ast: a4eca8b80af9863d59ebfb837fa5dae061fca7d52315d3a9f5778e6dc4b75716 - bytecode: 6db857dc2b80ea257d141b3980404e050024771f95c5f9b74f899145b2001432 diff --git a/tests/expectations/compiler/finalize/finalize_with_return.out b/tests/expectations/compiler/finalize/finalize_with_return.out deleted file mode 100644 index 502d6993a0..0000000000 --- a/tests/expectations/compiler/finalize/finalize_with_return.out +++ /dev/null @@ -1,11 +0,0 @@ ---- -namespace: Compile -expectation: Pass -outputs: - - - initial_ast: 809ffb6b3ce9e51d58f18a841bbbe79e87bf3b5c0ac2d82d226b3cb66427f235 - unrolled_ast: 809ffb6b3ce9e51d58f18a841bbbe79e87bf3b5c0ac2d82d226b3cb66427f235 - ssa_ast: efeab621ea3b6113ae3ef1f326cbd75668ce034b81a1bb09a55c9a671f62c127 - flattened_ast: 06fea09c85a281be025d66565aa362f80f2036c88c284fbfb5f9b874a605916b - inlined_ast: 06fea09c85a281be025d66565aa362f80f2036c88c284fbfb5f9b874a605916b - dce_ast: 06fea09c85a281be025d66565aa362f80f2036c88c284fbfb5f9b874a605916b - bytecode: 9f1144202f6b114409c379f7ecc4b480dd81daaf0f6f8b244efd20c520f7b76c diff --git a/tests/expectations/compiler/finalize/increment.out b/tests/expectations/compiler/finalize/increment.out deleted file mode 100644 index 591426cc08..0000000000 --- a/tests/expectations/compiler/finalize/increment.out +++ /dev/null @@ -1,11 +0,0 @@ ---- -namespace: Compile -expectation: Pass -outputs: - - - initial_ast: 19378936c22e4e747e16e132bbc727115598dfbd17068349cb300525cde35556 - unrolled_ast: 19378936c22e4e747e16e132bbc727115598dfbd17068349cb300525cde35556 - ssa_ast: 19378936c22e4e747e16e132bbc727115598dfbd17068349cb300525cde35556 - flattened_ast: c55a0edeb6a52dd728e5500ff5b1d387186321c8a3d68f2d0638628bbb05696e - inlined_ast: c55a0edeb6a52dd728e5500ff5b1d387186321c8a3d68f2d0638628bbb05696e - dce_ast: c55a0edeb6a52dd728e5500ff5b1d387186321c8a3d68f2d0638628bbb05696e - bytecode: 49afa4d378578bc680308083733b31b8272f9c952fe8dbc133398676e3f0d2ba diff --git a/tests/expectations/compiler/finalize/increment_incorrect_type.out b/tests/expectations/compiler/finalize/increment_incorrect_type.out index b4fb0b4026..9e28d23208 100644 --- a/tests/expectations/compiler/finalize/increment_incorrect_type.out +++ b/tests/expectations/compiler/finalize/increment_incorrect_type.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372005]: Unknown function `increment`\n --> compiler-test:18:9\n |\n 18 | increment(tokens, addr, amount);\n | ^^^^^^^^^\nError [ETYC0372005]: Unknown function `increment`\n --> compiler-test:19:9\n |\n 19 | increment(amounts, 1u8, amount);\n | ^^^^^^^^^\nError [ETYC0372005]: Unknown function `increment`\n --> compiler-test:20:9\n |\n 20 | increment(amounts, addr, 1u8);\n | ^^^^^^^^^\nError [ETYC0372005]: Unknown function `increment`\n --> compiler-test:21:9\n |\n 21 | increment(amounts, addr, Token { owner: addr, gates: 1u64, amount: amount });\n | ^^^^^^^^^\nError [ETYC0372005]: Unknown function `increment`\n --> compiler-test:22:9\n |\n 22 | increment(foo, addr, amount);\n | ^^^^^^^^^\nWarning [WPAR0370001]: The keyword `increment` is deprecated.\n --> compiler-test:18:9\n |\n 18 | increment(tokens, addr, amount);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = Use `Mapping::{get, get_or, put}` for manipulating on-chain mappings.\nWarning [WPAR0370001]: The keyword `increment` is deprecated.\n --> compiler-test:19:9\n |\n 19 | increment(amounts, 1u8, amount);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = Use `Mapping::{get, get_or, put}` for manipulating on-chain mappings.\nWarning [WPAR0370001]: The keyword `increment` is deprecated.\n --> compiler-test:20:9\n |\n 20 | increment(amounts, addr, 1u8);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = Use `Mapping::{get, get_or, put}` for manipulating on-chain mappings.\nWarning [WPAR0370001]: The keyword `increment` is deprecated.\n --> compiler-test:21:9\n |\n 21 | increment(amounts, addr, Token { owner: addr, gates: 1u64, amount: amount });\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = Use `Mapping::{get, get_or, put}` for manipulating on-chain mappings.\nWarning [WPAR0370001]: The keyword `increment` is deprecated.\n --> compiler-test:22:9\n |\n 22 | increment(foo, addr, amount);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = Use `Mapping::{get, get_or, put}` for manipulating on-chain mappings." + - "Error [ETYC0372030]: A mapping's value cannot be a record\n --> compiler-test:11:5\n |\n 11 | mapping tokens: address => Token;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372005]: Unknown function `increment`\n --> compiler-test:18:9\n |\n 18 | increment(tokens, addr, amount);\n | ^^^^^^^^^\nError [ETYC0372005]: Unknown function `increment`\n --> compiler-test:19:9\n |\n 19 | increment(amounts, 1u8, amount);\n | ^^^^^^^^^\nError [ETYC0372005]: Unknown function `increment`\n --> compiler-test:20:9\n |\n 20 | increment(amounts, addr, 1u8);\n | ^^^^^^^^^\nError [ETYC0372005]: Unknown function `increment`\n --> compiler-test:21:9\n |\n 21 | increment(amounts, addr, Token { owner: addr, gates: 1u64, amount: amount });\n | ^^^^^^^^^\nError [ETYC0372005]: Unknown function `increment`\n --> compiler-test:22:9\n |\n 22 | increment(foo, addr, amount);\n | ^^^^^^^^^\nWarning [WPAR0370001]: The keyword `increment` is deprecated.\n --> compiler-test:18:9\n |\n 18 | increment(tokens, addr, amount);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = Use `Mapping::{get, get_or, put}` for manipulating on-chain mappings.\nWarning [WPAR0370001]: The keyword `increment` is deprecated.\n --> compiler-test:19:9\n |\n 19 | increment(amounts, 1u8, amount);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = Use `Mapping::{get, get_or, put}` for manipulating on-chain mappings.\nWarning [WPAR0370001]: The keyword `increment` is deprecated.\n --> compiler-test:20:9\n |\n 20 | increment(amounts, addr, 1u8);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = Use `Mapping::{get, get_or, put}` for manipulating on-chain mappings.\nWarning [WPAR0370001]: The keyword `increment` is deprecated.\n --> compiler-test:21:9\n |\n 21 | increment(amounts, addr, Token { owner: addr, gates: 1u64, amount: amount });\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = Use `Mapping::{get, get_or, put}` for manipulating on-chain mappings.\nWarning [WPAR0370001]: The keyword `increment` is deprecated.\n --> compiler-test:22:9\n |\n 22 | increment(foo, addr, amount);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = Use `Mapping::{get, get_or, put}` for manipulating on-chain mappings." diff --git a/tests/expectations/compiler/finalize/mapping.out b/tests/expectations/compiler/finalize/mapping.out index 2af49d9ebf..ed0b65e0e6 100644 --- a/tests/expectations/compiler/finalize/mapping.out +++ b/tests/expectations/compiler/finalize/mapping.out @@ -2,11 +2,11 @@ namespace: Compile expectation: Pass outputs: - - - initial_ast: 6e57e1c0c5d4df7eaf414939293c79c156c77f9ee78064dd35572f0d54ec2b85 - unrolled_ast: 6e57e1c0c5d4df7eaf414939293c79c156c77f9ee78064dd35572f0d54ec2b85 - ssa_ast: 4c6468604104edfe6a6d2a5f4d80c557b001bc60b1e4098f80eda119afdbb292 - flattened_ast: bb26f3622ed2fa2f301ac07069ae281a5e5bea1d52fec8cdb03b03131ad0b4f6 - inlined_ast: bb26f3622ed2fa2f301ac07069ae281a5e5bea1d52fec8cdb03b03131ad0b4f6 - dce_ast: bb26f3622ed2fa2f301ac07069ae281a5e5bea1d52fec8cdb03b03131ad0b4f6 - bytecode: 1da5a78fcb6f77bd197de7dce1e7e94e7a9d30a6ec26703a645b25ab7c65cc08 + - - initial_ast: ac852a67842b1054112f21181808134b2b33eddedeacb263d3965fa92155deea + unrolled_ast: ac852a67842b1054112f21181808134b2b33eddedeacb263d3965fa92155deea + ssa_ast: 4c717c5610854b3ae84c09bc97997984e55d590620fbae8ed060c259b0b8c674 + flattened_ast: 900fbee1813c51d4859f4bd2276459d7cfcccef8447c26b9d16b6f00aab5455c + inlined_ast: 900fbee1813c51d4859f4bd2276459d7cfcccef8447c26b9d16b6f00aab5455c + dce_ast: 900fbee1813c51d4859f4bd2276459d7cfcccef8447c26b9d16b6f00aab5455c + bytecode: b2164bbd276015db50334b15d3b882c988681918982d8e0f144ad2c09fa2ecb9 warnings: "" diff --git a/tests/expectations/compiler/finalize/mapping_fail.out b/tests/expectations/compiler/finalize/mapping_fail.out index d648e9d91a..f6890bf304 100644 --- a/tests/expectations/compiler/finalize/mapping_fail.out +++ b/tests/expectations/compiler/finalize/mapping_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372030]: A mapping's key cannot be a tuple\n --> compiler-test:4:5\n |\n 4 | mapping foo: (u32, u32) => u32;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372017]: The type `baz` is not found in the current scope.\n --> compiler-test:6:5\n |\n 6 | mapping floo: baz => u8;\n | ^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372017]: The type `foo` is not found in the current scope.\n --> compiler-test:8:5\n |\n 8 | mapping bar: foo => baz;\n | ^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372017]: The type `baz` is not found in the current scope.\n --> compiler-test:8:5\n |\n 8 | mapping bar: foo => baz;\n | ^^^^^^^^^^^^^^^^^^^^^^^^\n" + - "Error [ETYC0372030]: A mapping's key cannot be a tuple\n --> compiler-test:4:5\n |\n 4 | mapping foo: (u32, u32) => u32;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372017]: The type `baz` is not found in the current scope.\n --> compiler-test:6:5\n |\n 6 | mapping floo: baz => u8;\n | ^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372017]: The type `foo` is not found in the current scope.\n --> compiler-test:8:5\n |\n 8 | mapping floop: foo => foo;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372017]: The type `foo` is not found in the current scope.\n --> compiler-test:8:5\n |\n 8 | mapping floop: foo => foo;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372017]: The type `foo` is not found in the current scope.\n --> compiler-test:10:5\n |\n 10 | mapping bar: foo => baz;\n | ^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372017]: The type `baz` is not found in the current scope.\n --> compiler-test:10:5\n |\n 10 | mapping bar: foo => baz;\n | ^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372030]: A mapping's value cannot be a record\n --> compiler-test:21:5\n |\n 21 | mapping real_tokens: address => RealToken;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372030]: A mapping's key cannot be a record\n --> compiler-test:23:5\n |\n 23 | mapping owners: RealToken => address;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" diff --git a/tests/tests/compiler/finalize/mapping.leo b/tests/tests/compiler/finalize/mapping.leo index 45ddb453a6..f7f2f0e5c1 100644 --- a/tests/tests/compiler/finalize/mapping.leo +++ b/tests/tests/compiler/finalize/mapping.leo @@ -27,16 +27,5 @@ program test.aleo { mapping foo: Bar => Baz; - record RealToken { - // The token owner. - owner: address, - // The Aleo balance (in gates). - gates: u64, - // The token amount. - amount: u64, - } - - mapping real_tokens: address => RealToken; - - mapping owners: RealToken => address; + } diff --git a/tests/tests/compiler/finalize/mapping_fail.leo b/tests/tests/compiler/finalize/mapping_fail.leo index 735f3c26a8..4531c35dd3 100644 --- a/tests/tests/compiler/finalize/mapping_fail.leo +++ b/tests/tests/compiler/finalize/mapping_fail.leo @@ -7,7 +7,22 @@ program test.aleo { mapping foo: (u32, u32) => u32; mapping floo: baz => u8; + + mapping floop: foo => foo; mapping bar: foo => baz; - + + record RealToken { + // The token owner. + owner: address, + // The Aleo balance (in gates). + gates: u64, + // The token amount. + amount: u64, + } + + mapping real_tokens: address => RealToken; + + mapping owners: RealToken => address; + }