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

17 lines
844 B
Solidity
Raw Normal View History

2018-04-17 09:39:40 +00:00
contract test1 {
function test1() constant {}
}
contract test2 {
function test2() view {}
}
contract test3 {
function test3() pure {}
}
// ----
// Warning: (21-49): Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead.
// Warning: (73-97): Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead.
// Warning: (121-145): Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead.
// TypeError: (21-49): Constructor must be payable or non-payable, but is "view".
// TypeError: (73-97): Constructor must be payable or non-payable, but is "view".
// TypeError: (121-145): Constructor must be payable or non-payable, but is "pure".