solidity/test/libsolidity/syntaxTests/constructor/constructor_state_mutability_old.sol

12 lines
576 B
Solidity
Raw Normal View History

2018-04-17 09:39:40 +00:00
contract test1 {
2018-07-04 09:47:35 +00:00
function test1() public view {}
2018-04-17 09:39:40 +00:00
}
contract test2 {
2018-07-04 09:47:35 +00:00
function test2() public pure {}
2018-04-17 09:39:40 +00:00
}
// ----
2018-07-04 09:47:35 +00:00
// Warning: (21-52): Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead.
// Warning: (76-107): Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead.
// TypeError: (21-52): Constructor must be payable or non-payable, but is "view".
// TypeError: (76-107): Constructor must be payable or non-payable, but is "pure".