Some more tests for value.

This commit is contained in:
chriseth 2020-07-23 14:57:41 +02:00
parent ba4e05c62c
commit 4f611fbf17
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.