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>2005-03-21 12:18:14 +0300
committerMarek Safar <marek.safar@gmail.com>2005-03-21 12:18:14 +0300
commitfab35ab25a4d7144a01bf745cbf2de5b7b6a881e (patch)
treefb43c70bc22ec2d54a459fc2a472581cc3189d85 /mcs/errors/cs1708.cs
parentd2b3751eaa28b494fd89f853443bd60d58e95559 (diff)
new tests
svn path=/trunk/mcs/; revision=42043
Diffstat (limited to 'mcs/errors/cs1708.cs')
-rw-r--r--mcs/errors/cs1708.cs30
1 files changed, 30 insertions, 0 deletions
diff --git a/mcs/errors/cs1708.cs b/mcs/errors/cs1708.cs
new file mode 100644
index 00000000000..3c7d588b5b1
--- /dev/null
+++ b/mcs/errors/cs1708.cs
@@ -0,0 +1,30 @@
+// cs1708.cs: Fixed buffers can only be accessed through locals or fields
+// Line: 27
+// Compiler options: -unsafe
+
+using System;
+
+unsafe struct S
+{
+ public fixed int array [2];
+}
+
+class C
+{
+ unsafe public S Get ()
+ {
+ return new S ();
+ }
+}
+
+public class Tester
+{
+ public static void Main() { }
+
+ unsafe void setName()
+ {
+ C c = new C();
+ c.Get ().array [1] = 44;
+ }
+}
+