Merge pull request #5557 from ethereum/fixInterfaceImplementedByPublicStateVariable

Public state variables are implementing external functions.
This commit is contained in:
chriseth
2018-12-03 10:46:44 +01:00
committed by GitHub
7 changed files with 66 additions and 21 deletions
@@ -0,0 +1,7 @@
interface X { function test() external returns (uint256); }
contract Y is X {
uint256 public test = 42;
}
contract T {
constructor() public { new Y(); }
}
@@ -0,0 +1,9 @@
contract X { function test() internal returns (uint256); }
contract Y is X {
uint256 public test = 42;
}
contract T {
constructor() public { new Y(); }
}
// ----
// DeclarationError: (81-105): Identifier already declared.
@@ -0,0 +1,7 @@
contract X { function test() private returns (uint256); }
contract Y is X {
uint256 public test = 42;
}
contract T {
constructor() public { new Y(); }
}
@@ -0,0 +1,9 @@
contract X { function test() public returns (uint256); }
contract Y is X {
uint256 public test = 42;
}
contract T {
constructor() public { new Y(); }
}
// ----
// DeclarationError: (79-103): Identifier already declared.
@@ -6,3 +6,4 @@ contract C is A {
}
// ----
// DeclarationError: (50-85): Identifier already declared.
// TypeError: (50-85): Redeclaring an already implemented function as abstract