mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Update test suite to use address payable.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
contract C {
|
||||
function f() public {
|
||||
address addr;
|
||||
address payable addr;
|
||||
uint balance = addr.balance;
|
||||
(bool callSuc,) = addr.call("");
|
||||
(bool delegatecallSuc,) = addr.delegatecall("");
|
||||
|
||||
@@ -6,6 +6,8 @@ contract C {
|
||||
function transfer(uint amount) public {
|
||||
address(this).transfer(amount); // to avoid pureness warning
|
||||
}
|
||||
function() payable external {
|
||||
}
|
||||
}
|
||||
contract D {
|
||||
function f() public {
|
||||
|
||||
@@ -16,6 +16,8 @@ contract C {
|
||||
(bool success,) = address(this).call("");
|
||||
require(success);
|
||||
}
|
||||
function() payable external {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (52-77): Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable.
|
||||
|
||||
Reference in New Issue
Block a user