From 1e7a23a2051c07adbafc60e3c82b34ee307e9647 Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 22 Nov 2018 17:28:02 +0100 Subject: Changelog entry and tests. --- .../inheritance/override/change_return_types_in_interface.sol | 10 ++++++++++ .../syntaxTests/nameAndTypeResolution/182_equal_overload.sol | 1 + 2 files changed, 11 insertions(+) create mode 100644 test/libsolidity/syntaxTests/inheritance/override/change_return_types_in_interface.sol (limited to 'test/libsolidity') diff --git a/test/libsolidity/syntaxTests/inheritance/override/change_return_types_in_interface.sol b/test/libsolidity/syntaxTests/inheritance/override/change_return_types_in_interface.sol new file mode 100644 index 00000000..804a1810 --- /dev/null +++ b/test/libsolidity/syntaxTests/inheritance/override/change_return_types_in_interface.sol @@ -0,0 +1,10 @@ +interface I { + function f() external pure returns (uint); +} +contract B is I { + // The compiler used to have a bug where changing + // the return type was fine in this situation. + function f() public pure returns (uint, uint) {} +} +// ---- +// TypeError: (182-230): Overriding function return types differ. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/182_equal_overload.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/182_equal_overload.sol index 6f0c7df7..86585518 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/182_equal_overload.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/182_equal_overload.sol @@ -4,3 +4,4 @@ contract C { } // ---- // DeclarationError: (17-66): Function with same name and arguments defined twice. +// TypeError: (17-66): Overriding function return types differ. -- cgit