-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
239 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//@ignore-host: windows | ||
//@compile-flags: --emit=abi,hashes --pretty-json | ||
|
||
contract C { | ||
constructor() {} | ||
fallback() external {} | ||
} | ||
|
||
contract D is C { | ||
constructor() payable {} | ||
receive() external payable {} | ||
} | ||
|
||
// Inherits `C.fallback`, but not the constructor. | ||
contract E is C {} | ||
|
||
// Inherits `C.fallback` and `D.receive`, but not any of the constructors. | ||
contract F is D {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{ | ||
"contracts": { | ||
"ROOT/tests/ui/abi/contract_special_functions.sol:C": { | ||
"abi": [ | ||
{ | ||
"type": "constructor", | ||
"inputs": [], | ||
"stateMutability": "nonpayable" | ||
}, | ||
{ | ||
"type": "fallback", | ||
"stateMutability": "nonpayable" | ||
} | ||
], | ||
"hashes": {} | ||
}, | ||
"ROOT/tests/ui/abi/contract_special_functions.sol:D": { | ||
"abi": [ | ||
{ | ||
"type": "constructor", | ||
"inputs": [], | ||
"stateMutability": "payable" | ||
}, | ||
{ | ||
"type": "fallback", | ||
"stateMutability": "nonpayable" | ||
}, | ||
{ | ||
"type": "receive", | ||
"stateMutability": "payable" | ||
} | ||
], | ||
"hashes": {} | ||
}, | ||
"ROOT/tests/ui/abi/contract_special_functions.sol:E": { | ||
"abi": [ | ||
{ | ||
"type": "fallback", | ||
"stateMutability": "nonpayable" | ||
} | ||
], | ||
"hashes": {} | ||
}, | ||
"ROOT/tests/ui/abi/contract_special_functions.sol:F": { | ||
"abi": [ | ||
{ | ||
"type": "fallback", | ||
"stateMutability": "nonpayable" | ||
}, | ||
{ | ||
"type": "receive", | ||
"stateMutability": "payable" | ||
} | ||
], | ||
"hashes": {} | ||
} | ||
}, | ||
"version": "VERSION" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
contract C { | ||
constructor() {} | ||
constructor() {} //~ ERROR: constructor function already declared | ||
|
||
fallback() external {} | ||
fallback() external {} //~ ERROR: fallback function already declared | ||
|
||
receive() external payable {} | ||
receive() external payable {} //~ ERROR: receive function already declared | ||
} | ||
|
||
contract D { | ||
constructor() {} | ||
constructor() {} //~ ERROR: constructor function already declared | ||
constructor() {} //~ ERROR: constructor function already declared | ||
|
||
fallback() external {} | ||
fallback() external {} //~ ERROR: fallback function already declared | ||
fallback() external {} //~ ERROR: fallback function already declared | ||
|
||
receive() external payable {} | ||
receive() external payable {} //~ ERROR: receive function already declared | ||
receive() external payable {} //~ ERROR: receive function already declared | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
error: constructor function already declared | ||
--> ROOT/tests/ui/resolve/contract_special_functions.sol:LL:CC | ||
| | ||
LL | constructor() {} | ||
| ---------------- note: previous declaration here | ||
LL | constructor() {} | ||
| ^^^^^^^^^^^^^^^^ | ||
| | ||
|
||
error: fallback function already declared | ||
--> ROOT/tests/ui/resolve/contract_special_functions.sol:LL:CC | ||
| | ||
LL | fallback() external {} | ||
| ---------------------- note: previous declaration here | ||
LL | fallback() external {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
|
||
error: receive function already declared | ||
--> ROOT/tests/ui/resolve/contract_special_functions.sol:LL:CC | ||
| | ||
LL | receive() external payable {} | ||
| ----------------------------- note: previous declaration here | ||
LL | receive() external payable {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
|
||
error: constructor function already declared | ||
--> ROOT/tests/ui/resolve/contract_special_functions.sol:LL:CC | ||
| | ||
LL | constructor() {} | ||
| ---------------- note: previous declaration here | ||
LL | constructor() {} | ||
| ^^^^^^^^^^^^^^^^ | ||
| | ||
|
||
error: constructor function already declared | ||
--> ROOT/tests/ui/resolve/contract_special_functions.sol:LL:CC | ||
| | ||
LL | constructor() {} | ||
| ---------------- note: previous declaration here | ||
LL | constructor() {} | ||
LL | constructor() {} | ||
| ^^^^^^^^^^^^^^^^ | ||
| | ||
|
||
error: fallback function already declared | ||
--> ROOT/tests/ui/resolve/contract_special_functions.sol:LL:CC | ||
| | ||
LL | fallback() external {} | ||
| ---------------------- note: previous declaration here | ||
LL | fallback() external {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
|
||
error: fallback function already declared | ||
--> ROOT/tests/ui/resolve/contract_special_functions.sol:LL:CC | ||
| | ||
LL | fallback() external {} | ||
| ---------------------- note: previous declaration here | ||
LL | fallback() external {} | ||
LL | fallback() external {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
|
||
error: receive function already declared | ||
--> ROOT/tests/ui/resolve/contract_special_functions.sol:LL:CC | ||
| | ||
LL | receive() external payable {} | ||
| ----------------------------- note: previous declaration here | ||
LL | receive() external payable {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
|
||
error: receive function already declared | ||
--> ROOT/tests/ui/resolve/contract_special_functions.sol:LL:CC | ||
| | ||
LL | receive() external payable {} | ||
| ----------------------------- note: previous declaration here | ||
LL | receive() external payable {} | ||
LL | receive() external payable {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
|
||
error: aborting due to 9 previous errors | ||
|