solidity/test/libsolidity/syntaxTests/nameAndTypeResolution/363_non_payable_constructor.sol
2020-04-28 16:03:52 +05:30

12 lines
265 B
Solidity

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