From 7d7abeb1496dddfab7eb8705dbfc3d06284cf25d Mon Sep 17 00:00:00 2001 From: Daniel Kirchner Date: Mon, 6 Aug 2018 14:59:37 +0200 Subject: Disallow ambiguous conversions between number literals and bytesXX types. --- test/libsolidity/ABIDecoderTests.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/libsolidity/ABIDecoderTests.cpp') diff --git a/test/libsolidity/ABIDecoderTests.cpp b/test/libsolidity/ABIDecoderTests.cpp index 28f982c4..f91a4f85 100644 --- a/test/libsolidity/ABIDecoderTests.cpp +++ b/test/libsolidity/ABIDecoderTests.cpp @@ -792,8 +792,8 @@ BOOST_AUTO_TEST_CASE(return_dynamic_types_cross_call_advanced) a = "1234567890123456789012345678901234567890"; b = uint(-1); c = new bytes20[](4); - c[0] = bytes20(1234); - c[3] = bytes20(6789); + c[0] = bytes20(uint160(1234)); + c[3] = bytes20(uint160(6789)); d = 0x1234; } function f() public returns (bytes memory, uint, bytes20[] memory, uint) { -- cgit v1.2.3 From b000a022f2d7c1057ade755ed1ea8c70380688a5 Mon Sep 17 00:00:00 2001 From: Chase McDermott Date: Tue, 7 Aug 2018 15:19:50 +0200 Subject: Update tests --- test/libsolidity/ABIDecoderTests.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/libsolidity/ABIDecoderTests.cpp') diff --git a/test/libsolidity/ABIDecoderTests.cpp b/test/libsolidity/ABIDecoderTests.cpp index f91a4f85..94319985 100644 --- a/test/libsolidity/ABIDecoderTests.cpp +++ b/test/libsolidity/ABIDecoderTests.cpp @@ -234,7 +234,7 @@ BOOST_AUTO_TEST_CASE(byte_arrays) return (a, b.length, b[3], c); } - function f_external(uint a, bytes b, uint c) + function f_external(uint a, bytes calldata b, uint c) external pure returns (uint, uint, byte, uint) { return (a, b.length, b[3], c); } @@ -261,7 +261,7 @@ BOOST_AUTO_TEST_CASE(calldata_arrays_too_large) { string sourceCode = R"( contract C { - function f(uint a, uint[] b, uint c) external pure returns (uint) { + function f(uint a, uint[] calldata b, uint c) external pure returns (uint) { return 7; } } -- cgit v1.2.3