forked from ethereum/solidity
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move more parser tests to syntax tests
- Loading branch information
Showing
55 changed files
with
458 additions
and
642 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
contract c { | ||
event e(uint[10] a, bytes7[8] indexed b, c[3] x); | ||
} |
8 changes: 8 additions & 0 deletions
8
test/libsolidity/syntaxTests/parsing/arrays_in_expressions.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
contract c { | ||
function f() { c[10] a = 7; uint8[10 * 2] x; } | ||
} | ||
// ---- | ||
// Warning: (32-39): Variable is declared as a storage pointer. Use an explicit "storage" keyword to silence this warning. | ||
// Warning: (45-60): Variable is declared as a storage pointer. Use an explicit "storage" keyword to silence this warning. | ||
// TypeError: (32-43): Type int_const 7 is not implicitly convertible to expected type contract c[10] storage pointer. | ||
// Warning: (45-60): Uninitialized storage pointer. Did you mean '<type> memory x'? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
contract c { | ||
uint[10] a; | ||
uint[] a2; | ||
struct x { uint[2**20] b; y[0] c; } | ||
struct y { uint d; mapping(uint=>x)[] e; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
contract test { | ||
function f() { | ||
function() returns(function() returns(function() returns(function() returns(uint)))) x; | ||
uint y; | ||
y = x()()()(); | ||
} | ||
} | ||
// ---- | ||
// Warning: (20-175): No visibility specified. Defaulting to "public". |
9 changes: 9 additions & 0 deletions
9
test/libsolidity/syntaxTests/parsing/conditional_multiple.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
contract A { | ||
function f() { | ||
uint x = 3 < 0 ? 2 > 1 ? 2 : 1 : 7 > 2 ? 7 : 6; | ||
} | ||
} | ||
// ---- | ||
// Warning: (17-93): No visibility specified. Defaulting to "public". | ||
// Warning: (40-46): Unused local variable. | ||
// Warning: (17-93): Function state mutability can be restricted to pure |
11 changes: 11 additions & 0 deletions
11
test/libsolidity/syntaxTests/parsing/conditional_true_false_literal.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
contract A { | ||
function f() { | ||
uint x = true ? 1 : 0; | ||
uint y = false ? 0 : 1; | ||
} | ||
} | ||
// ---- | ||
// Warning: (17-100): No visibility specified. Defaulting to "public". | ||
// Warning: (40-46): Unused local variable. | ||
// Warning: (71-77): Unused local variable. | ||
// Warning: (17-100): Function state mutability can be restricted to pure |
11 changes: 11 additions & 0 deletions
11
test/libsolidity/syntaxTests/parsing/conditional_with_assignment.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
contract A { | ||
function f() { | ||
uint y = 1; | ||
uint x = 3 < 0 ? x = 3 : 6; | ||
true ? x = 3 : 4; | ||
} | ||
} | ||
// ---- | ||
// Warning: (17-119): No visibility specified. Defaulting to "public". | ||
// Warning: (40-46): Unused local variable. | ||
// Warning: (17-119): Function state mutability can be restricted to pure |
11 changes: 11 additions & 0 deletions
11
test/libsolidity/syntaxTests/parsing/conditional_with_constants.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
contract A { | ||
function f() { | ||
uint x = 3 > 0 ? 3 : 0; | ||
uint y = (3 > 0) ? 3 : 0; | ||
} | ||
} | ||
// ---- | ||
// Warning: (17-103): No visibility specified. Defaulting to "public". | ||
// Warning: (40-46): Unused local variable. | ||
// Warning: (72-78): Unused local variable. | ||
// Warning: (17-103): Function state mutability can be restricted to pure |
13 changes: 13 additions & 0 deletions
13
test/libsolidity/syntaxTests/parsing/conditional_with_variables.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
contract A { | ||
function f() { | ||
uint x = 3; | ||
uint y = 1; | ||
uint z = (x > y) ? x : y; | ||
uint w = x > y ? x : y; | ||
} | ||
} | ||
// ---- | ||
// Warning: (17-143): No visibility specified. Defaulting to "public". | ||
// Warning: (80-86): Unused local variable. | ||
// Warning: (114-120): Unused local variable. | ||
// Warning: (17-143): Function state mutability can be restricted to pure |
14 changes: 14 additions & 0 deletions
14
test/libsolidity/syntaxTests/parsing/declaring_fixed_and_ufixed_variables.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
contract A { | ||
fixed40x40 storeMe; | ||
function f(ufixed x, fixed32x32 y) { | ||
ufixed8x8 a; | ||
fixed b; | ||
} | ||
} | ||
// ---- | ||
// Warning: (41-121): No visibility specified. Defaulting to "public". | ||
// Warning: (52-60): Unused function parameter. Remove or comment out the variable name to silence this warning. | ||
// Warning: (62-74): Unused function parameter. Remove or comment out the variable name to silence this warning. | ||
// Warning: (86-97): Unused local variable. | ||
// Warning: (107-114): Unused local variable. | ||
// Warning: (41-121): Function state mutability can be restricted to pure |
5 changes: 5 additions & 0 deletions
5
test/libsolidity/syntaxTests/parsing/declaring_fixed_literal_variables.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
contract A { | ||
fixed40x40 pi = 3.14; | ||
} | ||
// ---- | ||
// TypeError: (33-37): Type rational_const 157 / 50 is not implicitly convertible to expected type fixed40x40. Try converting to type ufixed16x2 or use an explicit conversion. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
contract test { | ||
function fun(uint256 a) returns (address b) { | ||
if (a < 0) b = 0x67; else if (a == 0) b = 0x12; else b = 0x78; | ||
} | ||
} | ||
// ---- | ||
// Warning: (20-142): No visibility specified. Defaulting to "public". | ||
// Warning: (20-142): Function state mutability can be restricted to pure |
10 changes: 10 additions & 0 deletions
10
test/libsolidity/syntaxTests/parsing/enum_valid_declaration.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
contract c { | ||
enum validEnum { Value1, Value2, Value3, Value4 } | ||
function c() { | ||
a = validEnum.Value3; | ||
} | ||
validEnum a; | ||
} | ||
// ---- | ||
// Warning: (71-121): Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead. | ||
// Warning: (71-121): No visibility specified. Defaulting to "public". |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
contract c { | ||
event e(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
contract c { | ||
event e(uint a, bytes32 s); | ||
} |
3 changes: 3 additions & 0 deletions
3
test/libsolidity/syntaxTests/parsing/event_arguments_indexed.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
contract c { | ||
event e(uint a, bytes32 indexed s, bool indexed b); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
contract test { | ||
function fun(uint256 a) { | ||
uint256 x = 3 ** a; | ||
} | ||
} | ||
// ---- | ||
// Warning: (20-79): No visibility specified. Defaulting to "public". | ||
// Warning: (54-63): Unused local variable. | ||
// Warning: (20-79): Function state mutability can be restricted to pure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
contract c { | ||
function x() external {} | ||
} | ||
// ---- | ||
// Warning: (17-41): Function state mutability can be restricted to pure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
contract c { | ||
function() { } | ||
} | ||
// ---- | ||
// Warning: (17-31): No visibility specified. Defaulting to "public". |
13 changes: 13 additions & 0 deletions
13
test/libsolidity/syntaxTests/parsing/for_loop_simple_initexpr.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
contract test { | ||
function fun(uint256 a) { | ||
uint256 i =0; | ||
for (i = 0; i < 10; i++) { | ||
uint256 x = i; break; continue; | ||
} | ||
} | ||
} | ||
// ---- | ||
// Warning: (20-162): No visibility specified. Defaulting to "public". | ||
// Warning: (33-42): Unused function parameter. Remove or comment out the variable name to silence this warning. | ||
// Warning: (115-124): Unused local variable. | ||
// Warning: (20-162): Function state mutability can be restricted to pure |
13 changes: 13 additions & 0 deletions
13
test/libsolidity/syntaxTests/parsing/for_loop_simple_noexpr.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
contract test { | ||
function fun(uint256 a) { | ||
uint256 i =0; | ||
for (;;) { | ||
uint256 x = i; break; continue; | ||
} | ||
} | ||
} | ||
// ---- | ||
// Warning: (24-170): No visibility specified. Defaulting to "public". | ||
// Warning: (37-46): Unused function parameter. Remove or comment out the variable name to silence this warning. | ||
// Warning: (115-124): Unused local variable. | ||
// Warning: (24-170): Function state mutability can be restricted to pure |
11 changes: 11 additions & 0 deletions
11
test/libsolidity/syntaxTests/parsing/for_loop_single_stmt_body.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
contract test { | ||
function fun(uint256 a) { | ||
uint256 i = 0; | ||
for (i = 0; i < 10; i++) | ||
continue; | ||
} | ||
} | ||
// ---- | ||
// Warning: (20-129): No visibility specified. Defaulting to "public". | ||
// Warning: (33-42): Unused function parameter. Remove or comment out the variable name to silence this warning. | ||
// Warning: (20-129): Function state mutability can be restricted to pure |
12 changes: 12 additions & 0 deletions
12
test/libsolidity/syntaxTests/parsing/for_loop_vardef_initexpr.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
contract test { | ||
function fun(uint256 a) { | ||
for (uint256 i = 0; i < 10; i++) { | ||
uint256 x = i; break; continue; | ||
} | ||
} | ||
} | ||
// ---- | ||
// Warning: (20-148): No visibility specified. Defaulting to "public". | ||
// Warning: (33-42): Unused function parameter. Remove or comment out the variable name to silence this warning. | ||
// Warning: (101-110): Unused local variable. | ||
// Warning: (20-148): Function state mutability can be restricted to pure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// "from" is not a keyword although it is used as a keyword in import directives. | ||
contract from { | ||
} |
10 changes: 10 additions & 0 deletions
10
test/libsolidity/syntaxTests/parsing/function_normal_comments.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
contract test { | ||
uint256 stateVar; | ||
// We won't see this comment | ||
function functionName(bytes32 input) returns (bytes32 out) {} | ||
} | ||
// ---- | ||
// Warning: (75-136): No visibility specified. Defaulting to "public". | ||
// Warning: (97-110): Unused function parameter. Remove or comment out the variable name to silence this warning. | ||
// Warning: (121-132): Unused function parameter. Remove or comment out the variable name to silence this warning. | ||
// Warning: (75-136): Function state mutability can be restricted to pure |
5 changes: 5 additions & 0 deletions
5
test/libsolidity/syntaxTests/parsing/function_type_as_parameter.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
contract test { | ||
function f(function(uint) external returns (uint) g) internal returns (uint a) { | ||
return g(1); | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
test/libsolidity/syntaxTests/parsing/function_type_as_storage_variable.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
contract test { | ||
function (uint, uint) internal returns (uint) f1; | ||
} |
10 changes: 10 additions & 0 deletions
10
test/libsolidity/syntaxTests/parsing/function_type_as_storage_variable_with_assignment.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
contract test { | ||
function f(uint x, uint y) returns (uint a) {} | ||
function (uint, uint) internal returns (uint) f1 = f; | ||
} | ||
// ---- | ||
// Warning: (20-66): No visibility specified. Defaulting to "public". | ||
// Warning: (31-37): Unused function parameter. Remove or comment out the variable name to silence this warning. | ||
// Warning: (39-45): Unused function parameter. Remove or comment out the variable name to silence this warning. | ||
// Warning: (56-62): Unused function parameter. Remove or comment out the variable name to silence this warning. | ||
// Warning: (20-66): Function state mutability can be restricted to pure |
15 changes: 15 additions & 0 deletions
15
test/libsolidity/syntaxTests/parsing/function_type_in_expression.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
contract test { | ||
function f(uint x, uint y) returns (uint a) {} | ||
function g() { | ||
function (uint, uint) internal returns (uint) f1 = f; | ||
} | ||
} | ||
// ---- | ||
// Warning: (20-66): No visibility specified. Defaulting to "public". | ||
// Warning: (31-37): Unused function parameter. Remove or comment out the variable name to silence this warning. | ||
// Warning: (39-45): Unused function parameter. Remove or comment out the variable name to silence this warning. | ||
// Warning: (56-62): Unused function parameter. Remove or comment out the variable name to silence this warning. | ||
// Warning: (71-153): No visibility specified. Defaulting to "public". | ||
// Warning: (94-142): Unused local variable. | ||
// Warning: (20-66): Function state mutability can be restricted to pure | ||
// Warning: (71-153): Function state mutability can be restricted to pure |
11 changes: 11 additions & 0 deletions
11
test/libsolidity/syntaxTests/parsing/function_type_in_struct.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
contract test { | ||
struct S { | ||
function (uint x, uint y) internal returns (uint a) f; | ||
function (uint, uint) external returns (uint) g; | ||
uint d; | ||
} | ||
} | ||
// ---- | ||
// Warning: (49-55): Naming function type parameters is deprecated. | ||
// Warning: (57-63): Naming function type parameters is deprecated. | ||
// Warning: (83-89): Naming function type return parameters is deprecated. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
contract test { | ||
function fun(uint256 a) returns (uint) { | ||
if (a >= 8) { return 2; } else { var b = 7; } | ||
} | ||
} | ||
// ---- | ||
// Warning: (102-107): Use of the "var" keyword is deprecated. | ||
// Warning: (102-111): The type of this variable was inferred as uint8, which can hold values between 0 and 255. This is probably not desired. Use an explicit type to silence this warning. | ||
// Warning: (20-120): No visibility specified. Defaulting to "public". | ||
// Warning: (102-107): Unused local variable. | ||
// Warning: (20-120): Function state mutability can be restricted to pure |
9 changes: 9 additions & 0 deletions
9
test/libsolidity/syntaxTests/parsing/inline_array_declaration.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
contract c { | ||
uint[] a; | ||
function f() returns (uint, uint) { | ||
a = [1,2,3]; | ||
return (a[3], [2,3,4][0]); | ||
} | ||
} | ||
// ---- | ||
// Warning: (31-128): No visibility specified. Defaulting to "public". |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
library Lib { | ||
function f() { } | ||
} | ||
// ---- | ||
// Warning: (18-34): No visibility specified. Defaulting to "public". | ||
// Warning: (18-34): Function state mutability can be restricted to pure |
16 changes: 16 additions & 0 deletions
16
test/libsolidity/syntaxTests/parsing/literal_constants_with_ether_subdenominations.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
contract c { | ||
function f() | ||
{ | ||
a = 1 wei; | ||
b = 2 szabo; | ||
c = 3 finney; | ||
b = 4 ether; | ||
} | ||
uint256 a; | ||
uint256 b; | ||
uint256 c; | ||
uint256 d; | ||
} | ||
// ---- | ||
// Warning: (163-172): This declaration shadows an existing declaration. | ||
// Warning: (17-128): No visibility specified. Defaulting to "public". |
10 changes: 10 additions & 0 deletions
10
...dity/syntaxTests/parsing/literal_constants_with_ether_subdenominations_in_expressions.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
contract c { | ||
function c () | ||
{ | ||
a = 1 wei * 100 wei + 7 szabo - 3; | ||
} | ||
uint256 a; | ||
} | ||
// ---- | ||
// Warning: (17-86): Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead. | ||
// Warning: (17-86): No visibility specified. Defaulting to "public". |
12 changes: 12 additions & 0 deletions
12
test/libsolidity/syntaxTests/parsing/location_specifiers_for_locals.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
contract Foo { | ||
function f() { | ||
uint[] storage x; | ||
uint[] memory y; | ||
} | ||
} | ||
// ---- | ||
// Warning: (42-58): Uninitialized storage pointer. | ||
// Warning: (19-90): No visibility specified. Defaulting to "public". | ||
// Warning: (42-58): Unused local variable. | ||
// Warning: (68-83): Unused local variable. | ||
// Warning: (19-90): Function state mutability can be restricted to pure |
5 changes: 5 additions & 0 deletions
5
test/libsolidity/syntaxTests/parsing/location_specifiers_for_params.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
contract Foo { | ||
function f(uint[] storage constant x, uint[] memory y) internal { } | ||
} | ||
// ---- | ||
// TypeError: (30-55): Storage location has to be "memory" (or unspecified) for constants. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
contract test { | ||
mapping(address => bytes32) names; | ||
} |
6 changes: 6 additions & 0 deletions
6
test/libsolidity/syntaxTests/parsing/mapping_and_array_of_functions.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
contract test { | ||
mapping (address => function() internal returns (uint)) a; | ||
mapping (address => function() external) b; | ||
mapping (address => function() external[]) c; | ||
function() external[] d; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
contract test { | ||
struct test_struct { | ||
address addr; | ||
uint256 count; | ||
mapping(bytes32 => test_struct) self_reference; | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
test/libsolidity/syntaxTests/parsing/mapping_to_mapping_in_struct.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
contract test { | ||
struct test_struct { | ||
address addr; | ||
mapping (uint64 => mapping (bytes32 => uint)) complex_mapping; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
contract c { | ||
modifier mod { if (msg.sender == 0) _; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
contract c { | ||
modifier mod(address a) { if (msg.sender == a) _; } | ||
} |
Oops, something went wrong.