aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-07-16 20:43:56 +0800
committerGitHub <noreply@github.com>2018-07-16 20:43:56 +0800
commit931794001e92cbfe99c91da037cf36a1808d9df1 (patch)
tree0bfb67ef7175f9758cfef0a4ca8e290570903965 /test/libsolidity
parent58667db8b891a535dfc139144271c1bd8a1e067a (diff)
parent396bf118585d213a397be990b5118a47ac4753c1 (diff)
downloaddexon-solidity-931794001e92cbfe99c91da037cf36a1808d9df1.tar.gz
dexon-solidity-931794001e92cbfe99c91da037cf36a1808d9df1.tar.zst
dexon-solidity-931794001e92cbfe99c91da037cf36a1808d9df1.zip
Merge pull request #4500 from ethereum/v050-interface-functions-must-be-external
[BREAKING] interface functions must be external
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/SolidityEndToEndTest.cpp2
-rw-r--r--test/libsolidity/syntaxTests/constructor/interface_constructor_new.sol2
-rw-r--r--test/libsolidity/syntaxTests/constructor/interface_constructor_old.sol2
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/416_interface_function_bodies.sol5
-rw-r--r--test/libsolidity/syntaxTests/nameAndTypeResolution/421_interface_function_parameters.sol3
-rw-r--r--test/libsolidity/syntaxTests/parsing/interface_basic.sol3
-rw-r--r--test/libsolidity/syntaxTests/visibility/interface/function_default.sol3
-rw-r--r--test/libsolidity/syntaxTests/visibility/interface/function_internal.sol2
-rw-r--r--test/libsolidity/syntaxTests/visibility/interface/function_private.sol2
-rw-r--r--test/libsolidity/syntaxTests/visibility/interface/function_public.sol2
10 files changed, 11 insertions, 15 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp
index f76f1196..be74c5ff 100644
--- a/test/libsolidity/SolidityEndToEndTest.cpp
+++ b/test/libsolidity/SolidityEndToEndTest.cpp
@@ -11649,7 +11649,7 @@ BOOST_AUTO_TEST_CASE(interface_contract)
char const* sourceCode = R"(
interface I {
event A();
- function f() public returns (bool);
+ function f() external returns (bool);
function() external payable;
}
diff --git a/test/libsolidity/syntaxTests/constructor/interface_constructor_new.sol b/test/libsolidity/syntaxTests/constructor/interface_constructor_new.sol
index 2cab1851..87585a62 100644
--- a/test/libsolidity/syntaxTests/constructor/interface_constructor_new.sol
+++ b/test/libsolidity/syntaxTests/constructor/interface_constructor_new.sol
@@ -2,6 +2,6 @@ interface I {
constructor() public;
}
// ----
-// Warning: (15-36): Functions in interfaces should be declared external.
+// TypeError: (15-36): Functions in interfaces must be declared external.
// TypeError: (15-36): Constructor cannot be defined in interfaces.
// TypeError: (15-36): Constructor must be implemented if declared.
diff --git a/test/libsolidity/syntaxTests/constructor/interface_constructor_old.sol b/test/libsolidity/syntaxTests/constructor/interface_constructor_old.sol
index 313d4345..2c029f4d 100644
--- a/test/libsolidity/syntaxTests/constructor/interface_constructor_old.sol
+++ b/test/libsolidity/syntaxTests/constructor/interface_constructor_old.sol
@@ -3,6 +3,6 @@ interface I {
}
// ----
// Warning: (15-35): Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead.
-// Warning: (15-35): Functions in interfaces should be declared external.
+// TypeError: (15-35): Functions in interfaces must be declared external.
// TypeError: (15-35): Constructor cannot be defined in interfaces.
// TypeError: (15-35): Constructor must be implemented if declared.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/416_interface_function_bodies.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/416_interface_function_bodies.sol
index 24b26c04..fee2525e 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/416_interface_function_bodies.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/416_interface_function_bodies.sol
@@ -1,7 +1,6 @@
interface I {
- function f() public {
+ function f() external pure {
}
}
// ----
-// TypeError: (18-45): Functions in interfaces cannot have an implementation.
-// Warning: (18-45): Functions in interfaces should be declared external.
+// TypeError: (18-52): Functions in interfaces cannot have an implementation.
diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/421_interface_function_parameters.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/421_interface_function_parameters.sol
index 05e2dcfd..9722e936 100644
--- a/test/libsolidity/syntaxTests/nameAndTypeResolution/421_interface_function_parameters.sol
+++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/421_interface_function_parameters.sol
@@ -1,5 +1,4 @@
interface I {
- function f(uint a) public returns (bool);
+ function f(uint a) external returns (bool);
}
// ----
-// Warning: (18-59): Functions in interfaces should be declared external.
diff --git a/test/libsolidity/syntaxTests/parsing/interface_basic.sol b/test/libsolidity/syntaxTests/parsing/interface_basic.sol
index 2363eaa8..0742c24f 100644
--- a/test/libsolidity/syntaxTests/parsing/interface_basic.sol
+++ b/test/libsolidity/syntaxTests/parsing/interface_basic.sol
@@ -1,5 +1,4 @@
interface Interface {
- function f() public;
+ function f() external;
}
// ----
-// Warning: (23-43): Functions in interfaces should be declared external.
diff --git a/test/libsolidity/syntaxTests/visibility/interface/function_default.sol b/test/libsolidity/syntaxTests/visibility/interface/function_default.sol
index 72ce3b40..161d66e1 100644
--- a/test/libsolidity/syntaxTests/visibility/interface/function_default.sol
+++ b/test/libsolidity/syntaxTests/visibility/interface/function_default.sol
@@ -2,5 +2,4 @@ interface I {
function f();
}
// ----
-// Warning: (15-28): Functions in interfaces should be declared external.
-// Warning: (15-28): No visibility specified. Defaulting to "public". In interfaces it defaults to external.
+// TypeError: (15-28): Functions in interfaces must be declared external.
diff --git a/test/libsolidity/syntaxTests/visibility/interface/function_internal.sol b/test/libsolidity/syntaxTests/visibility/interface/function_internal.sol
index ac62e69b..06c1547a 100644
--- a/test/libsolidity/syntaxTests/visibility/interface/function_internal.sol
+++ b/test/libsolidity/syntaxTests/visibility/interface/function_internal.sol
@@ -2,4 +2,4 @@ interface I {
function f() internal;
}
// ----
-// TypeError: (15-37): Functions in interfaces cannot be internal or private.
+// TypeError: (15-37): Functions in interfaces must be declared external.
diff --git a/test/libsolidity/syntaxTests/visibility/interface/function_private.sol b/test/libsolidity/syntaxTests/visibility/interface/function_private.sol
index 881e647e..98198c3d 100644
--- a/test/libsolidity/syntaxTests/visibility/interface/function_private.sol
+++ b/test/libsolidity/syntaxTests/visibility/interface/function_private.sol
@@ -2,4 +2,4 @@ interface I {
function f() private;
}
// ----
-// TypeError: (15-36): Functions in interfaces cannot be internal or private.
+// TypeError: (15-36): Functions in interfaces must be declared external.
diff --git a/test/libsolidity/syntaxTests/visibility/interface/function_public.sol b/test/libsolidity/syntaxTests/visibility/interface/function_public.sol
index 891d9fdf..a8cea199 100644
--- a/test/libsolidity/syntaxTests/visibility/interface/function_public.sol
+++ b/test/libsolidity/syntaxTests/visibility/interface/function_public.sol
@@ -2,4 +2,4 @@ interface I {
function f() public;
}
// ----
-// Warning: (15-35): Functions in interfaces should be declared external.
+// TypeError: (15-35): Functions in interfaces must be declared external.