mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Parse override keyword
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
contract X {
|
||||
int public override override testvar;
|
||||
function test() internal override override returns (uint256);
|
||||
}
|
||||
// ----
|
||||
// ParserError: (34-42): Override already specified.
|
||||
// ParserError: (87-95): Override already specified.
|
||||
@@ -0,0 +1,5 @@
|
||||
contract X {
|
||||
int public override testvar;
|
||||
function test() internal override returns (uint256);
|
||||
}
|
||||
// ----
|
||||
@@ -0,0 +1,10 @@
|
||||
contract A {
|
||||
int public testvar;
|
||||
function test() internal returns (uint256);
|
||||
}
|
||||
contract X is A {
|
||||
int public override testvar;
|
||||
function test() internal override() returns (uint256);
|
||||
}
|
||||
// ----
|
||||
// ParserError: (164-165): Expected identifier but got ')'
|
||||
@@ -0,0 +1,9 @@
|
||||
contract A {
|
||||
function foo() internal returns (uint256);
|
||||
}
|
||||
contract X {
|
||||
int public override testvar;
|
||||
function test() internal override returns (uint256);
|
||||
function foo() internal override(X, A) returns (uint256);
|
||||
}
|
||||
// ----
|
||||
@@ -0,0 +1,8 @@
|
||||
contract A {
|
||||
function foo() internal returns (uint256);
|
||||
}
|
||||
contract X {
|
||||
int public override(A,) testvar;
|
||||
}
|
||||
// ----
|
||||
// ParserError: (95-96): Expected identifier but got ')'
|
||||
@@ -0,0 +1,8 @@
|
||||
contract A {
|
||||
function foo() internal returns (uint256);
|
||||
}
|
||||
contract X {
|
||||
function test() internal override(,) returns (uint256);
|
||||
}
|
||||
// ----
|
||||
// ParserError: (107-108): Expected identifier but got ','
|
||||
@@ -0,0 +1,8 @@
|
||||
contract A {
|
||||
function foo() internal returns (uint256);
|
||||
}
|
||||
contract X {
|
||||
function foo() internal override(X, address) returns (uint256);
|
||||
}
|
||||
// ----
|
||||
// ParserError: (109-116): Expected identifier but got 'address'
|
||||
@@ -0,0 +1,8 @@
|
||||
contract A {
|
||||
function foo() internal returns (uint256);
|
||||
}
|
||||
contract X {
|
||||
int public override() testvar;
|
||||
}
|
||||
// ----
|
||||
// ParserError: (93-94): Expected identifier but got ')'
|
||||
Reference in New Issue
Block a user