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

12 lines
270 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-06-22 16:43:57 +00:00
// TypeError 7006: (106-123): Cannot set option "value", since the constructor of contract C is not payable.