mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #5557 from ethereum/fixInterfaceImplementedByPublicStateVariable
Public state variables are implementing external functions.
This commit is contained in:
+7
@@ -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(); }
|
||||
}
|
||||
+9
@@ -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.
|
||||
+7
@@ -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(); }
|
||||
}
|
||||
+9
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user