diff --git a/crates/parser/test_files/errors/global_declaration.snap b/crates/parser/test_files/errors/global_declaration.snap new file mode 100644 index 00000000..e3ea1599 --- /dev/null +++ b/crates/parser/test_files/errors/global_declaration.snap @@ -0,0 +1,25 @@ +--- +source: crates/parser/tests/errors.rs +input_file: test_files/errors/global_declaration.sntn +--- +error: parse error + --> global_declaration.sntn:5:28 + | +5 | global private i256 $IMM = [0] + | ^^^ type error: expected `i256` here + |error: parse error + --> global_declaration.sntn:6:38 + | +6 | global public const [i8; 1] $ARRAY = [1, 2] + | ^^^^^^ type error: expected `i8` here + |error: parse error + --> global_declaration.sntn:7:33 + | +7 | global public const @foo $FOO = { 1, 2 } + | ^^^^^^^^ type error: expected `@foo` here + |error: parse error + --> global_declaration.sntn:8:38 + | +8 | global public const @bar $BAR = { 1, {1, 2} } + | ^^^^^^ type error: expected `@foo` here + | diff --git a/crates/parser/test_files/errors/global_declaration.sntn b/crates/parser/test_files/errors/global_declaration.sntn new file mode 100644 index 00000000..59ac4630 --- /dev/null +++ b/crates/parser/test_files/errors/global_declaration.sntn @@ -0,0 +1,9 @@ +target = "evm-ethereum-cancun" + +type @foo = { i8, i16, *i64 }; +type @bar = { i16, @foo }; + +global private i256 $IMM = [0] +global public const [i8; 1] $ARRAY = [1, 2] +global public const @foo $FOO = { 1, 2 } +global public const @bar $BAR = { 1, {1, 2} }