mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-19 01:31:17 -10:00
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
25 lines
456 B
C#
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 ();
|
|
}
|
|
}
|