aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Kundt <bitshift@posteo.org>2018-07-07 01:42:44 +0800
committerErik Kundt <bitshift@posteo.org>2018-07-07 01:42:44 +0800
commit19f6b5ad05a20800babca49bfea25d3fadf46906 (patch)
tree3617fbf2c6c6d3c261ca48e800ad4daffe5d60f9
parent3f53db402f39516f4d89ed39f54a49dc11d89c65 (diff)
downloaddexon-solidity-19f6b5ad05a20800babca49bfea25d3fadf46906.tar.gz
dexon-solidity-19f6b5ad05a20800babca49bfea25d3fadf46906.tar.zst
dexon-solidity-19f6b5ad05a20800babca49bfea25d3fadf46906.zip
Updates interface constructor and function type test.
-rw-r--r--test/libsolidity/syntaxTests/constructor/interface_constructor_new.sol8
-rw-r--r--test/libsolidity/syntaxTests/constructor/interface_constructor_old.sol10
-rw-r--r--test/libsolidity/syntaxTests/functionTypes/valid_function_type_variables.sol15
3 files changed, 18 insertions, 15 deletions
diff --git a/test/libsolidity/syntaxTests/constructor/interface_constructor_new.sol b/test/libsolidity/syntaxTests/constructor/interface_constructor_new.sol
index 6efdea46..2cab1851 100644
--- a/test/libsolidity/syntaxTests/constructor/interface_constructor_new.sol
+++ b/test/libsolidity/syntaxTests/constructor/interface_constructor_new.sol
@@ -1,7 +1,7 @@
interface I {
- constructor() external;
+ constructor() public;
}
// ----
-// TypeError: (15-38): Constructor must be public or internal.
-// TypeError: (15-38): Constructor cannot be defined in interfaces.
-// TypeError: (15-38): Constructor must be implemented if declared.
+// Warning: (15-36): Functions in interfaces should 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 449d3f1b..313d4345 100644
--- a/test/libsolidity/syntaxTests/constructor/interface_constructor_old.sol
+++ b/test/libsolidity/syntaxTests/constructor/interface_constructor_old.sol
@@ -1,8 +1,8 @@
interface I {
- function I() external;
+ function I() public;
}
// ----
-// Warning: (15-37): Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead.
-// TypeError: (15-37): Constructor must be public or internal.
-// TypeError: (15-37): Constructor cannot be defined in interfaces.
-// TypeError: (15-37): Constructor must be implemented if declared.
+// 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): Constructor cannot be defined in interfaces.
+// TypeError: (15-35): Constructor must be implemented if declared.
diff --git a/test/libsolidity/syntaxTests/functionTypes/valid_function_type_variables.sol b/test/libsolidity/syntaxTests/functionTypes/valid_function_type_variables.sol
index 4a302e9b..e7d2c9a9 100644
--- a/test/libsolidity/syntaxTests/functionTypes/valid_function_type_variables.sol
+++ b/test/libsolidity/syntaxTests/functionTypes/valid_function_type_variables.sol
@@ -13,11 +13,14 @@ contract test {
function(uint) internal internal c = fc;
function(uint) external d = this.fd;
function(uint) external internal e = this.fe;
- function(uint) internal public f = ff;
- function(uint) internal pure public g = fg;
- function(uint) pure internal public h = fh;
+ function(uint) internal f = ff;
+ function(uint) internal pure g = fg;
+ function(uint) pure internal h = fh;
}
// ----
-// TypeError: (552-589): Internal or recursive type is not allowed for public state variables.
-// TypeError: (595-637): Internal or recursive type is not allowed for public state variables.
-// TypeError: (643-685): Internal or recursive type is not allowed for public state variables.
+// Warning: (20-47): Function state mutability can be restricted to pure
+// Warning: (52-81): Function state mutability can be restricted to pure
+// Warning: (86-115): Function state mutability can be restricted to pure
+// Warning: (120-149): Function state mutability can be restricted to pure
+// Warning: (154-183): Function state mutability can be restricted to pure
+// Warning: (188-217): Function state mutability can be restricted to pure