solidity/test/libsolidity/syntaxTests/nameAndTypeResolution/363_non_payable_constructor.sol

12 lines
262 B
Solidity
Raw Normal View History

contract C {
2020-06-23 12:14:24 +00:00
constructor() { }
}
contract D {
function f() public returns (uint) {
2020-04-03 14:29:17 +00:00
(new C){value: 2}();
return 2;
}
}
// ----
2020-06-23 12:14:24 +00:00
// TypeError 7006: (99-116): Cannot set option "value", since the constructor of contract C is not payable.