Add source locations to syntax test expectations.

This commit is contained in:
Daniel Kirchner
2018-04-10 14:08:22 +02:00
parent 2bc4ec31e2
commit f03695731b
55 changed files with 216 additions and 108 deletions
@@ -2,4 +2,4 @@ contract C {
uint constant a = a;
}
// ----
// TypeError: The value of the constant a has a cyclic dependency via a.
// TypeError: (17-36): The value of the constant a has a cyclic dependency via a.
@@ -5,6 +5,6 @@ contract C {
uint constant d = 2 + a;
}
// ----
// TypeError: The value of the constant a has a cyclic dependency via c.
// TypeError: The value of the constant c has a cyclic dependency via d.
// TypeError: The value of the constant d has a cyclic dependency via a.
// TypeError: (17-40): The value of the constant a has a cyclic dependency via c.
// TypeError: (71-111): The value of the constant c has a cyclic dependency via d.
// TypeError: (117-140): The value of the constant d has a cyclic dependency via a.
@@ -5,7 +5,7 @@ contract C {
uint constant c = b;
}
// ----
// TypeError: The value of the constant x has a cyclic dependency via a.
// TypeError: The value of the constant a has a cyclic dependency via b.
// TypeError: The value of the constant b has a cyclic dependency via c.
// TypeError: The value of the constant c has a cyclic dependency via b.
// TypeError: (17-36): The value of the constant x has a cyclic dependency via a.
// TypeError: (42-65): The value of the constant a has a cyclic dependency via b.
// TypeError: (71-90): The value of the constant b has a cyclic dependency via c.
// TypeError: (96-115): The value of the constant c has a cyclic dependency via b.
@@ -3,4 +3,4 @@ contract test {
uint128 variable;
}
// ----
// DeclarationError: Identifier already declared.
// DeclarationError: (36-52): Identifier already declared.
@@ -5,4 +5,4 @@ contract test {
}
}
// ----
// DeclarationError: Identifier already declared.
// DeclarationError: (71-80): Identifier already declared.
@@ -6,6 +6,6 @@ contract test {
}
}
// ----
// Warning: This declaration shadows an existing declaration.
// Warning: Unused local variable.
// Warning: Unused local variable.
// Warning: (101-110): This declaration shadows an existing declaration.
// Warning: (76-85): Unused local variable.
// Warning: (101-110): Unused local variable.
@@ -2,4 +2,4 @@ contract test {
struct A {}
}
// ----
// Warning: Defining empty structs is deprecated.
// Warning: (17-28): Defining empty structs is deprecated.
@@ -3,4 +3,4 @@ contract test {
struct A {}
}
// ----
// SyntaxError: Defining empty structs is disallowed.
// SyntaxError: (47-58): Defining empty structs is disallowed.
@@ -4,4 +4,4 @@ contract Base {
contract Derived is Base(2) { }
contract Derived2 is Base(), Derived() { }
// ----
// Warning: Wrong argument count for constructor call: 0 arguments given but expected 1.
// Warning: (101-107): Wrong argument count for constructor call: 0 arguments given but expected 1.
@@ -6,4 +6,4 @@ contract Base {
contract Derived is Base(2) { }
contract Derived2 is Base(), Derived() { }
// ----
// TypeError: Wrong argument count for constructor call: 0 arguments given but expected 1.
// TypeError: (132-138): Wrong argument count for constructor call: 0 arguments given but expected 1.
@@ -6,4 +6,4 @@ contract Derived is Base, Base1 {
constructor(uint i) Base(i) public {}
}
// ----
// Warning: Base constructor arguments given twice.
// Warning: (138-145): Base constructor arguments given twice.
@@ -1,4 +1,4 @@
contract A { constructor() public { } }
contract B is A { constructor() A public { } }
// ----
// Warning: Modifier-style base constructor call without arguments.
// Warning: (72-73): Modifier-style base constructor call without arguments.
@@ -2,4 +2,4 @@ contract A { constructor(uint) public { } }
contract B is A(2) { constructor() public { } }
contract C is B { constructor() A(3) public { } }
// ----
// Warning: Base constructor arguments given twice.
// Warning: (125-129): Base constructor arguments given twice.
@@ -4,4 +4,4 @@ contract A { constructor(uint) public { } }
contract B is A(2) { constructor() public { } }
contract C is B { constructor() A(3) public { } }
// ----
// DeclarationError: Base constructor arguments given twice.
// DeclarationError: (156-160): Base constructor arguments given twice.
@@ -1,4 +1,4 @@
contract A { constructor(uint) public { } }
contract B is A(2) { constructor() A(3) public { } }
// ----
// Warning: Base constructor arguments given twice.
// Warning: (79-83): Base constructor arguments given twice.
@@ -3,4 +3,4 @@ pragma experimental "v0.5.0";
contract A { constructor(uint) public { } }
contract B is A(2) { constructor() A(3) public { } }
// ----
// DeclarationError: Base constructor arguments given twice.
// DeclarationError: (110-114): Base constructor arguments given twice.
@@ -3,5 +3,5 @@ contract A is C(2) {}
contract B is C(2) {}
contract D is A, B { constructor() C(3) public {} }
// ----
// Warning: Base constructor arguments given twice.
// Warning: Base constructor arguments given twice.
// Warning: (122-126): Base constructor arguments given twice.
// Warning: (122-126): Base constructor arguments given twice.
@@ -3,4 +3,4 @@ contract A is C(2) {}
contract B is C(2) {}
contract D is A, B {}
// ----
// Warning: Base constructor arguments given twice.
// Warning: (87-108): Base constructor arguments given twice.
@@ -3,4 +3,4 @@ contract A is C { constructor() C(2) public {} }
contract B is C { constructor() C(2) public {} }
contract D is A, B { }
// ----
// Warning: Base constructor arguments given twice.
// Warning: (141-163): Base constructor arguments given twice.
@@ -6,5 +6,5 @@ contract Derived2 is Base {
constructor() Base(2) public { }
}
// ----
// TypeError: Wrong argument count for constructor call: 1 arguments given but expected 2.
// TypeError: Wrong argument count for modifier invocation: 1 arguments given but expected 2.
// TypeError: (74-81): Wrong argument count for constructor call: 1 arguments given but expected 2.
// TypeError: (130-137): Wrong argument count for modifier invocation: 1 arguments given but expected 2.
@@ -2,4 +2,4 @@ contract test {
uint256 ;
}
// ----
// ParserError: Expected identifier, got 'Semicolon'
// ParserError: (28-28): Expected identifier, got 'Semicolon'
@@ -3,4 +3,4 @@ contract test {
function fun() public { }
}
// ----
// DeclarationError: Function with same name and arguments defined twice.
// DeclarationError: (20-45): Function with same name and arguments defined twice.
@@ -5,4 +5,4 @@ contract test {
}
}
// ----
// DeclarationError: Identifier already declared.
// DeclarationError: (77-83): Identifier already declared.
@@ -6,5 +6,5 @@ contract test {
}
}
// ----
// Warning: Unused local variable.
// Warning: Unused local variable.
// Warning: (87-93): Unused local variable.
// Warning: (107-113): Unused local variable.
@@ -5,4 +5,4 @@ contract test {
}
}
// ----
// DeclarationError: Identifier already declared.
// DeclarationError: (75-81): Identifier already declared.
@@ -6,5 +6,5 @@ contract test {
}
}
// ----
// Warning: Unused local variable.
// Warning: Unused local variable.
// Warning: (87-93): Unused local variable.
// Warning: (105-111): Unused local variable.
@@ -3,5 +3,4 @@ contract test {
function f() pure public { uint32 variable; variable = 2; }
}
// ----
// Warning: This declaration shadows an existing declaration.
// Warning: (69-84): This declaration shadows an existing declaration.
@@ -8,4 +8,4 @@ contract test {
}
}
// ----
// DeclarationError: Undeclared identifier.
// DeclarationError: (123-124): Undeclared identifier.
@@ -6,4 +6,4 @@ contract test {
}
}
// ----
// DeclarationError: Undeclared identifier. Did you mean "x"?
// DeclarationError: (85-86): Undeclared identifier. Did you mean "x"?
@@ -8,4 +8,4 @@ contract test {
}
}
// ----
// DeclarationError: Undeclared identifier.
// DeclarationError: (154-155): Undeclared identifier.
@@ -7,4 +7,4 @@ contract test {
}
}
// ----
// DeclarationError: Undeclared identifier.
// DeclarationError: (93-94): Undeclared identifier.
@@ -5,4 +5,4 @@ contract test {
}
}
// ----
// DeclarationError: Undeclared identifier. Did you mean "a"?
// DeclarationError: (94-95): Undeclared identifier. Did you mean "a"?
+1 -1
View File
@@ -3,4 +3,4 @@ contract test {
function fun(uint256 arg1) public { uint256 y; y = arg1; }
}
// ----
// Warning: Function state mutability can be restricted to pure
// Warning: (42-100): Function state mutability can be restricted to pure
@@ -5,7 +5,7 @@ contract C {
}
}
// ----
// TypeError: This type cannot be encoded.
// TypeError: This type cannot be encoded.
// TypeError: This type cannot be encoded.
// TypeError: This type cannot be encoded.
// TypeError: (74-83): This type cannot be encoded.
// TypeError: (85-86): This type cannot be encoded.
// TypeError: (88-98): This type cannot be encoded.
// TypeError: (100-115): This type cannot be encoded.
@@ -6,8 +6,8 @@ contract C {
}
}
// ----
// TypeError: This type cannot be encoded.
// TypeError: This type cannot be encoded.
// TypeError: This type cannot be encoded.
// TypeError: This type cannot be encoded.
// TypeError: This type cannot be encoded.
// TypeError: (80-106): This type cannot be encoded.
// TypeError: (108-113): This type cannot be encoded.
// TypeError: (160-164): This type cannot be encoded.
// TypeError: (166-168): This type cannot be encoded.
// TypeError: (170-176): This type cannot be encoded.
@@ -9,6 +9,6 @@ contract C {
}
}
// ----
// Warning: Defining empty structs is deprecated.
// TypeError: This type cannot be encoded.
// TypeError: This type cannot be encoded.
// Warning: (51-63): Defining empty structs is deprecated.
// TypeError: (131-132): This type cannot be encoded.
// TypeError: (134-135): This type cannot be encoded.
@@ -9,9 +9,9 @@ contract C {
}
}
// ----
// Warning: Defining empty structs is deprecated.
// TypeError: This type cannot be encoded.
// TypeError: This type cannot be encoded.
// TypeError: This type cannot be encoded.
// TypeError: This type cannot be encoded.
// TypeError: This type cannot be encoded.
// Warning: (51-63): Defining empty structs is deprecated.
// TypeError: (168-169): This type cannot be encoded.
// TypeError: (171-172): This type cannot be encoded.
// TypeError: (179-180): This type cannot be encoded.
// TypeError: (182-186): This type cannot be encoded.
// TypeError: (188-194): This type cannot be encoded.
@@ -12,4 +12,4 @@ contract C {
function f(T) public pure { }
}
// ----
// Warning: Experimental features are turned on. Do not use experimental features on live deployments.
// Warning: (0-33): Experimental features are turned on. Do not use experimental features on live deployments.
@@ -12,4 +12,4 @@ contract TestContract
function addTestStruct(TestStruct) public pure {}
}
// ----
// Warning: Experimental features are turned on. Do not use experimental features on live deployments.
// Warning: (0-33): Experimental features are turned on. Do not use experimental features on live deployments.
@@ -4,4 +4,4 @@ contract C {
}
}
// ----
// TypeError: Internal or recursive type is not allowed for public or external functions.
// TypeError: (91-92): Internal or recursive type is not allowed for public or external functions.
@@ -4,4 +4,4 @@ contract C {
}
}
// ----
// TypeError: Internal or recursive type is not allowed for public or external functions.
// TypeError: (94-95): Internal or recursive type is not allowed for public or external functions.
@@ -5,4 +5,4 @@ contract C {
}
}
// ----
// TypeError: Internal or recursive type is not allowed for public or external functions.
// TypeError: (119-122): Internal or recursive type is not allowed for public or external functions.
@@ -5,4 +5,4 @@ contract Test {
}
}
// ----
// TypeError: Recursive struct definition.
// TypeError: (20-93): Recursive struct definition.
@@ -9,4 +9,4 @@ contract Test {
}
}
// ----
// TypeError: Recursive struct definition.
// TypeError: (20-118): Recursive struct definition.
@@ -2,5 +2,5 @@ interface I {
function f();
}
// ----
// Warning: Functions in interfaces should be declared external.
// Warning: No visibility specified. Defaulting to "public". In interfaces it defaults to external.
// Warning: (15-28): Functions in interfaces should be declared external.
// Warning: (15-28): No visibility specified. Defaulting to "public". In interfaces it defaults to external.
@@ -3,5 +3,5 @@ interface I {
function f();
}
// ----
// SyntaxError: No visibility specified.
// TypeError: Functions in interfaces must be declared external.
// SyntaxError: (45-58): No visibility specified.
// TypeError: (45-58): Functions in interfaces must be declared external.
@@ -2,4 +2,4 @@ interface I {
function f() internal;
}
// ----
// TypeError: Functions in interfaces cannot be internal or private.
// TypeError: (15-37): Functions in interfaces cannot be internal or private.
@@ -2,4 +2,4 @@ interface I {
function f() private;
}
// ----
// TypeError: Functions in interfaces cannot be internal or private.
// TypeError: (15-36): Functions in interfaces cannot be internal or private.
@@ -2,4 +2,4 @@ interface I {
function f() public;
}
// ----
// Warning: Functions in interfaces should be declared external.
// Warning: (15-35): Functions in interfaces should be declared external.
@@ -3,4 +3,4 @@ interface I {
function f() public;
}
// ----
// TypeError: Functions in interfaces must be declared external.
// TypeError: (45-65): Functions in interfaces must be declared external.