Merge remote-tracking branch 'origin/develop' into breaking

This commit is contained in:
chriseth
2020-04-22 17:21:32 +02:00
270 changed files with 5249 additions and 1817 deletions
@@ -6,3 +6,4 @@ contract C {
// ----
// DeclarationError: (28-45): The "constant" keyword can only be used for state variables.
// TypeError: (69-72): Invalid array length, expected integer literal or constant expression.
// TypeError: (64-75): Data location must be "storage" or "memory" for variable, but none was given.
@@ -0,0 +1,14 @@
contract C {
function f() public pure
{
bytes32[1263941234127518272][500] memory x;
uint[2**30][] memory y;
uint[2**30][2**30][] memory z;
uint[2**16][2**16][] memory w;
}
}
// ----
// TypeError: (48-90): Type too large for memory.
// TypeError: (96-118): Type too large for memory.
// TypeError: (124-153): Type too large for memory.
// TypeError: (159-188): Type too large for memory.
@@ -2,4 +2,4 @@ contract C {
function f(bytes32[1263941234127518272] memory) public pure {}
}
// ----
// TypeError: (26-61): Array is too large to be encoded.
// TypeError: (26-61): Type too large for memory.
@@ -5,7 +5,7 @@ contract C {
function f(uint[2**16][2**16][] memory) public pure {}
}
// ----
// TypeError: (26-66): Array is too large to be encoded.
// TypeError: (96-116): Array is too large to be encoded.
// TypeError: (146-173): Array is too large to be encoded.
// TypeError: (203-230): Array is too large to be encoded.
// TypeError: (26-66): Type too large for memory.
// TypeError: (96-116): Type too large for memory.
// TypeError: (146-173): Type too large for memory.
// TypeError: (203-230): Type too large for memory.
@@ -5,5 +5,5 @@ contract C {
function f(uint[2**30][2**30][][] memory) public pure {}
}
// ----
// TypeError: (61-101): Array is too large to be encoded.
// TypeError: (131-160): Array is too large to be encoded.
// TypeError: (61-101): Type too large for memory.
// TypeError: (131-160): Type too large for memory.
@@ -0,0 +1,5 @@
contract C {
constructor() override public {}
}
// ----
// TypeError: (17-49): Constructors cannot override.
@@ -0,0 +1,5 @@
contract C {
constructor() virtual public {}
}
// ----
// TypeError: (17-48): Constructors cannot be virtual.
@@ -8,4 +8,3 @@ library L
}
// ----
// DeclarationError: (32-35): Identifier not found or not unique.
// TypeError: (63-76): Internal type cannot be used for external function type.
@@ -0,0 +1,5 @@
contract C {
function ( uint ) external returns ( a [ ] calldata ) public a = ( 1 / 2 ) ;
}
// ----
// TypeError: (58-59): Name has to refer to a struct, enum or contract.
@@ -0,0 +1,17 @@
contract C {
struct X { bytes31 [ 3 ] x1 ;
uint x2 ;
}
struct S { uint256 [ ] [ 0.425781 ether ] s1 ;
uint [ 2 ** 0xFF ] [ 2 ** 0x42 ] s2 ;
X s3 ;
mapping ( uint => address payable ) c ;
uint [ 9 hours ** 16 ] d ;
string s ;
}
function f ( ) public { function ( function ( bytes9 , uint ) external pure returns ( uint ) , uint ) external pure returns ( uint ) [ 3 ] memory s2 ;
S memory s ;
}
}
// ----
// TypeError: (530-540): Type too large for memory.
@@ -0,0 +1,12 @@
contract C {
struct R { uint[10][10] y; }
struct S { uint a; uint b; R d; uint[20][20][2999999999999999999999999990] c; }
function f() public pure {
C.S memory y;
C.S[10] memory z;
y.a < 2;
z; y;
}
}
// ----
// TypeError: (169-181): Type too large for memory.
@@ -7,3 +7,4 @@ contract C {
}
}
// ----
// TypeError: (226-234): Type too large for memory.
@@ -0,0 +1,7 @@
contract C {
function h ( bool flag ) public returns ( bool c ) {
mapping ( string => uint24 ) [ 1 ] memory val ;
}
}
// ----
// TypeError: (91-136): Data location must be "storage" for variable, but "memory" was given.
@@ -0,0 +1,13 @@
contract Test {
struct RecursiveStruct {
address payable d ;
mapping ( uint => address payable ) c ;
mapping ( uint => address payable [ ] ) d ;
}
function func ( ) private pure {
RecursiveStruct [ 1 ] memory val ;
val ;
}
}
// ----
// DeclarationError: (157-198): Identifier already declared.
@@ -3,5 +3,5 @@ contract C {
uint immutable constant x;
}
// ----
// ParserError: (32-41): Constantness already set to "immutable"
// ParserError: (64-72): Constantness already set to "immutable"
// ParserError: (32-41): Mutability already set to "immutable"
// ParserError: (64-72): Mutability already set to "immutable"
@@ -3,3 +3,4 @@ contract c {
}
// ----
// TypeError: (51-52): Invalid array length, expected integer literal or constant expression.
// TypeError: (45-55): Data location must be "storage" or "memory" for variable, but none was given.
@@ -3,3 +3,4 @@ contract c {
}
// ----
// TypeError: (51-53): Array with negative length specified.
// TypeError: (45-56): Data location must be "storage" or "memory" for variable, but none was given.
@@ -4,4 +4,4 @@ contract C {
}
}
// ----
// TypeError: (47-77): Type mapping(uint256 => uint256)[] memory is only valid in storage.
// TypeError: (47-77): Data location must be "storage" for variable, but "memory" was given.
@@ -5,3 +5,4 @@ contract test {
}
// ----
// TypeError: (55-58): Array with fractional length specified.
// TypeError: (50-61): Data location must be "storage" or "memory" for variable, but none was given.
@@ -5,3 +5,4 @@ contract test {
}
// ----
// TypeError: (55-65): Invalid array length, expected integer literal or constant expression.
// TypeError: (50-68): Data location must be "storage" or "memory" for variable, but none was given.
@@ -5,3 +5,4 @@ contract test {
}
// ----
// TypeError: (55-66): Invalid array length, expected integer literal or constant expression.
// TypeError: (50-69): Data location must be "storage" or "memory" for variable, but none was given.
@@ -3,4 +3,4 @@ contract C {
}
}
// ----
// TypeError: (28-56): Array is too large to be encoded.
// TypeError: (28-56): Type too large for calldata.
@@ -3,4 +3,4 @@ contract C {
}
}
// ----
// TypeError: (28-54): Array is too large to be encoded.
// TypeError: (28-54): Type too large for memory.
@@ -3,4 +3,4 @@ contract C {
}
}
// ----
// TypeError: (28-54): Array is too large to be encoded.
// TypeError: (28-54): Type too large for memory.
@@ -18,9 +18,9 @@ contract C {
// TypeError: (33-45): Address types can only be payable or non-payable.
// TypeError: (52-64): Address types can only be payable or non-payable.
// TypeError: (89-101): Address types can only be payable or non-payable.
// TypeError: (138-150): Address types can only be payable or non-payable.
// TypeError: (156-168): Address types can only be payable or non-payable.
// TypeError: (195-207): Address types can only be payable or non-payable.
// TypeError: (236-248): Address types can only be payable or non-payable.
// TypeError: (300-312): Address types can only be payable or non-payable.
// TypeError: (352-364): Address types can only be payable or non-payable.
// TypeError: (138-150): Address types can only be payable or non-payable.
// TypeError: (156-168): Address types can only be payable or non-payable.
@@ -0,0 +1,11 @@
contract C {
function f() public payable {
abi.encode(this.f{value: 2});
abi.encode(this.f{gas: 2});
abi.encode(this.f{value: 2, gas: 1});
}
}
// ----
// TypeError: (60-76): This type cannot be encoded.
// TypeError: (92-106): This type cannot be encoded.
// TypeError: (122-146): This type cannot be encoded.
@@ -1,12 +1,11 @@
contract C {
function f() public pure {
bytes32 h = keccak256(abi.encodePacked(keccak256, f, this.f.gas, blockhash));
bytes32 h = keccak256(abi.encodePacked(keccak256, f, this.f{gas: 2}, blockhash));
h;
}
}
// ----
// Warning: (105-115): Using ".gas(...)" is deprecated. Use "{gas: ...}" instead.
// TypeError: (91-100): This type cannot be encoded.
// TypeError: (102-103): This type cannot be encoded.
// TypeError: (105-115): This type cannot be encoded.
// TypeError: (117-126): This type cannot be encoded.
// TypeError: (105-119): This type cannot be encoded.
// TypeError: (121-130): This type cannot be encoded.
@@ -4,4 +4,3 @@ contract C {
}
// ----
// TypeError: (25-26): Name has to refer to a struct, enum or contract.
// TypeError: (53-61): Internal type cannot be used for external function type.
@@ -5,4 +5,3 @@ contract C {
}
// ----
// TypeError: (50-51): Name has to refer to a struct, enum or contract.
// TypeError: (78-86): Internal type cannot be used for external function type.
@@ -4,7 +4,7 @@ contract C {
function f(Data.S memory a) public {}
}
contract Data {
struct S { S x; }
struct S { S[] x; }
}
// ----
// TypeError: (63-78): Recursive type not allowed for public or external contract functions.
@@ -0,0 +1,10 @@
pragma experimental ABIEncoderV2;
contract C {
struct S {
uint a;
function() external returns (S memory) sub;
}
function f() public pure returns (S memory) {
}
}
// ----
@@ -0,0 +1,7 @@
contract C {
struct S {
var x;
}
}
// ----
// ParserError: (27-30): Expected explicit type name.
@@ -1,12 +1,11 @@
contract C {
function f() {
function f() public {
(((((((((((,2),)),)),),))=4)));
}
}
// ----
// SyntaxError: (15-69): No visibility specified. Did you intend to add "public"?
// TypeError: (46-47): Expression has to be an lvalue.
// TypeError: (60-61): Type int_const 4 is not implicitly convertible to expected type tuple(tuple(tuple(tuple(tuple(,int_const 2),),),),).
// TypeError: (37-61): Tuple component cannot be empty.
// TypeError: (36-62): Tuple component cannot be empty.
// TypeError: (35-63): Tuple component cannot be empty.
// TypeError: (53-54): Expression has to be an lvalue.
// TypeError: (67-68): Type int_const 4 is not implicitly convertible to expected type tuple(tuple(tuple(tuple(tuple(,int_const 2),),),),).
// TypeError: (44-68): Tuple component cannot be empty.
// TypeError: (43-69): Tuple component cannot be empty.
// TypeError: (42-70): Tuple component cannot be empty.
@@ -257,4 +257,4 @@ contract Main {
struct JW { int i; }
}
// ----
// DeclarationError: (6091-6111): Struct definition exhausting cyclic dependency validator.
// DeclarationError: (6091-6111): Struct definition exhausts cyclic dependency validator.
@@ -0,0 +1,8 @@
struct s1 { s2 x; }
struct s2 { s1 y; }
contract C {
// whatever
}
// ----
// TypeError: (0-19): Recursive struct definition.
@@ -4,4 +4,3 @@ contract C {
}
// ----
// TypeError: (37-64): Data location must be "memory" for parameter in function, but "storage" was given.
// TypeError: (37-64): Internal type cannot be used for external function type.
@@ -4,4 +4,3 @@ contract C {
}
// ----
// TypeError: (57-84): Data location must be "memory" for return parameter in function, but "storage" was given.
// TypeError: (57-84): Internal type cannot be used for external function type.
@@ -1,6 +1,6 @@
contract n
{
fallback()
fallback() external
{
// Used to cause a segfault
var (x,y) = (1);
@@ -12,5 +12,4 @@ contract n
}
}
// ----
// SyntaxError: (14-129): No visibility specified. Did you intend to add "external"?
// TypeError: (60-75): Different number of components on the left hand side (2) than on the right hand side (1).
// TypeError: (69-84): Different number of components on the left hand side (2) than on the right hand side (1).