Refactoring of errors and fixes for various ICEs.

This commit is contained in:
Daniel Kirchner
2020-04-16 16:42:12 +02:00
parent df1809f8da
commit b744a56801
16 changed files with 127 additions and 38 deletions
@@ -7,3 +7,4 @@ contract C {
}
}
// ----
// TypeError: (226-234): 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.
@@ -2,10 +2,8 @@ contract C {
function f(bytes32[1263941234127518272][500] memory) public pure {}
function f(uint[2**30][] memory) public pure {}
function f(uint[2**30][2**30][] memory) public pure {}
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.
@@ -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,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.
@@ -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.
@@ -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.
@@ -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.