-// Compiler options: -t:library\r
-\r
-public class A<TB, TC> where TC : A<TB, TC> { }\r
+// Compiler options: -t:library
+
+public class A<TB, TC> where TC : A<TB, TC> { }
public class B<TC> where TC : A<B<TC>, TC> { }
-using System;\r
-\r
-class C<T>\r
-{\r
- public static int Foo;\r
-}\r
-\r
-class X\r
-{\r
- public static void Main ()\r
- {\r
- }\r
- \r
- void Test<T> (T A)\r
- {\r
- A<T> ();\r
- \r
- object C;\r
- var c = C<int>.Foo;\r
- }\r
- \r
- static void A<U> ()\r
- {\r
- }\r
-}\r
+using System;
+
+class C<T>
+{
+ public static int Foo;
+}
+
+class X
+{
+ public static void Main ()
+ {
+ }
+
+ void Test<T> (T A)
+ {
+ A<T> ();
+
+ object C;
+ var c = C<int>.Foo;
+ }
+
+ static void A<U> ()
+ {
+ }
+}
-using System;\r
-using System.Collections.Generic;\r
-\r
-namespace Test\r
-{\r
- internal struct TestClass4<T> : IEquatable<TestClass4<T>>, IEquatable<T>, IEqualityComparer<TestClass4<T>> where T : class\r
- {\r
- public bool Equals (T obj)\r
- {\r
- return true;\r
- }\r
-\r
- public bool Equals (TestClass4<T> entry)\r
- {\r
- return true;\r
- }\r
-\r
- public bool Equals (TestClass4<T> x, TestClass4<T> y)\r
- {\r
- return x.Equals (y);\r
- }\r
-\r
- public int GetHashCode (TestClass4<T> obj)\r
- {\r
- return obj.GetHashCode ();\r
- }\r
-\r
- public override int GetHashCode ()\r
- {\r
- return 1;\r
- }\r
-\r
- public override bool Equals (object obj)\r
- {\r
- return false;\r
- }\r
-\r
- public static bool operator == (TestClass4<T> entry1, TestClass4<T> entry2)\r
- {\r
- return entry1.Equals (entry2);\r
- }\r
-\r
- public static bool operator == (T entry1, TestClass4<T> entry2)\r
- {\r
- return entry2.Equals (entry1);\r
- }\r
-\r
- public static bool operator == (TestClass4<T> entry1, T entry2)\r
- {\r
- return entry1.Equals (entry2);\r
- }\r
-\r
- public static bool operator == (object entry1, TestClass4<T> entry2)\r
- {\r
- return entry2.Equals (entry1);\r
- }\r
-\r
- public static bool operator == (TestClass4<T> entry1, object entry2)\r
- {\r
- return entry1.Equals (entry2);\r
- }\r
-\r
- public static bool operator != (TestClass4<T> entry1, TestClass4<T> entry2)\r
- {\r
- return !(entry1 == entry2);\r
- }\r
-\r
- public static bool operator != (T entry1, TestClass4<T> entry2)\r
- {\r
- return !(entry1 == entry2);\r
- }\r
-\r
- public static bool operator != (TestClass4<T> entry1, T entry2)\r
- {\r
- return !(entry1 == entry2);\r
- }\r
-\r
- public static bool operator != (object entry1, TestClass4<T> entry2)\r
- {\r
- return !(entry1 == entry2);\r
- }\r
-\r
- public static bool operator != (TestClass4<T> entry1, object entry2)\r
- {\r
- return !(entry1 == entry2);\r
- }\r
- }\r
-\r
- class C\r
- {\r
- public static void Main ()\r
- {\r
- new TestClass4<string> ();\r
- }\r
- }\r
-}\r
-\r
+using System;
+using System.Collections.Generic;
+
+namespace Test
+{
+ internal struct TestClass4<T> : IEquatable<TestClass4<T>>, IEquatable<T>, IEqualityComparer<TestClass4<T>> where T : class
+ {
+ public bool Equals (T obj)
+ {
+ return true;
+ }
+
+ public bool Equals (TestClass4<T> entry)
+ {
+ return true;
+ }
+
+ public bool Equals (TestClass4<T> x, TestClass4<T> y)
+ {
+ return x.Equals (y);
+ }
+
+ public int GetHashCode (TestClass4<T> obj)
+ {
+ return obj.GetHashCode ();
+ }
+
+ public override int GetHashCode ()
+ {
+ return 1;
+ }
+
+ public override bool Equals (object obj)
+ {
+ return false;
+ }
+
+ public static bool operator == (TestClass4<T> entry1, TestClass4<T> entry2)
+ {
+ return entry1.Equals (entry2);
+ }
+
+ public static bool operator == (T entry1, TestClass4<T> entry2)
+ {
+ return entry2.Equals (entry1);
+ }
+
+ public static bool operator == (TestClass4<T> entry1, T entry2)
+ {
+ return entry1.Equals (entry2);
+ }
+
+ public static bool operator == (object entry1, TestClass4<T> entry2)
+ {
+ return entry2.Equals (entry1);
+ }
+
+ public static bool operator == (TestClass4<T> entry1, object entry2)
+ {
+ return entry1.Equals (entry2);
+ }
+
+ public static bool operator != (TestClass4<T> entry1, TestClass4<T> entry2)
+ {
+ return !(entry1 == entry2);
+ }
+
+ public static bool operator != (T entry1, TestClass4<T> entry2)
+ {
+ return !(entry1 == entry2);
+ }
+
+ public static bool operator != (TestClass4<T> entry1, T entry2)
+ {
+ return !(entry1 == entry2);
+ }
+
+ public static bool operator != (object entry1, TestClass4<T> entry2)
+ {
+ return !(entry1 == entry2);
+ }
+
+ public static bool operator != (TestClass4<T> entry1, object entry2)
+ {
+ return !(entry1 == entry2);
+ }
+ }
+
+ class C
+ {
+ public static void Main ()
+ {
+ new TestClass4<string> ();
+ }
+ }
+}
+
-using System;\r
-\r
-class A\r
-{\r
- static void MA<T> (string s)\r
- {\r
- }\r
-\r
- static void F ()\r
- {\r
- }\r
-\r
- class C\r
- {\r
- Func<int> MA;\r
- int F;\r
- \r
- void Foo ()\r
- {\r
- F ();\r
- MA<int> ("");\r
- }\r
- \r
- public static void Main ()\r
- {\r
- new C ().Foo ();\r
- }\r
- }\r
+using System;
+
+class A
+{
+ static void MA<T> (string s)
+ {
+ }
+
+ static void F ()
+ {
+ }
+
+ class C
+ {
+ Func<int> MA;
+ int F;
+
+ void Foo ()
+ {
+ F ();
+ MA<int> ("");
+ }
+
+ public static void Main ()
+ {
+ new C ().Foo ();
+ }
+ }
}
\ No newline at end of file
-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
-\r
-static class S\r
-{\r
- public static void Extension (this A b, string s, bool n)\r
- {\r
- throw new ApplicationException ("wrong overload");\r
- }\r
-}\r
-\r
-class A\r
-{\r
- public void Extension (string s)\r
- {\r
- }\r
-}\r
-\r
-class Test\r
-{\r
- static void TestMethod (Action<bool> arg)\r
- {\r
- }\r
-\r
- static int TestMethod (Action<string> arg)\r
- {\r
- arg ("hola");\r
- return 2;\r
- }\r
-\r
- public static int Main ()\r
- {\r
- var a = new A ();\r
- if (TestMethod (a.Extension) != 2)\r
- return 1;\r
-\r
- return 0;\r
- }\r
-}\r
+using System;
+
+static class S
+{
+ public static void Extension (this A b, string s, bool n)
+ {
+ throw new ApplicationException ("wrong overload");
+ }
+}
+
+class A
+{
+ public void Extension (string s)
+ {
+ }
+}
+
+class Test
+{
+ static void TestMethod (Action<bool> arg)
+ {
+ }
+
+ static int TestMethod (Action<string> arg)
+ {
+ arg ("hola");
+ return 2;
+ }
+
+ public static int Main ()
+ {
+ var a = new A ();
+ if (TestMethod (a.Extension) != 2)
+ return 1;
+
+ return 0;
+ }
+}
-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
-using System.Linq;\r
-\r
-class A\r
-{\r
- public int Value;\r
-}\r
-\r
-class C\r
-{\r
- A[] Prop {\r
- get {\r
- return new A [1] { new A () };\r
- }\r
- }\r
- \r
- void Test ()\r
- {\r
- int i = 9;\r
- var c = new C ();\r
- var r = Prop.Select (l => l.Value).ToArray ();\r
- }\r
- \r
- public static int Main ()\r
- {\r
- new C().Test ();\r
- return 0;\r
- }\r
-}\r
+using System;
+using System.Linq;
+
+class A
+{
+ public int Value;
+}
+
+class C
+{
+ A[] Prop {
+ get {
+ return new A [1] { new A () };
+ }
+ }
+
+ void Test ()
+ {
+ int i = 9;
+ var c = new C ();
+ var r = Prop.Select (l => l.Value).ToArray ();
+ }
+
+ public static int Main ()
+ {
+ new C().Test ();
+ return 0;
+ }
+}
-// Compiler options: -warnaserror -warn:4\r
+// Compiler options: -warnaserror -warn:4
using System;
-interface IList \r
+interface IList
{
int Count { get; set; }
}
-interface ICounter\r
-{\r
+interface ICounter
+{
void Count (int i);
}
-\r
-interface IEx\r
-{\r
- void Count (params int[] i);\r
-}\r
-interface IListCounter: IEx, IList, ICounter\r
-{\r
+interface IEx
+{
+ void Count (params int[] i);
+}
+
+interface IListCounter: IEx, IList, ICounter
+{
}
-class Test\r
+class Test
{
static void Foo (IListCounter t)
{
-using System;\r
-\r
-class Program\r
-{\r
- static int Main ()\r
- {\r
- B b = new B ();\r
- if (b.Message != "OK")\r
- return 1;\r
- return 0;\r
- }\r
-}\r
-\r
-class A\r
-{\r
- public virtual string Message\r
- {\r
- get\r
- {\r
- return "OK";\r
- }\r
- }\r
-}\r
-\r
-class B : A\r
-{\r
- new string Message\r
- {\r
- get\r
- {\r
- throw new Exception ();\r
- }\r
- }\r
-}\r
-\r
+using System;
+
+class Program
+{
+ static int Main ()
+ {
+ B b = new B ();
+ if (b.Message != "OK")
+ return 1;
+ return 0;
+ }
+}
+
+class A
+{
+ public virtual string Message
+ {
+ get
+ {
+ return "OK";
+ }
+ }
+}
+
+class B : A
+{
+ new string Message
+ {
+ get
+ {
+ throw new Exception ();
+ }
+ }
+}
+
-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