diff options
Diffstat (limited to 'test/libsolidity/syntaxTests/constructor')
-rw-r--r-- | test/libsolidity/syntaxTests/constructor/constructor_state_mutability_new.sol | 10 | ||||
-rw-r--r-- | test/libsolidity/syntaxTests/constructor/constructor_state_mutability_old.sol | 17 |
2 files changed, 9 insertions, 18 deletions
diff --git a/test/libsolidity/syntaxTests/constructor/constructor_state_mutability_new.sol b/test/libsolidity/syntaxTests/constructor/constructor_state_mutability_new.sol index c247afb9..39bf6384 100644 --- a/test/libsolidity/syntaxTests/constructor/constructor_state_mutability_new.sol +++ b/test/libsolidity/syntaxTests/constructor/constructor_state_mutability_new.sol @@ -1,13 +1,9 @@ contract test1 { - constructor() public constant {} -} -contract test2 { constructor() public view {} } -contract test3 { +contract test2 { constructor() public pure {} } // ---- -// TypeError: (19-51): Constructor must be payable or non-payable, but is "view". -// TypeError: (73-101): Constructor must be payable or non-payable, but is "view". -// TypeError: (123-151): Constructor must be payable or non-payable, but is "pure". +// TypeError: (19-47): Constructor must be payable or non-payable, but is "view". +// TypeError: (69-97): Constructor must be payable or non-payable, but is "pure". diff --git a/test/libsolidity/syntaxTests/constructor/constructor_state_mutability_old.sol b/test/libsolidity/syntaxTests/constructor/constructor_state_mutability_old.sol index 1e3031ec..b9f2a4bb 100644 --- a/test/libsolidity/syntaxTests/constructor/constructor_state_mutability_old.sol +++ b/test/libsolidity/syntaxTests/constructor/constructor_state_mutability_old.sol @@ -1,16 +1,11 @@ contract test1 { - function test1() public constant {} + function test1() public view {} } contract test2 { - function test2() public view {} -} -contract test3 { - function test3() public pure {} + function test2() public pure {} } // ---- -// Warning: (21-56): Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead. -// Warning: (80-111): Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead. -// Warning: (135-166): Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead. -// TypeError: (21-56): Constructor must be payable or non-payable, but is "view". -// TypeError: (80-111): Constructor must be payable or non-payable, but is "view". -// TypeError: (135-166): Constructor must be payable or non-payable, but is "pure". +// 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". |