From 346344dc7b935221723d9b0c18f002bdf760d20c Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Tue, 16 Feb 2021 12:22:22 +0000 Subject: [PATCH] Add missing test case for try/Catch --- scripts/error_codes.py | 2 +- .../syntaxTests/tryCatch/returns_mismatch.sol | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 test/libsolidity/syntaxTests/tryCatch/returns_mismatch.sol diff --git a/scripts/error_codes.py b/scripts/error_codes.py index 95e74e513..1e88a2fd5 100755 --- a/scripts/error_codes.py +++ b/scripts/error_codes.py @@ -221,7 +221,7 @@ def examine_id_coverage(top_dir, source_id_to_file_names, new_ids_only=False): old_source_only_ids = { "1584", "1823", - "1988", "2066", "2800", "3356", + "1988", "2066", "3356", "3893", "3996", "4010", "4802", "5073", "5272", "5622", "7128", "7589", "7593", "8065", "8084", "8140", diff --git a/test/libsolidity/syntaxTests/tryCatch/returns_mismatch.sol b/test/libsolidity/syntaxTests/tryCatch/returns_mismatch.sol new file mode 100644 index 000000000..fcfb93d35 --- /dev/null +++ b/test/libsolidity/syntaxTests/tryCatch/returns_mismatch.sol @@ -0,0 +1,11 @@ +contract C { + function f() public returns (uint, uint) { + try this.f() returns (uint a) { + a = 1; + } catch { + + } + } +} +// ---- +// TypeError 2800: (81-128): Function returns 2 values, but returns clause has 1 variables.