aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/syntaxTests/fallback
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-06-29 00:08:45 +0800
committerchriseth <chris@ethereum.org>2018-06-29 06:23:52 +0800
commiteeef82b2d77c6f956039c57b0598e684254ee6dd (patch)
tree82887915936dbf242d5574c1fe9d61f5ace312d9 /test/libsolidity/syntaxTests/fallback
parent4268062985e434b00f07e3f90772b94538933b9c (diff)
downloaddexon-solidity-eeef82b2d77c6f956039c57b0598e684254ee6dd.tar.gz
dexon-solidity-eeef82b2d77c6f956039c57b0598e684254ee6dd.tar.zst
dexon-solidity-eeef82b2d77c6f956039c57b0598e684254ee6dd.zip
Fallback function has to be external: backwards-compatible changes.
Diffstat (limited to 'test/libsolidity/syntaxTests/fallback')
-rw-r--r--test/libsolidity/syntaxTests/fallback/default_visibility.sol6
-rw-r--r--test/libsolidity/syntaxTests/fallback/pure_modifier.sol4
-rw-r--r--test/libsolidity/syntaxTests/fallback/view_modifier.sol4
3 files changed, 10 insertions, 4 deletions
diff --git a/test/libsolidity/syntaxTests/fallback/default_visibility.sol b/test/libsolidity/syntaxTests/fallback/default_visibility.sol
new file mode 100644
index 00000000..2cb0af90
--- /dev/null
+++ b/test/libsolidity/syntaxTests/fallback/default_visibility.sol
@@ -0,0 +1,6 @@
+contract C {
+ // Check that visibility is also enforced for the fallback function.
+ function() {}
+}
+// ----
+// Warning: (90-103): No visibility specified. Defaulting to "public".
diff --git a/test/libsolidity/syntaxTests/fallback/pure_modifier.sol b/test/libsolidity/syntaxTests/fallback/pure_modifier.sol
index 20d5b0ac..12d790d1 100644
--- a/test/libsolidity/syntaxTests/fallback/pure_modifier.sol
+++ b/test/libsolidity/syntaxTests/fallback/pure_modifier.sol
@@ -1,6 +1,6 @@
contract C {
uint x;
- function() pure { x = 2; }
+ function() external pure { x = 2; }
}
// ----
-// TypeError: (29-55): Fallback function must be payable or non-payable, but is "pure".
+// TypeError: (29-64): Fallback function must be payable or non-payable, but is "pure".
diff --git a/test/libsolidity/syntaxTests/fallback/view_modifier.sol b/test/libsolidity/syntaxTests/fallback/view_modifier.sol
index 44c5d204..2497e9fa 100644
--- a/test/libsolidity/syntaxTests/fallback/view_modifier.sol
+++ b/test/libsolidity/syntaxTests/fallback/view_modifier.sol
@@ -1,6 +1,6 @@
contract C {
uint x;
- function() view { x = 2; }
+ function() external view { x = 2; }
}
// ----
-// TypeError: (29-55): Fallback function must be payable or non-payable, but is "view".
+// TypeError: (29-64): Fallback function must be payable or non-payable, but is "view".