Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Safar <marek.safar@gmail.com>2010-10-29 22:15:50 +0400
committerMarek Safar <marek.safar@gmail.com>2010-10-29 22:15:50 +0400
commit313bb63cc01b5bb46c5d53a61c87d37644375733 (patch)
tree250a2474c78e623e2e5f2cdaa283bb17b083db79 /mcs/tests/dtest-045.cs
parentbeb87ce1ea03f43540bd9025ee5fd5e0af53983e (diff)
Make dynamic array access index expresions in checked context
Diffstat (limited to 'mcs/tests/dtest-045.cs')
-rw-r--r--mcs/tests/dtest-045.cs24
1 files changed, 24 insertions, 0 deletions
diff --git a/mcs/tests/dtest-045.cs b/mcs/tests/dtest-045.cs
new file mode 100644
index 00000000000..30d9c0720e3
--- /dev/null
+++ b/mcs/tests/dtest-045.cs
@@ -0,0 +1,24 @@
+using System;
+
+class Test
+{
+ static int Main ()
+ {
+ dynamic index = (uint) int.MaxValue + 1;
+ dynamic array = new int[] { 1, 2 };
+
+ try {
+ var a = array [index];
+ return 1;
+ } catch (System.OverflowException) {
+ }
+
+ try {
+ array[ulong.MaxValue] = 1;
+ return 2;
+ } catch (System.OverflowException) {
+ }
+
+ return 0;
+ }
+} \ No newline at end of file