aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/syntaxTests/indexing
diff options
context:
space:
mode:
Diffstat (limited to 'test/libsolidity/syntaxTests/indexing')
-rw-r--r--test/libsolidity/syntaxTests/indexing/array_negative_index.sol8
-rw-r--r--test/libsolidity/syntaxTests/indexing/array_noninteger_index.sol8
2 files changed, 16 insertions, 0 deletions
diff --git a/test/libsolidity/syntaxTests/indexing/array_negative_index.sol b/test/libsolidity/syntaxTests/indexing/array_negative_index.sol
new file mode 100644
index 00000000..019d023b
--- /dev/null
+++ b/test/libsolidity/syntaxTests/indexing/array_negative_index.sol
@@ -0,0 +1,8 @@
+contract C {
+ function f() public {
+ bytes[32] memory a;
+ a[-1];
+ }
+}
+// ----
+// TypeError: (67-69): Type int_const -1 is not implicitly convertible to expected type uint256.
diff --git a/test/libsolidity/syntaxTests/indexing/array_noninteger_index.sol b/test/libsolidity/syntaxTests/indexing/array_noninteger_index.sol
new file mode 100644
index 00000000..7c0ac9fe
--- /dev/null
+++ b/test/libsolidity/syntaxTests/indexing/array_noninteger_index.sol
@@ -0,0 +1,8 @@
+contract C {
+ function f() public {
+ bytes[32] memory a;
+ a[888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888];
+ }
+}
+// ----
+// TypeError: (67-178): Type int_const 8888...(103 digits omitted)...8888 is not implicitly convertible to expected type uint256.