New test, update
authorMarek Safar <marek.safar@gmail.com>
Wed, 7 Nov 2007 13:43:35 +0000 (13:43 -0000)
committerMarek Safar <marek.safar@gmail.com>
Wed, 7 Nov 2007 13:43:35 +0000 (13:43 -0000)
svn path=/trunk/mcs/; revision=89101

mcs/errors/cs1612-2.cs
mcs/errors/cs1612-3.cs
mcs/errors/cs1612-4.cs
mcs/errors/cs1612-5.cs
mcs/errors/cs1612-6.cs [new file with mode: 0644]
mcs/errors/cs1612.cs

index e7e0d7fb44f8094fbad108ec6080f5beced57a8d..b4f075c267ba61fd31f1edc26ae58844172df18d 100644 (file)
@@ -1,4 +1,4 @@
-// cs1612-2.cs: Cannot modify the return value of `X.P' because it is not a variable
+// CS1612: Cannot modify a value type return value of `X.P'. Consider storing the value in a temporary variable
 // Line: 9
 
 using System;
index dc80a2f88a04001e2527e5765f63eceebf93dc6c..797276fff4613a2b36f302492ca484d6cbc5f6a0 100644 (file)
@@ -1,4 +1,4 @@
-// cs1612-3.cs: Cannot modify the return value of `bar.this[...]' because it is not a variable
+// CS1612: Cannot modify a value type return value of `bar.this[int]'. Consider storing the value in a temporary variable
 // Line: 19
 
 struct foo {
index a0e6c995dd1287d5add8ef0b6e690b841cf1a5ac..45e5966fb9c819f157d401c2983811b2f240f115 100644 (file)
@@ -1,4 +1,4 @@
-// cs1612-4.cs: Cannot modify the return value of `X.P' because it is not a variable
+// CS1612: Cannot modify a value type return value of `X.P'. Consider storing the value in a temporary variable
 // Line: 9
 
 using System;
index ab59a80c9a1b271df43816a8470fc5a6c146e605..1db5cb158cd6d443285072953aff65fbfea64c4c 100644 (file)
@@ -1,4 +1,4 @@
-// cs1612-5.cs: Cannot modify the return value of `bar.this[...]' because it is not a variable
+// CS1612: Cannot modify a value type return value of `bar.this[int]'. Consider storing the value in a temporary variable
 // Line: 19
 
 struct foo {
diff --git a/mcs/errors/cs1612-6.cs b/mcs/errors/cs1612-6.cs
new file mode 100644 (file)
index 0000000..6278d4c
--- /dev/null
@@ -0,0 +1,30 @@
+// CS1612: Cannot modify a value type return value of `Test.v'. Consider storing the value in a temporary variable
+// Line: 28
+
+public struct V
+{
+       public int this [int i] {
+               set {
+               }
+       }
+       
+       public int x;
+}
+
+class Test
+{
+       V m_value;
+
+       public V v { get { return m_value; } }
+
+       public Test ()
+       {
+               m_value = new V ();
+       }
+
+       public static void Main ()
+       {
+               Test t = new Test ();
+               t.v [0] = 9;
+       }
+}
index d4315472f0a116ddd0fa55aeb5cacb60c8315a4e..d183e5bf24ac441a30af5f1d236a64ae0abad832 100644 (file)
@@ -1,4 +1,4 @@
-// cs1612.cs: Cannot modify the return value of `X.P' because it is not a variable
+// CS1612: Cannot modify a value type return value of `X.P'. Consider storing the value in a temporary variable
 // Line: 9
 
 using System;