diff options
author | chriseth <chris@ethereum.org> | 2018-07-04 02:17:01 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-04 02:17:01 +0800 |
commit | 58aeffb45b206e8b55c3ae1cbc1f5a86157482fb (patch) | |
tree | 6402c116f6795df80955c21450c0a1e3a3aa5ead /test/libsolidity/syntaxTests/constructor | |
parent | 96a04be6842a15bbad22fb67a6aab9a9e9130636 (diff) | |
parent | a7fc8a996b666ecd0c90c8addb422ef640f8887c (diff) | |
download | dexon-solidity-58aeffb45b206e8b55c3ae1cbc1f5a86157482fb.tar dexon-solidity-58aeffb45b206e8b55c3ae1cbc1f5a86157482fb.tar.gz dexon-solidity-58aeffb45b206e8b55c3ae1cbc1f5a86157482fb.tar.bz2 dexon-solidity-58aeffb45b206e8b55c3ae1cbc1f5a86157482fb.tar.lz dexon-solidity-58aeffb45b206e8b55c3ae1cbc1f5a86157482fb.tar.xz dexon-solidity-58aeffb45b206e8b55c3ae1cbc1f5a86157482fb.tar.zst dexon-solidity-58aeffb45b206e8b55c3ae1cbc1f5a86157482fb.zip |
Merge pull request #4413 from ethereum/dropConstantKeywordOnly
Drop constant keyword only
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 15ed0e1e..78272c98 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() constant {} -} -contract test2 { constructor() view {} } -contract test3 { +contract test2 { constructor() pure {} } // ---- -// TypeError: (19-44): Constructor must be payable or non-payable, but is "view". -// TypeError: (66-87): Constructor must be payable or non-payable, but is "view". -// TypeError: (109-130): Constructor must be payable or non-payable, but is "pure". +// TypeError: (19-40): Constructor must be payable or non-payable, but is "view". +// TypeError: (62-83): 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 6dbcbc97..1ceaffee 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() constant {} + function test1() view {} } contract test2 { - function test2() view {} -} -contract test3 { - function test3() pure {} + function test2() 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". +// Warning: (21-45): Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead. +// Warning: (69-93): Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead. +// TypeError: (21-45): Constructor must be payable or non-payable, but is "view". +// TypeError: (69-93): Constructor must be payable or non-payable, but is "pure". |