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:
authorRaja R Harinath <harinath@hurrynot.org>2006-01-16 17:07:40 +0300
committerRaja R Harinath <harinath@hurrynot.org>2006-01-16 17:07:40 +0300
commit9f2c01ae30404ca1ed7868559c63a8bdf1969b15 (patch)
treeefcef8228117d776ccee30798a77da485ad5b957 /mcs/tests/test-488.cs
parentcac9522f8310ebea4e1f467378d9d14c922a8a05 (diff)
In mcs:
Fix #76874. * ecore.cs (MemberAccess.CheckIntermediateModification): Remove. (UnboxCast.DoResolveLValue): New. Move CS0445 check from CheckIntermediateModification. (FieldExpr.DoResolve): Add new two-argument version that allows us to resolve the InstanceExpression as an lvalue. The one-argument variant is now just a wrapper. (FieldExpr.DoResolveLValue): Use two-argument DoResolve. Resolve the lhs as an lvalue if the it has a value type. (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks from Assign.DoResolve. (PropertyExpr.InstanceResolve): Allow InstanceExpression to be resolved as an lvalue. (PropertyExpr.DoResolve): Update. (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it has a value type. Move CS1612 check here from CheckIntermediateModification. * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks. * expression.cs (EmptyExpression.OutAccess): New. Used as the 'right_side' of a ResolveLValue on an 'out' argument. (EmptyExpression.LValueMemberAccess): New. Used as the 'right_side' of a propagated ResolveLValue on a value type. (LocalVariableReference.DoResolveBase): Recognize EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess. Add CS1654 check. (Argument.Resolve): Use EmptyExpression.OutAccess rather than EmptyExpression.Null. In tests: * test-488.cs: New test based on #76874. In errors: * cs1654.cs, cs1654-2, cs1656-4: New tests from #76874. svn path=/trunk/mcs/; revision=55631
Diffstat (limited to 'mcs/tests/test-488.cs')
-rw-r--r--mcs/tests/test-488.cs25
1 files changed, 25 insertions, 0 deletions
diff --git a/mcs/tests/test-488.cs b/mcs/tests/test-488.cs
new file mode 100644
index 00000000000..62794ff50b8
--- /dev/null
+++ b/mcs/tests/test-488.cs
@@ -0,0 +1,25 @@
+using System.Collections;
+
+class P {
+ public int x;
+}
+
+struct Q {
+ public P p;
+ public Q (P p) { this.p = p; }
+}
+
+class Test {
+ static IEnumerable foo () { return null; }
+
+ static void Main ()
+ {
+ IEnumerable f = foo ();
+ if (f != null)
+ foreach (P p in f)
+ p.x = 0;
+ if (f != null)
+ foreach (Q q in f)
+ q.p.x = 0;
+ }
+}