Merge pull request #9492 from ethereum/someValueTests

Some more tests for value.
This commit is contained in:
chriseth 2020-07-23 19:09:28 +02:00 committed by GitHub
commit 7ff3d10fee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,11 @@
contract C {
constructor() {}
}
contract D {
function createC() public returns (C) {
C c = (new C).value(2)();
return c;
}
}
// ----
// TypeError 8827: (107-120): Constructor for contract C must be payable for member "value" to be available.

View File

@ -0,0 +1,8 @@
library L { function l() public {} }
contract test {
function f() public {
L.l{value: 1}();
}
}
// ----
// TypeError 2193: (87-100): Function call options can only be set on external function calls or contract creations.