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

12 lines
265 B
Solidity
Raw Normal View History

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