Merge pull request #9432 from ethereum/develop

Merge develop into breaking.
This commit is contained in:
chriseth
2020-07-16 17:14:45 +02:00
committed by GitHub
77 changed files with 909 additions and 288 deletions
@@ -0,0 +1,15 @@
contract b {
struct c {
uint [2 ** 253] a;
}
c d;
function e() public {
var d = d;
}
}
// ----
// Warning 2519: (105-110): This declaration shadows an existing declaration.
// Warning 3408: (66-69): Variable "d" covers a large part of storage and thus makes collisions likely. Either use mappings or dynamic arrays and allow their size to be increased only in small quantities per transaction.
// Warning 2332: (105-110): Type "b.c" covers a large part of storage and thus makes collisions likely. Either use mappings or dynamic arrays and allow their size to be increased only in small quantities per transaction.
// SyntaxError 1719: (105-114): Use of the "var" keyword is disallowed. Use explicit declaration `struct b.c storage pointer d = ...´ instead.
@@ -4,5 +4,5 @@ contract C {
uint[2**255][2] a;
}
// ----
// TypeError 1534: (77-94): Type too large for storage.
// TypeError 7676: (60-97): Contract too large for storage.
// TypeError 1534: (77-94): Type too large for storage.
@@ -5,6 +5,6 @@ contract C {
uint[2**255] b;
}
// ----
// TypeError 7676: (60-114): Contract too large for storage.
// Warning 3408: (77-91): Variable "a" covers a large part of storage and thus makes collisions likely. Either use mappings or dynamic arrays and allow their size to be increased only in small quantities per transaction.
// Warning 3408: (97-111): Variable "b" covers a large part of storage and thus makes collisions likely. Either use mappings or dynamic arrays and allow their size to be increased only in small quantities per transaction.
// TypeError 7676: (60-114): Contract too large for storage.
@@ -0,0 +1,12 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity >= 0.0;
contract C {
uint[2**255] a;
}
contract D is C {
uint[2**255] b;
}
// ----
// TypeError 7676: (95-134): Contract too large for storage.
// Warning 3408: (77-91): Variable "a" covers a large part of storage and thus makes collisions likely. Either use mappings or dynamic arrays and allow their size to be increased only in small quantities per transaction.
// Warning 3408: (117-131): Variable "b" covers a large part of storage and thus makes collisions likely. Either use mappings or dynamic arrays and allow their size to be increased only in small quantities per transaction.
@@ -8,5 +8,5 @@ contract C {
S s;
}
// ----
// TypeError 1534: (146-149): Type too large for storage.
// TypeError 7676: (60-152): Contract too large for storage.
// TypeError 1534: (146-149): Type too large for storage.
@@ -2,4 +2,4 @@ contract test {
function f() payable internal {}
}
// ----
// TypeError 5587: (20-52): Internal functions cannot be payable.
// TypeError 5587: (20-52): "internal" and "private" functions cannot be payable.
@@ -2,4 +2,4 @@ contract test {
function f() payable private {}
}
// ----
// TypeError 5587: (20-51): Internal functions cannot be payable.
// TypeError 5587: (20-51): "internal" and "private" functions cannot be payable.
@@ -0,0 +1,5 @@
contract C {
string s = hex"a000";
}
// ----
// TypeError 7407: (28-37): Type literal_string (contains invalid UTF-8 sequence at position 0) is not implicitly convertible to expected type string storage ref.
@@ -0,0 +1,6 @@
contract C {
bytes b1 = "\xa0\x00";
bytes32 b2 = "\xa0\x00";
bytes b3 = hex"a000";
}
// ----
@@ -0,0 +1,6 @@
contract test {
function f() public pure returns (string memory) {
return "😃, 😭, and 😈";
}
}
// ----
@@ -1,5 +1,4 @@
contract test {
function oneByteUTF8() public pure returns (bytes32) {
bytes32 usdollar = "aaa\u0024aaa";
return usdollar;
@@ -15,17 +14,8 @@ contract test {
return eur;
}
function together() public pure returns (bytes32) {
function combined() public pure returns (bytes32) {
bytes32 res = "\u0024\u00A2\u20AC";
return res;
}
// this function returns an invalid unicode character
function invalidLiteral() public pure returns(bytes32) {
bytes32 invalid = "\u00xx";
return invalid;
}
}
// ----
// ParserError 8936: (678-681): Invalid escape sequence.
@@ -0,0 +1,7 @@
contract test {
function f() public pure returns (string memory) {
return "\xc1";
}
}
// ----
// TypeError 6359: (86-92): Return argument type literal_string (contains invalid UTF-8 sequence at position 0) is not implicitly convertible to expected type (type of first return variable) string memory.
@@ -0,0 +1,10 @@
contract test {
// this function returns an invalid unicode character
function invalidLiteral() public pure returns (bytes32) {
bytes32 invalid = "\u00xx";
return invalid;
}
}
// ----
// ParserError 8936: (162-165): Invalid escape sequence.