From 2309ae3edd8b81b49c4a440d19e3c1cb06dcb4b5 Mon Sep 17 00:00:00 2001 From: hrkrshnn Date: Thu, 3 Jun 2021 10:43:52 +0200 Subject: [PATCH] Added tests for internal or recursive types as event / error param After converting the error about mapping parameter in event / error into a fatal type error, we were missing tests that reached the "internal or recursive types" error. --- test/libsolidity/syntaxTests/errors/internal_type.sol | 9 +++++++++ test/libsolidity/syntaxTests/events/internal_type.sol | 11 +++++++++++ 2 files changed, 20 insertions(+) create mode 100644 test/libsolidity/syntaxTests/errors/internal_type.sol create mode 100644 test/libsolidity/syntaxTests/events/internal_type.sol diff --git a/test/libsolidity/syntaxTests/errors/internal_type.sol b/test/libsolidity/syntaxTests/errors/internal_type.sol new file mode 100644 index 000000000..b88a27435 --- /dev/null +++ b/test/libsolidity/syntaxTests/errors/internal_type.sol @@ -0,0 +1,9 @@ +error E1(function() internal); +error E2(S); + +struct S { + S[] ss; +} +// ---- +// TypeError 3417: (9-29): Internal or recursive type is not allowed as error parameter type. +// TypeError 3417: (40-41): Internal or recursive type is not allowed as error parameter type. diff --git a/test/libsolidity/syntaxTests/events/internal_type.sol b/test/libsolidity/syntaxTests/events/internal_type.sol new file mode 100644 index 000000000..1e584a8eb --- /dev/null +++ b/test/libsolidity/syntaxTests/events/internal_type.sol @@ -0,0 +1,11 @@ +struct S { + S[] ss; +} + +contract C { + event E1(function() internal); + event E2(S); +} +// ---- +// TypeError 3417: (52-72): Internal or recursive type is not allowed as event parameter type. +// TypeError 3417: (87-88): Internal or recursive type is not allowed as event parameter type.