Merge pull request #4376 from ethereum/fallbackExternal

Fallback functions have to be external
This commit is contained in:
chriseth
2018-07-10 21:39:25 +02:00
committed by GitHub
12 changed files with 10 additions and 30 deletions
@@ -3,4 +3,4 @@ contract C {
function() {}
}
// ----
// Warning: (90-103): No visibility specified. Defaulting to "public".
// TypeError: (90-103): Fallback function must be defined as "external".
@@ -1,6 +1,6 @@
contract C {
uint[] x;
function() public {
function() external {
uint[] storage y = x;
assembly {
pop(y)
@@ -8,4 +8,4 @@ contract C {
}
}
// ----
// TypeError: (117-118): You have to use the _slot or _offset suffix to access storage reference variables.
// TypeError: (119-120): You have to use the _slot or _offset suffix to access storage reference variables.
@@ -1,6 +1,6 @@
contract C {
uint[] x;
function() public {
function() external {
uint[] storage y = x;
assembly {
pop(y_slot)
@@ -1,4 +0,0 @@
pragma experimental "v0.5.0";
contract C {
function () external { }
}
@@ -2,3 +2,4 @@ contract C {
function () internal { }
}
// ----
// TypeError: (17-41): Fallback function must be defined as "external".
@@ -1,6 +0,0 @@
pragma experimental "v0.5.0";
contract C {
function () internal { }
}
// ----
// TypeError: (47-71): Fallback function must be defined as "external".
@@ -2,3 +2,4 @@ contract C {
function () private { }
}
// ----
// TypeError: (17-40): Fallback function must be defined as "external".
@@ -1,6 +0,0 @@
pragma experimental "v0.5.0";
contract C {
function () private { }
}
// ----
// TypeError: (47-70): Fallback function must be defined as "external".
@@ -2,3 +2,4 @@ contract C {
function () public { }
}
// ----
// TypeError: (17-39): Fallback function must be defined as "external".
@@ -1,6 +0,0 @@
pragma experimental "v0.5.0";
contract C {
function () public { }
}
// ----
// TypeError: (47-69): Fallback function must be defined as "external".