From 6d2e59cc80eb67c6029f383c5fb02e258bab7650 Mon Sep 17 00:00:00 2001 From: chriseth Date: Mon, 9 Dec 2019 16:14:22 +0100 Subject: [PATCH] More tests. --- ..._base_and_unique_implementation_modifier.sol | 17 +++++++++++++++++ .../override/override_modifier_no_override.sol | 7 +++++++ 2 files changed, 24 insertions(+) create mode 100644 test/libsolidity/syntaxTests/inheritance/override/nonintermediate_common_base_and_unique_implementation_modifier.sol create mode 100644 test/libsolidity/syntaxTests/inheritance/override/override_modifier_no_override.sol diff --git a/test/libsolidity/syntaxTests/inheritance/override/nonintermediate_common_base_and_unique_implementation_modifier.sol b/test/libsolidity/syntaxTests/inheritance/override/nonintermediate_common_base_and_unique_implementation_modifier.sol new file mode 100644 index 000000000..9c36dc715 --- /dev/null +++ b/test/libsolidity/syntaxTests/inheritance/override/nonintermediate_common_base_and_unique_implementation_modifier.sol @@ -0,0 +1,17 @@ +contract I { + modifier f() { _; } +} +contract J { + modifier f() { _; } +} +contract IJ is I, J { + modifier f() virtual override (I, J) { _; } +} +contract A is IJ +{ + modifier f() override { _; } +} +contract B is IJ +{ +} +contract C is A, B {} diff --git a/test/libsolidity/syntaxTests/inheritance/override/override_modifier_no_override.sol b/test/libsolidity/syntaxTests/inheritance/override/override_modifier_no_override.sol new file mode 100644 index 000000000..49a084965 --- /dev/null +++ b/test/libsolidity/syntaxTests/inheritance/override/override_modifier_no_override.sol @@ -0,0 +1,7 @@ +abstract contract A { +} +abstract contract X is A { + modifier f() override { _; } +} +// ---- +// TypeError: (65-73): Modifier has override specified but does not override anything.