-// CS0133: The expression being assigned to `c' must be constant\r
-// Line: 10\r
-\r
-class C\r
-{\r
- void Foo ()\r
- {\r
- int[] array;\r
- int idx;\r
- const int c = array [idx];\r
- }\r
-}\r
+// CS0133: The expression being assigned to `c' must be constant
+// Line: 10
+
+class C
+{
+ void Foo ()
+ {
+ int[] array;
+ int idx;
+ const int c = array [idx];
+ }
+}
"Cannot assign to `{0}' because it is a `{1}'",
((MethodGroupExpr)target).Name, target.ExprClassName);
return null;
- }\r
-\r
+ }
+
var event_expr = target as EventExpr;
if (event_expr != null) {
source = Convert.ImplicitConversionRequired (ec, right, target.Type, loc);
else
rside = null;
- target = target.ResolveLValue (ec, rside);\r
- if (target == null)\r
- return null;\r
-\r
- eclass = ExprClass.Value;\r
+ target = target.ResolveLValue (ec, rside);
+ if (target == null)
+ return null;
+
+ eclass = ExprClass.Value;
type = event_expr.Operator.ReturnType;
return this;
}
List<MemberCore> operators;
// Holds the compiler generated classes
- List<CompilerGeneratedClass> compiler_generated;\r
-\r
+ List<CompilerGeneratedClass> compiler_generated;
+
Dictionary<MethodSpec, Method> hoisted_base_call_proxies;
//
}
int top = param.Count;
- var ec = new EmitContext (null, proxy.GetILGenerator (), null);\r
+ var ec = new EmitContext (null, proxy.GetILGenerator (), null);
// TODO: GetAllParametersArguments
for (int i = 0; i <= top; i++)
ParameterReference.EmitLdArg (ec, i);
-using System;\r
-\r
-class A\r
-{\r
- public virtual void Foo<T> (T a, params string[] b) where T : struct\r
- {\r
- }\r
-}\r
-\r
-class B : A\r
-{\r
- public void Test (int v)\r
- {\r
- Action a = () => base.Foo<int> (b: "n", a: v);\r
- a ();\r
- }\r
-\r
- public void Test2<T> (T b) where T : struct\r
- {\r
- Action a2 = () => base.Foo<T> (b, "as", "asdfa");\r
- }\r
-}\r
-\r
-class Test\r
-{\r
- public static void Main ()\r
- {\r
- new B ().Test (1);\r
- }\r
+using System;
+
+class A
+{
+ public virtual void Foo<T> (T a, params string[] b) where T : struct
+ {
+ }
+}
+
+class B : A
+{
+ public void Test (int v)
+ {
+ Action a = () => base.Foo<int> (b: "n", a: v);
+ a ();
+ }
+
+ public void Test2<T> (T b) where T : struct
+ {
+ Action a2 = () => base.Foo<T> (b, "as", "asdfa");
+ }
+}
+
+class Test
+{
+ public static void Main ()
+ {
+ new B ().Test (1);
+ }
}
\ No newline at end of file
-using System;\r
-using System.Collections.Generic;\r
-\r
-class A\r
-{\r
- protected virtual int BaseM {\r
- get {\r
- return 2;\r
- }\r
- set\r
- {\r
- throw new ApplicationException ("it should not be called");\r
- }\r
- }\r
-}\r
-\r
-class B : A\r
-{\r
- protected override int BaseM {\r
- set\r
- {\r
- }\r
- }\r
-}\r
-\r
-struct S\r
-{\r
- public IEnumerable<int> GetIt ()\r
- {\r
- yield return base.GetHashCode ();\r
- }\r
-}\r
-\r
-class X : B\r
-{\r
- protected override int BaseM {\r
- set\r
- {\r
- throw new ApplicationException ("it should not be called");\r
- }\r
- }\r
-\r
- IEnumerable<int> GetIt ()\r
- {\r
- yield return base.BaseM++;\r
- }\r
-\r
- static int Main ()\r
- {\r
- foreach (var v in new X ().GetIt ())\r
- Console.WriteLine (v);\r
-\r
- foreach (var v in new S ().GetIt ())\r
- Console.WriteLine (v);\r
-\r
- return 0;\r
- }\r
+using System;
+using System.Collections.Generic;
+
+class A
+{
+ protected virtual int BaseM {
+ get {
+ return 2;
+ }
+ set
+ {
+ throw new ApplicationException ("it should not be called");
+ }
+ }
+}
+
+class B : A
+{
+ protected override int BaseM {
+ set
+ {
+ }
+ }
+}
+
+struct S
+{
+ public IEnumerable<int> GetIt ()
+ {
+ yield return base.GetHashCode ();
+ }
+}
+
+class X : B
+{
+ protected override int BaseM {
+ set
+ {
+ throw new ApplicationException ("it should not be called");
+ }
+ }
+
+ IEnumerable<int> GetIt ()
+ {
+ yield return base.BaseM++;
+ }
+
+ static int Main ()
+ {
+ foreach (var v in new X ().GetIt ())
+ Console.WriteLine (v);
+
+ foreach (var v in new S ().GetIt ())
+ Console.WriteLine (v);
+
+ return 0;
+ }
}
\ No newline at end of file
-using System;\r
-\r
-public delegate int D ();\r
-\r
-public abstract class A\r
-{\r
- protected abstract event D Event;\r
-}\r
-\r
-public class B : A\r
-{\r
- protected override event D Event;\r
-\r
- protected int Run ()\r
- {\r
- return Event ();\r
- }\r
-}\r
-\r
-public class C : B\r
-{\r
- int Test (int i)\r
- {\r
- Action a = () => base.Event += () => i;\r
- a ();\r
- return Run ();\r
- }\r
-\r
- public static int Main ()\r
- {\r
- if (new C ().Test (9) != 9)\r
- return 1;\r
-\r
- return 0;\r
- }\r
+using System;
+
+public delegate int D ();
+
+public abstract class A
+{
+ protected abstract event D Event;
+}
+
+public class B : A
+{
+ protected override event D Event;
+
+ protected int Run ()
+ {
+ return Event ();
+ }
+}
+
+public class C : B
+{
+ int Test (int i)
+ {
+ Action a = () => base.Event += () => i;
+ a ();
+ return Run ();
+ }
+
+ public static int Main ()
+ {
+ if (new C ().Test (9) != 9)
+ return 1;
+
+ return 0;
+ }
}
\ No newline at end of file