mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Disallow specifying call options multiple times.
This commit is contained in:
@@ -5,8 +5,9 @@ contract C {
|
||||
v = this.f{value: 10}(2);
|
||||
x = this.f{gas: 1000}(2, 3);
|
||||
y = this.f{gas: 1000, value: 10}(2, 3);
|
||||
z = this.f{gas: 1000}{value: 10}(2, 3);
|
||||
z = this.f{value: 10, gas: 1000}(2, 3);
|
||||
}
|
||||
function bal() external returns (uint) { return address(this).balance; }
|
||||
receive() external payable {}
|
||||
}
|
||||
// ====
|
||||
@@ -14,3 +15,4 @@ contract C {
|
||||
// ----
|
||||
// (), 1 ether
|
||||
// call() -> 1, 2, 2, 2
|
||||
// bal() -> 1000000000000000000
|
||||
|
||||
@@ -12,8 +12,8 @@ contract B
|
||||
contract A {
|
||||
function f() public payable returns (uint, uint, uint) {
|
||||
B x = new B{salt: "abc", value: 3}(7);
|
||||
B y = new B{value: 3}{salt: "abc"}(8);
|
||||
B z = new B{value: 3, salt: "abc"}(9);
|
||||
B y = new B{value: 3, salt: "abc"}(8);
|
||||
B z = new B{salt: "abc", value: 3}(9);
|
||||
return (x.getBalance(), y.getBalance(), z.getBalance());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,9 +11,8 @@ contract C {
|
||||
// ====
|
||||
// EVMVersion: >=constantinople
|
||||
// ----
|
||||
// TypeError 9886: (78-110): Option "gas" has already been set.
|
||||
// TypeError 9886: (120-154): Option "gas" has already been set.
|
||||
// TypeError 9886: (164-198): Option "value" has already been set.
|
||||
// TypeError 9886: (208-249): Option "value" has already been set.
|
||||
// TypeError 9886: (208-249): Option "gas" has already been set.
|
||||
// TypeError 9886: (259-286): Option "salt" has already been set.
|
||||
// TypeError 1645: (78-110): Function call options have already been set, you have to combine them into a single {...}-option.
|
||||
// TypeError 1645: (120-154): Function call options have already been set, you have to combine them into a single {...}-option.
|
||||
// TypeError 1645: (164-198): Function call options have already been set, you have to combine them into a single {...}-option.
|
||||
// TypeError 1645: (208-249): Function call options have already been set, you have to combine them into a single {...}-option.
|
||||
// TypeError 1645: (259-286): Function call options have already been set, you have to combine them into a single {...}-option.
|
||||
|
||||
Reference in New Issue
Block a user