Adds default visibility specifier to syntax tests.

This commit is contained in:
Erik Kundt
2018-07-04 10:45:59 +02:00
parent 533d5d4b1c
commit 2e0d019ef0
37 changed files with 619 additions and 610 deletions
@@ -1,9 +1,13 @@
contract test1 {
constructor() view {}
constructor() public constant {}
}
contract test2 {
constructor() pure {}
constructor() public view {}
}
contract test3 {
constructor() public 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".
// 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".
@@ -1,11 +1,16 @@
contract test1 {
function test1() view {}
function test1() public constant {}
}
contract test2 {
function test2() pure {}
function test2() public view {}
}
contract test3 {
function test3() public 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".
// 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".
@@ -1,5 +1,5 @@
contract C {
constructor();
constructor() public;
}
// ----
// TypeError: (14-28): Constructor must be implemented if declared.
// TypeError: (14-35): Constructor must be implemented if declared.
@@ -1,6 +1,6 @@
contract C {
function C();
function C() public;
}
// ----
// Warning: (14-27): Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead.
// TypeError: (14-27): Constructor must be implemented if declared.
// Warning: (14-34): Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead.
// TypeError: (14-34): Constructor must be implemented if declared.
@@ -1,7 +1,7 @@
interface I {
constructor();
constructor() public;
}
// ----
// Warning: (15-29): Functions in interfaces should be declared external.
// TypeError: (15-29): Constructor cannot be defined in interfaces.
// TypeError: (15-29): Constructor must be implemented if declared.
// Warning: (15-36): Functions in interfaces should be declared external.
// TypeError: (15-36): Constructor cannot be defined in interfaces.
// TypeError: (15-36): Constructor must be implemented if declared.
@@ -1,8 +1,8 @@
interface I {
function I();
function I() public;
}
// ----
// Warning: (15-28): Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead.
// Warning: (15-28): Functions in interfaces should be declared external.
// TypeError: (15-28): Constructor cannot be defined in interfaces.
// TypeError: (15-28): Constructor must be implemented if declared.
// Warning: (15-35): Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead.
// Warning: (15-35): Functions in interfaces should be declared external.
// TypeError: (15-35): Constructor cannot be defined in interfaces.
// TypeError: (15-35): Constructor must be implemented if declared.
@@ -1,6 +1,6 @@
library Lib {
constructor();
constructor() public;
}
// ----
// TypeError: (15-29): Constructor cannot be defined in libraries.
// TypeError: (15-29): Constructor must be implemented if declared.
// TypeError: (15-36): Constructor cannot be defined in libraries.
// TypeError: (15-36): Constructor must be implemented if declared.
@@ -1,7 +1,7 @@
library Lib {
function Lib();
function Lib() public;
}
// ----
// Warning: (15-30): Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead.
// TypeError: (15-30): Constructor cannot be defined in libraries.
// TypeError: (15-30): Constructor must be implemented if declared.
// Warning: (15-37): Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead.
// TypeError: (15-37): Constructor cannot be defined in libraries.
// TypeError: (15-37): Constructor must be implemented if declared.