From f3cbdadec7a38626e5dd64c0faa981161b99bd80 Mon Sep 17 00:00:00 2001 From: liangdzou Date: Wed, 12 Sep 2018 18:01:34 +0800 Subject: Do not set to ref for explicit conversion and add assertion for array type conversion. Also, add some test cases for #4901 and #4948. --- .../dataLocations/memory_storage_data_location.sol | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 test/libsolidity/syntaxTests/dataLocations/memory_storage_data_location.sol (limited to 'test/libsolidity/syntaxTests/dataLocations') diff --git a/test/libsolidity/syntaxTests/dataLocations/memory_storage_data_location.sol b/test/libsolidity/syntaxTests/dataLocations/memory_storage_data_location.sol new file mode 100644 index 00000000..a441b540 --- /dev/null +++ b/test/libsolidity/syntaxTests/dataLocations/memory_storage_data_location.sol @@ -0,0 +1,12 @@ +contract C { + int[] x; + function f() public { + int[] storage a = x; + int[] memory b; + a = b; + a = int[](b); + } +} +// ---- +// TypeError: (93-94): Type int256[] memory is not implicitly convertible to expected type int256[] storage pointer. +// TypeError: (102-110): Type int256[] memory is not implicitly convertible to expected type int256[] storage pointer. -- cgit