From 550f43b0396cfe8951a42be493f0b758ddd8fc77 Mon Sep 17 00:00:00 2001 From: evan-schott <53463459+evan-schott@users.noreply.github.com> Date: Fri, 25 Aug 2023 09:49:53 -0700 Subject: [PATCH] Revisions (underscore to execute test, type checker error msg, spurious type error fix, revised tuple indexing test) --- compiler/parser/src/parser/context.rs | 1 - .../src/type_checking/check_statements.rs | 6 +- errors/src/errors/parser/parser_errors.rs | 4 +- .../errors/type_checker/type_checker_error.rs | 2 +- .../iteration_bound_too_large_fail.out | 2 +- .../statements/loop_decreasing_fail.out | 2 +- .../loop_non_literal_bound_fail.out | 2 +- tests/expectations/execution/counter.out | 14 +-- .../parser/unreachable/eat_int.out | 107 +++++++++--------- tests/tests/execution/counter.leo | 8 +- tests/tests/parser/unreachable/eat_int.leo | 2 + 11 files changed, 75 insertions(+), 75 deletions(-) diff --git a/compiler/parser/src/parser/context.rs b/compiler/parser/src/parser/context.rs index c5a885bd8c..271c93704e 100644 --- a/compiler/parser/src/parser/context.rs +++ b/compiler/parser/src/parser/context.rs @@ -164,7 +164,6 @@ impl<'a> ParserContext<'a> { if (value.len() > 1 && value.starts_with('0')) || value.contains('_') { return Err(ParserError::tuple_index_must_be_whole_number( &self.token.token, - "whole number", self.token.span, ) .into()); diff --git a/compiler/passes/src/type_checking/check_statements.rs b/compiler/passes/src/type_checking/check_statements.rs index 761276b030..b5331fac2d 100644 --- a/compiler/passes/src/type_checking/check_statements.rs +++ b/compiler/passes/src/type_checking/check_statements.rs @@ -307,10 +307,8 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> { (Some(Value::U32(lower_bound, _)), Some(Value::U32(upper_bound, _))) => lower_bound >= upper_bound, (Some(Value::U64(lower_bound, _)), Some(Value::U64(upper_bound, _))) => lower_bound >= upper_bound, (Some(Value::U128(lower_bound, _)), Some(Value::U128(upper_bound, _))) => lower_bound >= upper_bound, - _ => { - self.emit_err(TypeCheckerError::loop_bound_type_mismatch(input.stop.span())); - false - } + // Note that type mismatch and non-literal errors will already be emitted by here. + _ => false } { self.emit_err(TypeCheckerError::loop_range_decreasing(input.stop.span())); } diff --git a/errors/src/errors/parser/parser_errors.rs b/errors/src/errors/parser/parser_errors.rs index 75e5a7b281..fa39d284b4 100644 --- a/errors/src/errors/parser/parser_errors.rs +++ b/errors/src/errors/parser/parser_errors.rs @@ -287,8 +287,8 @@ create_messages!( /// Enforce that tuple index must not have leading 0, or underscore in between digits @formatted tuple_index_must_be_whole_number { - args: (found: impl Display, expected: impl Display), - msg: format!("expected {expected} -- found '{found}'"), + args: (found: impl Display), + msg: format!("expected no underscores or leading zeros -- found '{found}'"), help: None, } ); diff --git a/errors/src/errors/type_checker/type_checker_error.rs b/errors/src/errors/type_checker/type_checker_error.rs index 100656ca59..05bddeb383 100644 --- a/errors/src/errors/type_checker/type_checker_error.rs +++ b/errors/src/errors/type_checker/type_checker_error.rs @@ -646,7 +646,7 @@ create_messages!( @formatted loop_range_decreasing { args: (), - msg: format!("The loop range must be decreasing."), + msg: format!("The loop range must be increasing."), help: None, } diff --git a/tests/expectations/compiler/statements/iteration_bound_too_large_fail.out b/tests/expectations/compiler/statements/iteration_bound_too_large_fail.out index 761847163f..8a09f0aa83 100644 --- a/tests/expectations/compiler/statements/iteration_bound_too_large_fail.out +++ b/tests/expectations/compiler/statements/iteration_bound_too_large_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372008]: The value 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000 is not a valid `u64`\n --> compiler-test:7:28\n |\n 7 | for i:u64 in 0u64..1000000000000000000000000000000000000000000000000000000000000000000000000000000000000u64 {\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372049]: Loop bound must be a literal.\n --> compiler-test:7:28\n |\n 7 | for i:u64 in 0u64..1000000000000000000000000000000000000000000000000000000000000000000000000000000000000u64 {\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372079]: The loop bounds must be same type\n --> compiler-test:7:28\n |\n 7 | for i:u64 in 0u64..1000000000000000000000000000000000000000000000000000000000000000000000000000000000000u64 {\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + - "Error [ETYC0372008]: The value 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000 is not a valid `u64`\n --> compiler-test:7:28\n |\n 7 | for i:u64 in 0u64..1000000000000000000000000000000000000000000000000000000000000000000000000000000000000u64 {\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372049]: Loop bound must be a literal.\n --> compiler-test:7:28\n |\n 7 | for i:u64 in 0u64..1000000000000000000000000000000000000000000000000000000000000000000000000000000000000u64 {\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" diff --git a/tests/expectations/compiler/statements/loop_decreasing_fail.out b/tests/expectations/compiler/statements/loop_decreasing_fail.out index f8a8ca8481..94a4074b8e 100644 --- a/tests/expectations/compiler/statements/loop_decreasing_fail.out +++ b/tests/expectations/compiler/statements/loop_decreasing_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372078]: The loop range must be decreasing.\n --> compiler-test:7:28\n |\n 7 | for i: i8 in 10i8..5i8 {\n | ^^^\n" + - "Error [ETYC0372078]: The loop range must be increasing.\n --> compiler-test:7:28\n |\n 7 | for i: i8 in 10i8..5i8 {\n | ^^^\n" diff --git a/tests/expectations/compiler/statements/loop_non_literal_bound_fail.out b/tests/expectations/compiler/statements/loop_non_literal_bound_fail.out index a92d371e38..b905462e13 100644 --- a/tests/expectations/compiler/statements/loop_non_literal_bound_fail.out +++ b/tests/expectations/compiler/statements/loop_non_literal_bound_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372049]: Loop bound must be a literal.\n --> compiler-test:11:28\n |\n 11 | for i:u64 in 0u64..amount {\n | ^^^^^^\nError [ETYC0372079]: The loop bounds must be same type\n --> compiler-test:11:28\n |\n 11 | for i:u64 in 0u64..amount {\n | ^^^^^^\n" + - "Error [ETYC0372049]: Loop bound must be a literal.\n --> compiler-test:11:28\n |\n 11 | for i:u64 in 0u64..amount {\n | ^^^^^^\n" diff --git a/tests/expectations/execution/counter.out b/tests/expectations/execution/counter.out index ee5b1eedff..f066e5e200 100644 --- a/tests/expectations/execution/counter.out +++ b/tests/expectations/execution/counter.out @@ -2,13 +2,13 @@ namespace: Execute expectation: Pass outputs: - - - initial_ast: ff08a4a92839ebe43e5c035ff1ab8991da994f84b167630c9b26cdc8e30028e6 - unrolled_ast: ff08a4a92839ebe43e5c035ff1ab8991da994f84b167630c9b26cdc8e30028e6 - ssa_ast: 8fea46feeceac4607d6e09181bce795520d9403f0be606b049225459f10dfe47 - flattened_ast: 561824a5b5b1291ca6d59dace67780a62c1089536e895830f901c133fa74da85 - inlined_ast: 561824a5b5b1291ca6d59dace67780a62c1089536e895830f901c133fa74da85 - dce_ast: 561824a5b5b1291ca6d59dace67780a62c1089536e895830f901c133fa74da85 - bytecode: f6055195b401bef6fe1e686a256bb743941b1945b7fd4b8f1800aa83dc3b7495 + - - initial_ast: 437dad4042f19f778819ccccf9964ff9b6b701c2805417ba378d8d5d643d59bc + unrolled_ast: 437dad4042f19f778819ccccf9964ff9b6b701c2805417ba378d8d5d643d59bc + ssa_ast: 8f85576cdcb97f4b8c348fbad7ab7d85696cbdc1a26a19226903446785db9d20 + flattened_ast: 83c91f6cefa549e6fc788d063aa22446b095e1b37e8a20d2109c2ba10068230a + inlined_ast: 83c91f6cefa549e6fc788d063aa22446b095e1b37e8a20d2109c2ba10068230a + dce_ast: 83c91f6cefa549e6fc788d063aa22446b095e1b37e8a20d2109c2ba10068230a + bytecode: 18d3fa0f122b8bc035d12ca6fbca2d0d6c923e9ebde740ebf8101b34ee38102a warnings: "" results: dubble: diff --git a/tests/expectations/parser/unreachable/eat_int.out b/tests/expectations/parser/unreachable/eat_int.out index a5cb75fbab..01763b91ef 100644 --- a/tests/expectations/parser/unreachable/eat_int.out +++ b/tests/expectations/parser/unreachable/eat_int.out @@ -2,56 +2,57 @@ namespace: ParseStatement expectation: Fail outputs: - - "Error [EPAR0370033]: expected whole number -- found ';'\n --> test:1:5\n |\n 1 | x.0_;\n | ^" - - "Error [EPAR0370033]: expected whole number -- found ';'\n --> test:1:6\n |\n 1 | x.0_0;\n | ^" - - "Error [EPAR0370033]: expected whole number -- found ';'\n --> test:1:5\n |\n 1 | x.01;\n | ^" - - "Error [EPAR0370033]: expected whole number -- found '.'\n --> test:1:5\n |\n 1 | x.0_.\n | ^" - - "Error [EPAR0370033]: expected whole number -- found 'import'\n --> test:1:5\n |\n 1 | x.0_import\n | ^^^^^^" - - "Error [EPAR0370033]: expected whole number -- found ','\n --> test:1:5\n |\n 1 | x.0_,\n | ^" - - "Error [EPAR0370033]: expected whole number -- found '*'\n --> test:1:5\n |\n 1 | x.0_*\n | ^" - - "Error [EPAR0370033]: expected whole number -- found '+'\n --> test:1:5\n |\n 1 | x.0_+\n | ^" - - "Error [EPAR0370033]: expected whole number -- found '-'\n --> test:1:5\n |\n 1 | x.0_-\n | ^" - - "Error [EPAR0370033]: expected whole number -- found '/'\n --> test:1:5\n |\n 1 | x.0_/\n | ^" - - "Error [EPAR0370033]: expected whole number -- found '['\n --> test:1:5\n |\n 1 | x.0_[\n | ^" - - "Error [EPAR0370033]: expected whole number -- found ']'\n --> test:1:5\n |\n 1 | x.0_]\n | ^" - - "Error [EPAR0370033]: expected whole number -- found '{'\n --> test:1:5\n |\n 1 | x.0_{\n | ^" - - "Error [EPAR0370033]: expected whole number -- found '}'\n --> test:1:5\n |\n 1 | x.0_}\n | ^" - - "Error [EPAR0370033]: expected whole number -- found '('\n --> test:1:5\n |\n 1 | x.0_(\n | ^" - - "Error [EPAR0370033]: expected whole number -- found ')'\n --> test:1:5\n |\n 1 | x.0_)\n | ^" - - "Error [EPAR0370033]: expected whole number -- found ':'\n --> test:1:5\n |\n 1 | x.0_:\n | ^" - - "Error [EPAR0370033]: expected whole number -- found '::'\n --> test:1:5\n |\n 1 | x.0_::\n | ^^" - - "Error [EPAR0370033]: expected whole number -- found '?'\n --> test:1:5\n |\n 1 | x.0_?\n | ^" - - "Error [EPAR0370033]: expected whole number -- found ''\n --> test:1:3\n |\n 1 | x.0__\n | ^^^" - - "Error [EPAR0370033]: expected whole number -- found '='\n --> test:1:5\n |\n 1 | x.0_=\n | ^" - - "Error [EPAR0370033]: expected whole number -- found '=='\n --> test:1:5\n |\n 1 | x.0_==\n | ^^" - - "Error [EPAR0370033]: expected whole number -- found '!'\n --> test:1:5\n |\n 1 | x.0_!\n | ^" - - "Error [EPAR0370033]: expected whole number -- found '!='\n --> test:1:5\n |\n 1 | x.0_!=\n | ^^" - - "Error [EPAR0370033]: expected whole number -- found '>'\n --> test:1:5\n |\n 1 | x.0_>\n | ^" - - "Error [EPAR0370033]: expected whole number -- found '>='\n --> test:1:5\n |\n 1 | x.0_>=\n | ^^" - - "Error [EPAR0370033]: expected whole number -- found '<'\n --> test:1:5\n |\n 1 | x.0_<\n | ^" - - "Error [EPAR0370033]: expected whole number -- found '<='\n --> test:1:5\n |\n 1 | x.0_<=\n | ^^" - - "Error [EPAR0370033]: expected whole number -- found '>'\n --> test:1:5\n |\n 1 | x.0_>\n | ^" - - "Error [EPAR0370033]: expected whole number -- found '..'\n --> test:1:5\n |\n 1 | x.0_..\n | ^^" - - "Error [EPAR0370033]: expected whole number -- found 'as'\n --> test:1:5\n |\n 1 | x.0_as\n | ^^" - - "Error [EPAR0370033]: expected whole number -- found 'console'\n --> test:1:5\n |\n 1 | x.0_console\n | ^^^^^^^" - - "Error [EPAR0370033]: expected whole number -- found 'const'\n --> test:1:5\n |\n 1 | x.0_const\n | ^^^^^" - - "Error [EPAR0370033]: expected whole number -- found 'let'\n --> test:1:5\n |\n 1 | x.0_let\n | ^^^" - - "Error [EPAR0370033]: expected whole number -- found 'for'\n --> test:1:5\n |\n 1 | x.0_for\n | ^^^" - - "Error [EPAR0370033]: expected whole number -- found 'if'\n --> test:1:5\n |\n 1 | x.0_if\n | ^^" - - "Error [EPAR0370033]: expected whole number -- found 'else'\n --> test:1:5\n |\n 1 | x.0_else\n | ^^^^" - - "Error [EPAR0370033]: expected whole number -- found 'i8'\n --> test:1:5\n |\n 1 | x.0_i8\n | ^^" - - "Error [EPAR0370033]: expected whole number -- found 'i16'\n --> test:1:5\n |\n 1 | x.0_i16\n | ^^^" - - "Error [EPAR0370033]: expected whole number -- found 'i32'\n --> test:1:5\n |\n 1 | x.0_i32\n | ^^^" - - "Error [EPAR0370033]: expected whole number -- found 'i64'\n --> test:1:5\n |\n 1 | x.0_i64\n | ^^^" - - "Error [EPAR0370033]: expected whole number -- found 'i128'\n --> test:1:5\n |\n 1 | x.0_i128\n | ^^^^" - - "Error [EPAR0370033]: expected whole number -- found 'u8'\n --> test:1:5\n |\n 1 | x.0_u8\n | ^^" - - "Error [EPAR0370033]: expected whole number -- found 'u16'\n --> test:1:5\n |\n 1 | x.0_u16\n | ^^^" - - "Error [EPAR0370033]: expected whole number -- found 'u32'\n --> test:1:5\n |\n 1 | x.0_u32\n | ^^^" - - "Error [EPAR0370033]: expected whole number -- found 'u64'\n --> test:1:5\n |\n 1 | x.0_u64\n | ^^^" - - "Error [EPAR0370033]: expected whole number -- found 'u128'\n --> test:1:5\n |\n 1 | x.0_u128\n | ^^^^" - - "Error [EPAR0370033]: expected whole number -- found '&'\n --> test:1:5\n |\n 1 | x.0_&\n | ^" - - "Error [EPAR0370033]: expected whole number -- found 'return'\n --> test:1:5\n |\n 1 | x.0_return\n | ^^^^^^" - - "Error [EPAR0370033]: expected whole number -- found 'self'\n --> test:1:5\n |\n 1 | x.0_self\n | ^^^^" - - "Error [EPAR0370033]: expected whole number -- found 'Self'\n --> test:1:5\n |\n 1 | x.0_Self\n | ^^^^" - - "Error [EPAR0370033]: expected whole number -- found 'true'\n --> test:1:5\n |\n 1 | x.0_true\n | ^^^^" - - "Error [EPAR0370033]: expected whole number -- found 'false'\n --> test:1:5\n |\n 1 | x.0_false\n | ^^^^^" + - "Error [EPAR0370009]: unexpected string: expected 'identifier', found '-'\n --> test:1:3\n |\n 1 | x.-12\n | ^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found ';'\n --> test:1:5\n |\n 1 | x.0_;\n | ^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found ';'\n --> test:1:6\n |\n 1 | x.0_0;\n | ^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found ';'\n --> test:1:5\n |\n 1 | x.01;\n | ^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found '.'\n --> test:1:5\n |\n 1 | x.0_.\n | ^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found 'import'\n --> test:1:5\n |\n 1 | x.0_import\n | ^^^^^^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found ','\n --> test:1:5\n |\n 1 | x.0_,\n | ^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found '*'\n --> test:1:5\n |\n 1 | x.0_*\n | ^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found '+'\n --> test:1:5\n |\n 1 | x.0_+\n | ^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found '-'\n --> test:1:5\n |\n 1 | x.0_-\n | ^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found '/'\n --> test:1:5\n |\n 1 | x.0_/\n | ^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found '['\n --> test:1:5\n |\n 1 | x.0_[\n | ^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found ']'\n --> test:1:5\n |\n 1 | x.0_]\n | ^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found '{'\n --> test:1:5\n |\n 1 | x.0_{\n | ^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found '}'\n --> test:1:5\n |\n 1 | x.0_}\n | ^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found '('\n --> test:1:5\n |\n 1 | x.0_(\n | ^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found ')'\n --> test:1:5\n |\n 1 | x.0_)\n | ^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found ':'\n --> test:1:5\n |\n 1 | x.0_:\n | ^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found '::'\n --> test:1:5\n |\n 1 | x.0_::\n | ^^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found '?'\n --> test:1:5\n |\n 1 | x.0_?\n | ^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found ''\n --> test:1:3\n |\n 1 | x.0__\n | ^^^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found '='\n --> test:1:5\n |\n 1 | x.0_=\n | ^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found '=='\n --> test:1:5\n |\n 1 | x.0_==\n | ^^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found '!'\n --> test:1:5\n |\n 1 | x.0_!\n | ^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found '!='\n --> test:1:5\n |\n 1 | x.0_!=\n | ^^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found '>'\n --> test:1:5\n |\n 1 | x.0_>\n | ^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found '>='\n --> test:1:5\n |\n 1 | x.0_>=\n | ^^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found '<'\n --> test:1:5\n |\n 1 | x.0_<\n | ^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found '<='\n --> test:1:5\n |\n 1 | x.0_<=\n | ^^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found '>'\n --> test:1:5\n |\n 1 | x.0_>\n | ^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found '..'\n --> test:1:5\n |\n 1 | x.0_..\n | ^^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found 'as'\n --> test:1:5\n |\n 1 | x.0_as\n | ^^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found 'console'\n --> test:1:5\n |\n 1 | x.0_console\n | ^^^^^^^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found 'const'\n --> test:1:5\n |\n 1 | x.0_const\n | ^^^^^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found 'let'\n --> test:1:5\n |\n 1 | x.0_let\n | ^^^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found 'for'\n --> test:1:5\n |\n 1 | x.0_for\n | ^^^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found 'if'\n --> test:1:5\n |\n 1 | x.0_if\n | ^^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found 'else'\n --> test:1:5\n |\n 1 | x.0_else\n | ^^^^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found 'i8'\n --> test:1:5\n |\n 1 | x.0_i8\n | ^^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found 'i16'\n --> test:1:5\n |\n 1 | x.0_i16\n | ^^^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found 'i32'\n --> test:1:5\n |\n 1 | x.0_i32\n | ^^^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found 'i64'\n --> test:1:5\n |\n 1 | x.0_i64\n | ^^^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found 'i128'\n --> test:1:5\n |\n 1 | x.0_i128\n | ^^^^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found 'u8'\n --> test:1:5\n |\n 1 | x.0_u8\n | ^^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found 'u16'\n --> test:1:5\n |\n 1 | x.0_u16\n | ^^^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found 'u32'\n --> test:1:5\n |\n 1 | x.0_u32\n | ^^^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found 'u64'\n --> test:1:5\n |\n 1 | x.0_u64\n | ^^^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found 'u128'\n --> test:1:5\n |\n 1 | x.0_u128\n | ^^^^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found '&'\n --> test:1:5\n |\n 1 | x.0_&\n | ^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found 'return'\n --> test:1:5\n |\n 1 | x.0_return\n | ^^^^^^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found 'self'\n --> test:1:5\n |\n 1 | x.0_self\n | ^^^^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found 'Self'\n --> test:1:5\n |\n 1 | x.0_Self\n | ^^^^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found 'true'\n --> test:1:5\n |\n 1 | x.0_true\n | ^^^^" + - "Error [EPAR0370033]: expected no underscores or leading zeros -- found 'false'\n --> test:1:5\n |\n 1 | x.0_false\n | ^^^^^" diff --git a/tests/tests/execution/counter.leo b/tests/tests/execution/counter.leo index 42eb2dfcd8..a9bf637acc 100644 --- a/tests/tests/execution/counter.leo +++ b/tests/tests/execution/counter.leo @@ -19,10 +19,10 @@ program test.aleo { } finalize dubble(addr: address) { - let current_value: u64 = Mapping::get_or_use(counter, addr, 0u64); - Mapping::set(counter, addr, current_value + 1u64); + let current_value: u64 = Mapping::get_or_use(counter, addr, 0_0u64); + Mapping::set(counter, addr, current_value + 1__u64); current_value = Mapping::get(counter, addr); - Mapping::set(counter, addr, current_value + 1u64); + Mapping::set(counter, addr, current_value + 0___1u64); } transition unsafe_increment() { @@ -31,6 +31,6 @@ program test.aleo { finalize unsafe_increment(addr: address) { let current_value: u64 = Mapping::get(counter, addr); - Mapping::set(counter, addr, current_value + 1u64); + Mapping::set(counter, addr, current_value + 0__1u64); } } diff --git a/tests/tests/parser/unreachable/eat_int.leo b/tests/tests/parser/unreachable/eat_int.leo index 64bf596c69..869348728c 100644 --- a/tests/tests/parser/unreachable/eat_int.leo +++ b/tests/tests/parser/unreachable/eat_int.leo @@ -3,6 +3,8 @@ namespace: ParseStatement expectation: Fail */ +x.-12 + x.0_; x.0_0;