Files
mono/mcs/errors/cs1690.cs
T
Raja R Harinath 53f50dd85b In mcs and gmcs:
Possibly fix #77752.  Fix cs1690-[4-7].cs.
	* ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
	CheckMarshallByRefAccess.  Drop parameter.
	(FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
	warning.
	(FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
	InstanceExpression.
	* report.cs (AllWarnings): Add CS1690.
	* expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
	for ref access too.
	(LocalVariableReference.DoResolveBase): Update.

In errors:
	* cs1690.cs, cs1690-2.cs, cs1690-3.cs: Update.
	* cs1690-4.cs, cs1690-5.cs, cs1690-6.cs, cs1690-7.cs: New tests
	inspired by #77752.

svn path=/trunk/mcs/; revision=59586
2006-04-18 11:30:50 +00:00

25 lines
456 B
C#

// cs1690.cs: Cannot call methods, properties, or indexers on `A.point' because it is a value type member of a marshal-by-reference class
// Line: 22
// Compiler options: -warn:1 -warnaserror
using System;
public struct Point
{
public void Error () {}
}
public class A : MarshalByRefObject
{
public Point point = new Point ();
}
public class Test
{
public static void Main ()
{
A a = new A ();
a.point.Error ();
}
}