--- /dev/null
+class Test<A>
+{
+ public void Foo<V> (V v, V w)
+ { }
+}
--- /dev/null
+public class A<T> where T : A<T>.N1<T>
+{
+ public class N1<U>
+ {
+ }
+
+ public void Foo (N1<int> arg)
+ {
+ }
+}
--- /dev/null
+public class C
+{
+ public class CC
+ {
+ }
+}
\ No newline at end of file
--- /dev/null
+// Compiler options: -noconfig
+
+namespace System.Runtime.CompilerServices
+{
+ public class ExtensionAttribute : System.Attribute
+ {
+ }
+}
using System.Reflection;
using System.Runtime.CompilerServices;
-#if NET_2_0
-
[assembly: AssemblyKeyFile ("InternalsVisibleTest.snk")]
-[assembly: InternalsVisibleTo ("gcs0281, PublicKey=0024000004800000940000000602000000240000525341310004000011000000e39d99616f48cf7d6d59f345e485e713e89b8b1265a31b1a393e9894ee3fbddaf382dcaf4083dc31ee7a40a2a25c69c6d019fba9f37ec17fd680e4f6fe3b5305f71ae9e494e3501d92508c2e98ca1e22991a217aa8ce259c9882ffdfff4fbc6fa5e6660a8ff951cd94ed011e5633651b64e8f4522519b6ec84921ee22e4840e8")]
+[assembly: InternalsVisibleTo ("cs0281, PublicKey=0024000004800000940000000602000000240000525341310004000011000000e39d99616f48cf7d6d59f345e485e713e89b8b1265a31b1a393e9894ee3fbddaf382dcaf4083dc31ee7a40a2a25c69c6d019fba9f37ec17fd680e4f6fe3b5305f71ae9e494e3501d92508c2e98ca1e22991a217aa8ce259c9882ffdfff4fbc6fa5e6660a8ff951cd94ed011e5633651b64e8f4522519b6ec84921ee22e4840e8")]
public class FriendClass
{
}
}
-#endif
-
+++ /dev/null
-class Test<A>
-{
- public void Foo<V> (V v, V w)
- { }
-}
+++ /dev/null
-public class A<T> where T : A<T>.N1<T>
-{
- public class N1<U>
- {
- }
-
- public void Foo (N1<int> arg)
- {
- }
-}
+++ /dev/null
-public class C
-{
- public class CC
- {
- }
-}
\ No newline at end of file
+++ /dev/null
-public class C<T>
-{
- T t;
-}
+++ /dev/null
-// Compiler options: -noconfig
-
-namespace System.Runtime.CompilerServices
-{
- public class ExtensionAttribute : System.Attribute
- {
- }
-}
TEST_SUPPORT_FILES = \
CS0012-lib.dll CS0012-2-lib.dll CS0012-3-lib.dll CS0012-4-lib.dll CS0012-5-lib.dll CS0012-6-lib.dll CS0012-9-lib.dll CS0012-10-lib.dll \
- CS0103-2-lib.dll CS0118-2-lib.dll CS0122-10-lib.dll CS0122-14-lib.dll CS0122-15-lib.dll CS0122-19-lib.dll CS0143-lib.dll CS0144-3-lib.dll \
- CS0205-3-lib.dll \
- CS0229-3-lib.dll CS0229-4-lib.dll \
+ CS0103-2-lib.dll CS0118-2-lib.dll CS0122-10-lib.dll CS0122-14-lib.dll CS0122-15-lib.dll CS0122-19-lib.dll CS0122-35-lib.dll CS0143-lib.dll CS0144-3-lib.dll \
+ CS0205-3-lib.dll CS0229-3-lib.dll CS0229-4-lib.dll \
+ CS0315-2-lib.dll \
CS0433-lib.dll CS0433-2-lib.dll \
CS0534-3-lib.dll CS0534-4-lib.dll CS0534-6-lib.dll CS0571-3-lib.dll CS0571-5-lib.dll CS0571-6-lib.dll \
CS0612-2-lib.dll CS0618-2-lib.dll CS0619-8-lib.dll CS0619-17-lib.dll CS0619-32-lib.dll CS0619-33-lib.dll CS0619-36-lib.dll CS0619-42-lib.dll \
CS0619-43-lib.dll CS1546-lib.dll CS0619-51-lib.dll CS1509-module.dll CS1681-2-lib.dll \
+ CS0730-lib.dll \
CS1542-lib.dll CS1577-lib.dll \
+ CS1685-2-lib.dll \
CS2015-lib.dll CS3005-16-lib.dll CS3013-module.dll CSExternAlias-lib.dll \
- GCS0122-2-lib.dll \
- GCS0315-2-lib.dll \
- GCS0730-lib.dll GCS0733-lib.dll \
- GCS1685-lib.dll \
CSFriendAssembly-lib.dll
# mention all targets
--- /dev/null
+// CS0019: Operator `??' cannot be applied to operands of type `int' and `int'
+// Line: 8
+class X
+{
+ static void Main ()
+ {
+ int a = 5;
+ int b = a ?? 3;
+ }
+}
--- /dev/null
+// CS0019: Operator `==' cannot be applied to operands of type `T' and `T'
+// Line: 5
+public class TestClass<T>
+{
+ public bool Check (T x, T y) { return x == y; }
+}
+
+public class X
+{
+ static void Main ()
+ { }
+}
+
+
--- /dev/null
+// CS0019: Operator `&&' cannot be applied to operands of type `bool?' and `bool?'
+// Line: 10
+using System;
+
+class X
+{
+ static void Main ()
+ {
+ bool? a = false, b = false;
+ Console.WriteLine (a && b);
+ }
+}
--- /dev/null
+// CS0019: Operator `==' cannot be applied to operands of type `method group' and `null'
+// Line: 8
+
+public class C
+{
+ public static void Main ()
+ {
+ bool a = DelegateMethod == null;
+ }
+
+ static int DelegateMethod(bool b)
+ {
+ return 3;
+ }
+}
--- /dev/null
+// CS0019: Operator `==' cannot be applied to operands of type `method group' and `method group'
+// Line: 8
+
+public class C
+{
+ public static void Main ()
+ {
+ bool a = DelegateMethod == DelegateMethod;
+ }
+
+ static int DelegateMethod(bool b)
+ {
+ return 3;
+ }
+}
--- /dev/null
+// CS0019: Operator `??' cannot be applied to operands of type `null' and `anonymous method'
+// Line: 8
+
+delegate void D ();
+
+class F
+{
+ D d = null ?? delegate { };
+}
--- /dev/null
+// CS0019: Operator `??' cannot be applied to operands of type `T' and `T'
+// Line: 8
+
+class F
+{
+ T Bar<T> (T t)
+ {
+ return t ?? default(T);
+ }
+}
--- /dev/null
+// CS0019: Operator `!=' cannot be applied to operands of type `ulong?' and `int'
+// Line: 8
+
+class C
+{
+ static void Test (ulong? x, int y)
+ {
+ if (x != y)
+ {
+ }
+ }
+}
--- /dev/null
+// CS0019: Operator `==' cannot be applied to operands of type `object' and `V'
+// Line: 9
+
+public class C<V>
+{
+ public bool TryGet (V v)
+ {
+ object tmp = null;
+ return tmp == v;
+ }
+}
--- /dev/null
+// CS0019: Operator `+' cannot be applied to operands of type `null' and `MyTypeImplicitOnly?'
+// Line: 13
+
+struct MyTypeImplicitOnly
+{
+}
+
+class C
+{
+ static void Main ()
+ {
+ MyTypeImplicitOnly? mt = null;
+ mt = null + mt;
+ }
+}
--- /dev/null
+// CS0019: Operator `??' cannot be applied to operands of type `null' and `bool'
+// Line: 8
+
+class Program
+{
+ static void Main()
+ {
+ object s = null ?? true;
+ }
+}
--- /dev/null
+// CS0019: Operator `??' cannot be applied to operands of type `null' and `method group'
+// Line: 8
+
+class C
+{
+ delegate void D ();
+
+ static void Main ()
+ {
+ D d = null ?? Main;
+ }
+}
--- /dev/null
+// CS0019: Operator `==' cannot be applied to operands of type `A.D' and `anonymous method'
+// Line: 11
+
+class A
+{
+ delegate void D ();
+
+ static void Main ()
+ {
+ D d = null;
+ bool r = d == (() => { });
+ }
+}
--- /dev/null
+// CS0019: Operator `==' cannot be applied to operands of type `A' and `int?'
+// Line: 22
+
+class A
+{
+ public static bool operator == (A a, int b)
+ {
+ return false;
+ }
+
+ public static bool operator != (A a, int b)
+ {
+ return false;
+ }
+}
+
+class C
+{
+ public static void Main ()
+ {
+ A a = new A ();
+ object b = a == Id;
+ }
+
+ static int? Id {
+ get { return 1; }
+ }
+}
--- /dev/null
+// CS0019: Operator `+' cannot be applied to operands of type `Program' and `Program'
+// Line: 8
+
+public class Program
+{
+ static void Main ()
+ {
+ Program b = default (Program) + default (Program);
+ }
+}
--- /dev/null
+// CS0019: Operator `==' cannot be applied to operands of type `T' and `U'
+// Line: 12
+
+interface I
+{
+}
+
+class Program
+{
+ bool Test<T, U> (T t, U u) where T : I where U : I
+ {
+ return t == u;
+ }
+}
--- /dev/null
+// CS0019: Operator `&=' cannot be applied to operands of type `bool' and `byte?'
+// Line: 10
+
+public class Test
+{
+ public static void Main()
+ {
+ bool b = false;
+ byte? b2 = 0;
+ b &= b2;
+ }
+}
--- /dev/null
+// CS0019: Operator `^' cannot be applied to operands of type `S2' and `float'
+// Line: 9
+
+public class Test
+{
+ public static void Main()
+ {
+ S2 s2 = new S2 ();
+ int r = s2 ^ 5.04f;
+ }
+}
+
+struct S2
+{
+ public static int operator ^ (double? p1, S2 s2)
+ {
+ return 1;
+ }
+
+ public static implicit operator int? (S2 s1)
+ {
+ return int.MinValue;
+ }
+}
--- /dev/null
+// CS0019: Operator `>' cannot be applied to operands of type `S' and `S?'
+// Line: 9
+
+public class Test
+{
+ public static void Main ()
+ {
+ S a = new S ();
+ S? b = null;
+ string res = a > b;
+ }
+}
+
+struct S
+{
+ public static string operator > (S a, S b)
+ {
+ return ">";
+ }
+
+ public static string operator < (S a, S b)
+ {
+ return "<";
+ }
+}
--- /dev/null
+// CS0019: Operator `==' cannot be applied to operands of type `S?' and `int'
+// Line: 15
+
+struct S
+{
+ public static bool operator != (S s, int a) { return true; }
+ public static bool operator == (S s, int a) { return false; }
+}
+
+public class C
+{
+ public static void Main ()
+ {
+ S? s;
+ var b = s == 1;
+ }
+}
--- /dev/null
+// CS0019: Operator `==' cannot be applied to operands of type `int' and `S?'
+// Line: 15
+
+struct S
+{
+ public static bool operator !=(int a, S s) { return true; }
+ public static bool operator ==(int a, S s) { return false; }
+}
+
+public class C
+{
+ public static void Main ()
+ {
+ S? s;
+ var b = 1 == s;
+ }
+}
--- /dev/null
+// CS0021: Cannot apply indexing with [] to an expression of type `G'
+// Line: 5
+public class Foo<G> {
+ public static void Bar() {
+ int i = default(G)[0];
+ }
+}
+
--- /dev/null
+// CS0029: Cannot implicitly convert type `anonymous type' to `bool'
+// Line: 10
+
+
+public class Test
+{
+ static void Main ()
+ {
+ var o = new { Value = 1 };
+ bool b = o;
+ }
+}
--- /dev/null
+// CS0029: Cannot implicitly convert type `string' to `int'
+// Line: 28
+
+
+delegate string funcs (string s);
+delegate int funci (int i);
+
+class X
+{
+ static void Foo (funci fi)
+ {
+ }
+
+ static void Foo (funcs fs)
+ {
+ }
+
+ static void Main ()
+ {
+ Foo (x => {
+ int a = "a";
+ return 2;
+ });
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS0029: Cannot implicitly convert type `T[]' to `I[]'
+// Line: 12
+
+interface I
+{
+}
+
+class C
+{
+ static void Foo<T> (T [] t) where T : I
+ {
+ I [] i = t;
+ }
+}
--- /dev/null
+// CS0029: Cannot implicitly convert type `T' to `int*'
+// Line: 8
+// Compiler options: -unsafe
+
+class T
+{
+ static unsafe void Main ()
+ {
+ int* a = default (T);
+ }
+}
--- /dev/null
+// CS0029: Cannot implicitly convert type `T2' to `T1'
+// Line: 8
+
+class Test
+{
+ static void Foo<T1, T2> (T1 t1, T2 t2)
+ {
+ T1 a = default (T2);
+ }
+}
--- /dev/null
+// CS0029: Cannot implicitly convert type `A<int>.B<long>' to `A<long>.B<long>'
+// Line: 14
+
+class A<T>
+{
+ public class B<U>
+ {
+ }
+}
+
+class Test
+{
+ static A<int>.B<long> a;
+ static A<long>.B<long> b = a;
+}
--- /dev/null
+// CS0029: Cannot implicitly convert type `T' to `EventHandler'
+// Line: 14
+
+using System;
+
+public delegate void EventHandler (int i, int j);
+
+public class Button {
+
+ public event EventHandler Click;
+
+ public void Connect<T> () where T : class
+ {
+ Click += default (T);
+ }
+}
--- /dev/null
+// CS0029: Cannot implicitly convert type `T' to `int*'
+// Line : 8
+// Compiler options: -unsafe
+
+class T {
+ static unsafe void Main ()
+ {
+ int *a = default(T);
+ }
+}
--- /dev/null
+// CS0029: Cannot implicitly convert type `bool' to `int'
+// Line : 7
+
+class T {
+ static int Main ()
+ {
+ int a = default(bool);
+ }
+}
--- /dev/null
+// CS0029: Cannot implicitly convert type `T' to `int*'
+// Line : 8
+// Compiler options: -unsafe
+
+class T {
+ static unsafe int Main ()
+ {
+ int *a = default(T);
+ }
+}
--- /dev/null
+// CS0029: Cannot implicitly convert type `Bar<long>' to `Foo<int>'
+// Line: 15
+class Foo<T>
+{
+}
+
+class Bar<T> : Foo<T>
+{
+}
+
+class X
+{
+ static void Main ()
+ {
+ Foo<int> foo = new Bar<long> ();
+ }
+}
--- /dev/null
+// CS0030: Cannot convert type `X' to `S'
+// Line: 10
+
+struct S {
+}
+
+class X {
+ static void Main ()
+ {
+ S s = (S)default(X);
+ }
+}
--- /dev/null
+// CS0030: Cannot convert type `T[,]' to `System.Collections.Generic.IEnumerable<T>'
+// Line: 10
+
+using System.Collections.Generic;
+
+class C
+{
+ IEnumerable<T> Foo<T> (T [,] a)
+ {
+ return (IEnumerable<T>) a;
+ }
+}
--- /dev/null
+// CS0030: Cannot convert type `T' to `X'
+// Line: 8
+class Foo<T>
+ where T : System.ICloneable
+{
+ public X Test (T t)
+ {
+ return (X) t;
+ }
+}
+
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+// cs0031-5.cs: Constant value `200000000000' cannot be converted to a `int'
+// Line: 7
+// Compiler options: -unsafe
+
+public unsafe struct C
+{
+ private fixed long test_1 [200000000000];
+}
+
--- /dev/null
+// CS0037: Cannot convert null to `bool' because it is a value type
+// Line: 19
+
+
+using System;
+
+class TestA
+{
+ public string Select (Func<TestA, bool> f)
+ {
+ return "";
+ }
+}
+
+public class C
+{
+ static void Main ()
+ {
+ string foo = from a in new TestA () select null;
+ }
+}
--- /dev/null
+// CS0051: Inconsistent accessibility: parameter type `C.S?[][]' is less accessible than method `C.Foo(C.S?[][])'
+// Line: 7
+
+public class C
+{
+ struct S {}
+ public void Foo (S?[][] o) {}
+}
--- /dev/null
+// CS0060: Inconsistent accessibility: base class `A<C>.B' is less accessible than class `D'
+// Line: 13
+
+public class A<T>
+{
+ public class B {}
+}
+
+internal class C : A<C>
+{
+}
+
+public class D : C.B
+{
+}
--- /dev/null
+// CS0060: Inconsistent accessibility: base class `Foo<Bar.Baz>' is less accessible than class `Bar'
+// Line: 7
+
+public class Foo<K> {
+}
+
+public class Bar : Foo<Bar.Baz> {
+ private class Baz {
+ }
+}
--- /dev/null
+// CS0060: Inconsistent accessibility: base class `Foo<Bar.Baz>' is less accessible than class `Bar'
+// Line: 7
+
+public class Foo<K> {
+}
+
+public class Bar : Foo<Bar.Baz> {
+ internal class Baz {
+ }
+}
--- /dev/null
+// CS0065: `EventClass<T>.handler': event property must have both add and remove accessors
+// Line: 10
+
+using System;
+
+public delegate void EventHandler (object sender, EventArgs e);
+
+public class EventClass<T>
+{
+ event EventHandler handler { add {} }
+}
+
--- /dev/null
+// CS0069: Event in interface cannot have add or remove accessors
+// Line: 11
+
+using System;
+
+public delegate void FooHandler ();
+
+interface IBar<T>
+{
+ event FooHandler OnFoo {
+ remove { }
+ }
+}
+
--- /dev/null
+// cs0080.cs: Constraints are not allowed on non-generic declarations
+// Line: 5
+
+using System.Collections;
+class Dingus where T : IEnumerable {
+}
+
+class D {
+ static void Main ()
+ {
+ }
+}
--- /dev/null
+// gcs0081-2.cs: Type parameter declaration must be an identifier not a type
+// Line: 6
+
+class D
+{
+ public void Foo<int>()
+ {
+ }
+}
--- /dev/null
+// gcs0081.cs: Type parameter declaration must be an identifier not a type
+// Line: 4
+
+partial class A<T, bool>
+{
+}
+
+partial class A<T, O>
+{
+}
--- /dev/null
+// gcs0081.cs: Type parameter declaration must be an identifier not a type
+// Line: 4
+
+class D<string>
+{
+}
--- /dev/null
+// CS0100: The parameter name `a' is a duplicate
+// Line: 10
+
+using System;
+
+class C
+{
+ static void Main ()
+ {
+ Func<int, int, int> l = (a, a) => 1;
+ }
+}
--- /dev/null
+// gcs0102.cs: The type `X<T>' already contains a definition for `T'
+// Line: 11
+
+class X <T> {
+ int T;
+}
+
+class W {
+ static void Main () {}
+}
--- /dev/null
+// CS0103: The name `b' does not exist in the current context
+// Line: 11
+
+using System.Linq;
+
+class C
+{
+ public static void Main ()
+ {
+ var e = from a in "abcd"
+ join b in "defg" on b equals "g"
+ select a;
+ }
+}
--- /dev/null
+// CS0103: The name `a1' does not exist in the current context
+// Line: 11
+
+using System.Linq;
+
+class C
+{
+ public static void Main ()
+ {
+ var e =
+ from a1 in "abcd"
+ select a1;
+
+ a1 = null;
+ }
+}
--- /dev/null
+// CS0103: The name `Console' does not exist in the current context
+// Line: 10
+
+
+class C
+{
+ delegate void WithOutParam (string value);
+
+ static void Main()
+ {
+ WithOutParam o = (s) => Console.WriteLine();
+ }
+}
--- /dev/null
+// CS0103: The name `Value' does not exist in the current context
+// Line: 9
+
+
+public class Test
+{
+ static void Main ()
+ {
+ var v = new { Field = Value };
+ }
+}
--- /dev/null
+// CS0103: The name `a' does not exist in the current context
+// Line: 11
+
+using System.Linq;
+
+class C
+{
+ public static void Main ()
+ {
+ var e = from a in "abcd"
+ join b in "defg" on "a" equals a
+ select a;
+ }
+}
--- /dev/null
+// CS0108: `BaseConcrete.InnerDerived<T>()' hides inherited member `BaseGeneric<string>.InnerDerived'. Use the new keyword if hiding was intended
+// Line: 14
+// Compiler options: -warn:2 -warnaserror
+
+class BaseGeneric<T>
+{
+ public class InnerDerived
+ {
+ }
+}
+
+class BaseConcrete : BaseGeneric<string>
+{
+ public void InnerDerived<T> ()
+ {
+ }
+}
--- /dev/null
+// CS0108: `Derived.Action<U>' hides inherited member `Base.Action<U>'. Use the new keyword if hiding was intended
+// Line: 12
+// Compiler options: -warnaserror
+
+public abstract class Base
+{
+ public delegate void Action<U> (U val);
+}
+
+public class Derived : Base
+{
+ public delegate void Action<U> (U i);
+}
--- /dev/null
+// CS0109: The member `Derived<U>.Action' does not hide an inherited member. The new keyword is not required
+// Line: 12
+// Compiler options: -warnaserror -warn:4
+
+public abstract class Base
+{
+ public delegate void Action<U>(U val);
+}
+
+public class Derived<U> : Base
+{
+ new internal Action<U> Action;
+}
--- /dev/null
+// CS0109: The member `Derived.Action<T,U>' does not hide an inherited member. The new keyword is not required
+// Line: 12
+// Compiler options: -warnaserror -warn:4
+
+public abstract class Base
+{
+ public delegate void Action<U> (U val);
+}
+
+public class Derived : Base
+{
+ public new delegate void Action<T, U> (U val);
+}
--- /dev/null
+// CS0111: A member `Dictionary<K,V>.Add(V)' is already defined. Rename this member or use different parameter types
+// Line: 14
+
+using System;
+using System.Collections.Generic;
+
+public class Dictionary<K,V>
+{
+ public void Add (V key)
+ {
+ throw new InvalidOperationException ();
+ }
+
+ public void Add (V value)
+ {
+ throw new InvalidOperationException ();
+ }
+}
--- /dev/null
+// CS0111: A member `Blah.I.M<U>(int)' is already defined. Rename this member or use different parameter types
+// Line : 12
+
+public interface I
+{
+ void M<T> (int i);
+}
+
+public class Blah: I
+{
+ void I.M<T> (int i) {}
+ void I.M<U> (int i) {}
+}
--- /dev/null
+// CS0111: A member `C.Foo<U>(U)' is already defined. Rename this member or use different parameter types
+// Line : 12
+
+public class C
+{
+ void Foo<T> (T i)
+ {
+ }
+
+ void Foo<U> (U i)
+ {
+ }
+}
--- /dev/null
+// CS0111: A member `MyClass.IMyInterface<System.String>.Prop' is already defined. Rename this member or use different parameter types
+// Line: 18
+
+using System;
+
+interface IMyInterface<T>
+{
+ bool Prop { set; }
+}
+
+public class MyClass: IMyInterface<string>
+{
+ bool IMyInterface<string>.Prop
+ {
+ set {}
+ }
+
+ bool IMyInterface<System.String>.Prop
+ {
+ set {}
+ }
+}
--- /dev/null
+// CS0111: A member `C.I<int>.Prop' is already defined. Rename this member or use different parameter types
+// Line: 12
+
+interface I<T>
+{
+ T Prop { get; set; }
+}
+
+class C : I<int>
+{
+ int I<int>.Prop { get; set; }
+ int I<int>.Prop { get; set; }
+}
--- /dev/null
+// CS0111: A member `Blah.I.M<X>()' is already defined. Rename this member or use different parameter types
+// Line : 12
+
+public interface I
+{
+ void M<X> ();
+}
+
+public class Blah: I
+{
+ void I.M<X> () {}
+ void I.M<X> () {}
+}
+
--- /dev/null
+// CS0111: A member `C.Foo<U>(U)' is already defined. Rename this member or use different parameter types
+// Line : 12
+
+public class C
+{
+ void Foo (int i)
+ {
+ }
+
+ void Foo<T> (T i)
+ {
+ }
+
+ void Foo<U> (U i)
+ {
+ }
+}
--- /dev/null
+// CS0111: A member `C.Foo<U>(G<U>)' is already defined. Rename this member or use different parameter types
+// Line : 14
+
+class G<T>
+{
+}
+
+public class C
+{
+ void Foo<T> (G<T> g)
+ {
+ }
+
+ void Foo<U> (G<U> u)
+ {
+ }
+}
--- /dev/null
+// CS0117: `Data' does not contain a definition for `Count'
+// Line: 15
+
+
+using System;
+
+class Data
+{
+}
+
+public class Test
+{
+ static void Main ()
+ {
+ var c = new Data { Count = 10 };
+ }
+}
--- /dev/null
+// CS0117: `A' does not contain a definition for `Method'
+// Line: 8
+
+public class E : A
+{
+ void Test ()
+ {
+ base.Method ();
+ }
+}
+
+static class S
+{
+ public static void Method (this A a)
+ {
+ }
+}
+
+public class A
+{
+}
\ No newline at end of file
--- /dev/null
+// CS0118: `N' is a `namespace' but a `type' was expected
+// Line: 8
+
+namespace N
+{
+}
+
+public class C<T> where T : N
+{
+}
\ No newline at end of file
--- /dev/null
+// CS0119: Expression denotes a `type parameter', where a `variable', `value' or `type' was expected
+// Line: 15
+
+class A
+{
+ public class T
+ {
+ }
+}
+
+class B<T> : A
+{
+ void Foo ()
+ {
+ T.Equals (null, null);
+ }
+}
--- /dev/null
+// CS0119: Expression denotes a `type', where a `variable' or `value' was expected
+// Line: 12
+
+public class Foo<T>
+{
+}
+
+class X
+{
+ static void Main ()
+ {
+ Foo<X> = new Foo<X> ();
+ }
+}
--- /dev/null
+// CS0119: Expression denotes a `type parameter', where a `variable', `value' or `type' was expected
+// Line: 8
+
+class C
+{
+ static void Foo<T> ()
+ {
+ T.ToString ();
+ }
+}
--- /dev/null
+// CS0121: The call is ambiguous between the following methods or properties: `Foo<int,int>.Test(int)' and `Foo<int,int>.Test(int)'
+// Line: 23
+using System;
+
+public class Foo<T,U>
+{
+ public void Test (T index)
+ {
+ Console.WriteLine ("Test 1: {0}", index);
+ }
+
+ public void Test (U index)
+ {
+ Console.WriteLine ("Test 2: {0}", index);
+ }
+}
+
+class X
+{
+ static void Main ()
+ {
+ Foo<int,int> foo = new Foo<int,int> ();
+ foo.Test (3);
+ }
+}
--- /dev/null
+// CS0121: The call is ambiguous between the following methods or properties: `Test.Foo<int,int>(int, System.Linq.Expressions.Expression<System.Func<int,int>>)' and `Test.Foo<int,int>(int, System.Func<int,int>)'
+// Line: 22
+
+using System;
+using System.Linq;
+using System.Linq.Expressions;
+
+class Test
+{
+ static int Foo<T, R> (T t, Expression<Func<T, R>> e)
+ {
+ return 5;
+ }
+
+ static int Foo<T, R> (T t, Func<T, R> e)
+ {
+ return 0;
+ }
+
+ static void Main ()
+ {
+ Foo (1, i => i);
+ }
+}
+
--- /dev/null
+// CS0122: The call is ambiguous between the following methods or properties: `Test.Foo(IIn<string>)' and `Test.Foo(IIn<Test>)'
+// Line: 23
+// Compiler options: -langversion:future
+
+interface IIn<in T>
+{
+}
+
+class Test
+{
+
+ static void Foo (IIn<string> f)
+ {
+ }
+
+ static void Foo (IIn<Test> f)
+ {
+ }
+
+ public static int Main ()
+ {
+ IIn<object> test = null;
+ Foo (test);
+
+ return 0;
+ }
+}
--- /dev/null
+// CS0122: `Foo.Print(this string)' is inaccessible due to its protection level
+// Line: 19
+
+
+using System;
+
+static class Foo
+{
+ static void Print (this string s)
+ {
+ }
+}
+
+static class Program
+{
+ static void Main(string[] args)
+ {
+ string s = "Hello, world";
+ Foo.Print(s);
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS0122: `Test<float>' is inaccessible due to its protection level
+// Line: 8
+// Compiler options: -r:GCS0122-35-lib.dll
+
+class X
+{
+ static void Main ()
+ {
+ Test<float> test = new Test<float> ();
+ }
+}
+
--- /dev/null
+// cs0133-2.cs: The expression being assigned to `S.pathName' must be constant
+// Line: 12
+// Compiler options: -unsafe
+
+class C
+{
+ public static int i = 4;
+}
+
+public unsafe struct S
+{
+ private fixed char pathName [C.i];
+}
--- /dev/null
+// CS0136: A local variable named `v' cannot be declared in this scope because it would give a different meaning to `v', which is already used in a `parent or current' scope to denote something else
+// Line: 13
+
+using System.Linq;
+
+public class Test
+{
+ public static void Main ()
+ {
+ var l = from v in "abcd" select (v => v);
+ }
+}
--- /dev/null
+// CS0136: A local variable named `v' cannot be declared in this scope because it would give a different meaning to `v', which is already used in a `child' scope to denote something else
+// Line: 11
+
+using System.Linq;
+
+class C
+{
+ public static void Main ()
+ {
+ var l = from v in "abcd" select v;
+ int v;
+ }
+}
--- /dev/null
+// CS0136: A local variable named `i' cannot be declared in this scope because it would give a different meaning to `i', which is already used in a `parent or current' scope to denote something else
+// Line: 10
+
+using System;
+
+class T
+{
+ public void Foo (int i)
+ {
+ Action<int> v = x => { int i = 9; };
+ }
+}
--- /dev/null
+// CS0146: Circular base class dependency involving `B<T>' and `A<float>'
+// Line: 8
+
+class A<T> : B<int>
+{
+}
+
+class B<T> : A<float>
+{ }
+
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+// CS0162: Unreachable code detected
+// Line: 10
+// Compiler options: -warnaserror -warn:2
+
+class C
+{
+ static int Main ()
+ {
+ while (!new bool {});
+ return 1;
+ }
+}
--- /dev/null
+// CS0162: Unreachable code detected
+// Line: 12
+// Compiler options: -warnaserror -warn:2
+
+using System;
+
+class E
+{
+ public void Method<T> () where T : class
+ {
+ if (default (T) != null)
+ throw new ArgumentNullException ();
+ }
+}
--- /dev/null
+// CS0171: Field `S<TKey>.key' must be fully assigned before control leaves the constructor
+// Line: 13
+
+public struct S<TKey> {
+ private TKey key;
+
+ public TKey Key {
+ get { return key; }
+ private set { key = value; }
+ }
+
+ public S (TKey key)
+ {
+ Key = key;
+ }
+}
--- /dev/null
+// CS0173: Type of conditional expression cannot be determined because there is no implicit conversion between `anonymous method' and `anonymous method'
+// Line: 11
+
+using System;
+
+class Test
+{
+ public static void Main ()
+ {
+ bool descending = false;
+ Comparison<int> comp = descending ? ((e1, e2) => e2 < e1) : ((e1, e2) => e1 < e2);
+ }
+}
--- /dev/null
+// CS0177: The out parameter `output' must be assigned to before control leaves the current method
+// Line: 10
+
+class Test
+{
+ delegate T Creator<T> ();
+
+ static bool TryAction<T> (Creator<T> creator, out T output) where T : struct
+ {
+ return false;
+ }
+}
--- /dev/null
+// CS0183: The given expression is always of the provided (`int?') type
+// Line: 10
+// Compiler options: -warnaserror -warn:1
+
+class X
+{
+ public void Foo ()
+ {
+ int? x = null;
+ if (x is int?) {
+ }
+ }
+}
--- /dev/null
+// CS0183: The given expression is always of the provided (`T') type
+// Line: 10
+// Compiler options: -warnaserror -warn:1
+
+class X
+{
+ static bool Foo<T> () where T : struct
+ {
+ T o = default (T);
+ return o is T;
+ }
+}
--- /dev/null
+// CS0184: The given expression is never of the provided (`int') type
+// Line: 10
+// Compiler options: -warnaserror -warn:1
+
+class X
+{
+ public void Foo<T> () where T : class
+ {
+ T t = default (T);
+ if (t is int) {
+ }
+ }
+}
--- /dev/null
+// CS0184: The given expression is never of the provided (`bool') type
+// Line: 13
+// Compiler options: -warnaserror -warn:1
+
+using System;
+
+class X
+{
+ void Foo ()
+ {
+ int? i = null;
+
+ if (i is bool) {
+ }
+ }
+}
--- /dev/null
+// CS0184: The given expression is never of the provided (`bool?') type
+// Line: 13
+// Compiler options: -warnaserror -warn:1
+
+using System;
+
+class X
+{
+ void Foo ()
+ {
+ int? i = null;
+
+ if (i is bool?) {
+ }
+ }
+}
--- /dev/null
+// CS0184: The given expression is never of the provided (`T') type
+// Line: 9
+// Compiler options: -warnaserror -warn:1
+
+class X<T> where T : class
+{
+ static void Foo ()
+ {
+ if (1 is T) {
+ }
+ }
+}
--- /dev/null
+// CS0200: Property or indexer `A.Counter' cannot be assigned to (it is read-only)
+// Line: 9
+
+class Program
+{
+ static void Main()
+ {
+ A a = new A();
+ a.Counter++;
+ }
+}
+
+class A {
+ private int? _counter;
+ public int? Counter {
+ get { return _counter; }
+ }
+}
--- /dev/null
+// CS0201: Only assignment, call, increment, decrement, and new object expressions can be used as a statement
+// Line: 10
+
+class TestClass
+{
+ delegate void test_delegate (int arg);
+
+ public TestClass ()
+ {
+ test_delegate D = (b) => "a";
+ }
+}
+
--- /dev/null
+// CS0201: Only assignment, call, increment, decrement, and new object expressions can be used as a statement
+// Line: 13
+
+class C<T>
+{
+ static T Test ()
+ {
+ return default (T);
+ }
+
+ public static void Main ()
+ {
+ Test ().Foo;
+ }
+}
--- /dev/null
+// CS0202: foreach statement requires that the return type `System.Collections.Generic.IEnumerable<string>' of `Test.GetEnumerator()' must have a suitable public MoveNext method and public Current property
+// Line: 10
+using System;
+using System.Collections.Generic;
+
+class Test {
+ static void Main ()
+ {
+ Test obj = new Test ();
+ foreach (string s in obj) {
+ }
+ }
+
+ public IEnumerable<string> GetEnumerator ()
+ {
+ return null;
+ }
+}
--- /dev/null
+// CS0206: A property, indexer or dynamic member access may not be passed as `ref' or `out' parameter
+// Line: 14
+
+class C
+{
+ static void Foo (ref object o)
+ {
+ }
+
+ public static void Main ()
+ {
+ var v = new { Foo = "Bar" };
+
+ Foo (ref v.Foo);
+ }
+}
--- /dev/null
+// gcs0208.cs: Cannot take the address of, get the size of, or declare a pointer to a managed type `X<A>'
+// Line: 12
+// Compiler options: -unsafe
+
+class X <Y> {
+}
+
+unsafe class A {
+
+ static void Main ()
+ {
+ int size = sizeof (X<A>);
+ }
+}
--- /dev/null
+// cs0208-2.cs : Cannot take the address of, get the size of, or declare a pointer to a managed type `Splay<T>.Node'
+// Line: 9
+// Compiler options: /unsafe
+
+public class Splay<T>
+{
+ unsafe private struct Node
+ {
+ private Node * parent;
+ private T data;
+ }
+}
+
--- /dev/null
+// cs0208-3.cs : Cannot take the address of, get the size of, or declare a pointer to a managed type `Splay<T>.Node'
+// Line: 10
+// Compiler options: /unsafe
+// Similar code to #75772, but without field of type T.
+
+public class Splay<T>
+{
+ unsafe private struct Node
+ {
+ private Node * parent;
+ }
+}
+
--- /dev/null
+// cs0208-4.cs : Cannot take the address of, get the size of, or declare a pointer to a managed type `Splay<T>.Node'
+// Line: 10
+// Compiler options: /unsafe
+// similar one to #75772 but using a class instead of a struct.
+
+public class Splay<T>
+{
+ unsafe private class Node
+ {
+ private Node * parent;
+ private T data;
+ }
+}
+
--- /dev/null
+// CS0208: Cannot take the address of, get the size of, or declare a pointer to a managed type `T'
+// Line: 8
+
+class X
+{
+ public static void Foo<T> (T t)
+ {
+ object o = sizeof (T);
+ }
+}
--- /dev/null
+// CS0214: Pointers and fixed size buffers may only be used in an unsafe context
+// Line: 9
+// Compiler options: -unsafe
+
+public class aClass
+{
+ public struct foo_t
+ {
+ public fixed char b[16];
+ }
+}
--- /dev/null
+// CS0246: The type or namespace name `var' could not be found. Are you missing a using directive or an assembly reference?
+// Line: 8
+
+
+class X
+{
+ public X ()
+ {
+ var? u = i;
+ }
+}
--- /dev/null
+// CS0246: The type or namespace name `TypeMe' could not be found. Are you missing a using directive or an assembly reference?
+// Line: 12
+
+class C
+{
+ static void Foo<T> (int i)
+ {
+ }
+
+ public static void Main ()
+ {
+ Foo<TypeMe> (1);
+ }
+}
--- /dev/null
+// CS0246: The type or namespace name `X' could not be found. Are you missing a using directive or an assembly reference?
+// Line: 4
+
+class A<T> where T : X
+{
+ public class X {}
+}
--- /dev/null
+// CS0246: The type or namespace name `M' could not be found. Are you missing a using directive or an assembly reference?
+// Line: 11
+
+interface I<T>
+{
+ void G<TT> ();
+}
+
+class C
+{
+ void I<M>.G<M> ()
+ {
+ }
+
+ public static void Main ()
+ {
+ }
+}
--- /dev/null
+// CS0246: The type or namespace name `NotExist' could not be found. Are you missing a using directive or an assembly reference?
+// Line: 6
+
+class X
+{
+ NotExist<float> foo;
+}
--- /dev/null
+// gcs0246-8.cs: The type or namespace name `B' could not be found. Are you missing a using directive or an assembly reference?
+// Line: 4
+
+class A : C<B>
+{
+ class B {}
+}
+
+interface C<X> {}
--- /dev/null
+// CS0264: Partial declarations of `A<T,O>' must have the same type parameter names in the same order
+// Line: 8
+
+partial class A<T, bool>
+{
+}
+
+partial class A<T, O>
+{
+}
--- /dev/null
+// CS0264: Partial declarations of `Partial<U>' must have the same type parameter names in the same order
+// Line: 4
+
+partial class Partial<T>
+{
+}
+
+partial class Partial<U>
+{
+}
--- /dev/null
+// gcs0265.cs: Partial declarations of `Partial<T>' have inconsistent constraints for type parameter `T'
+// Line: 4
+
+partial class Partial<T> where T: class, new()
+{
+}
+
+partial class Partial<T> where T : new ()
+{
+}
--- /dev/null
+// CS0266: Cannot implicitly convert type `bool?' to `bool'. An explicit conversion exists (are you missing a cast?)
+// Line: 9
+
+class X
+{
+ static void Main ()
+ {
+ bool? a = true;
+ int? b = a ? 3 : 4;
+ }
+}
--- /dev/null
+// CS0266: Cannot implicitly convert type `I' to `C'. An explicit conversion exists (are you missing a cast?)
+// Line: 16
+
+interface I
+{
+}
+
+struct C : I
+{
+}
+
+class X
+{
+ static void Main (string[] args)
+ {
+ C c = default (I);
+ }
+}
--- /dev/null
+// CS0266: Cannot implicitly convert type `bool?' to `bool'. An explicit conversion exists (are you missing a cast?)
+// Line: 9
+
+class X
+{
+ static void Main ()
+ {
+ bool? a = true;
+ bool b = a & a;
+ }
+}
--- /dev/null
+// CS0266: Cannot implicitly convert type `object' to `bool'. An explicit conversion exists (are you missing a cast?)
+// Line: 9
+
+class X
+{
+ static void Main ()
+ {
+ object o = true;
+ bool b = (o ?? string.Empty);
+ }
+}
--- /dev/null
+// CS0266: Cannot implicitly convert type `System.Collections.Generic.IList<int>' to `Hoge<System.Collections.Generic.IList<int>>'. An explicit conversion exists (are you missing a cast?)
+// Line: 20
+
+using System;
+using System.Collections.Generic;
+
+public class Hoge<T>
+{
+ public static implicit operator Hoge<T> (T value)
+ {
+ return null;
+ }
+}
+
+public class Test
+{
+ static void Main ()
+ {
+ IList<int> x = new List<int> ();
+ Hoge<IList<int>> hoge = x;
+ }
+}
--- /dev/null
+// CS0266: Cannot implicitly convert type `S?' to `A'. An explicit conversion exists (are you missing a cast?)
+// Line: 9
+
+struct S
+{
+ public static int Main ()
+ {
+ S? s = null;
+ A a = s;
+ return 0;
+ }
+}
+
+struct A
+{
+ public static implicit operator A (S x)
+ {
+ return new A ();
+ }
+}
--- /dev/null
+// CS0267: The `partial' modifier can be used only immediately before `class', `struct', `interface', or `void' keyword
+// Line: 6
+
+public partial class C
+{
+ partial virtual void Foo ()
+ {
+ }
+}
--- /dev/null
+// CS0271: The property or indexer `Test.A.B' cannot be used in this context because the get accessor is inaccessible
+// Line: 17
+
+using System;
+
+public class Test
+{
+ private class A
+ {
+ public string B { protected get; set; }
+ }
+
+ static void Main ()
+ {
+ A a = new A ();
+ a.B = "foo";
+ string b = a.B;
+ }
+}
--- /dev/null
+// CS0272: The property or indexer `Test.A.B' cannot be used in this context because the set accessor is inaccessible
+// Line: 16
+
+using System;
+
+public class Test
+{
+ private class A
+ {
+ public string B { get; private set; }
+ }
+
+ static void Main ()
+ {
+ A a = new A ();
+ a.B = "Foo";
+ }
+}
--- /dev/null
+// CS0281: Friend access was granted to `cs0281, PublicKeyToken=27576a8182a18822', but the output assembly is named `cs0281, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Try adding a reference to `cs0281, PublicKeyToken=27576a8182a18822' or change the output assembly name to match it
+// Line: 0
+// Compiler options: -r:CSFriendAssembly-lib.dll
+
+using System;
+
+public class Test
+{
+ static void Main ()
+ {
+ FriendClass.MyMethod ();
+ }
+}
+
--- /dev/null
+// CS0304: Cannot create an instance of the variable type `T' because it does not have the new() constraint
+// Line: 8
+
+public class Foo<T>
+{
+ public T Create ()
+ {
+ return new T ();
+ }
+}
+
+class X
+{
+ static void Main ()
+ {
+ }
+}
--- /dev/null
+// CS0305: Using the generic type `Stack<T>' requires `1' type argument(s)
+// Line: 11
+
+class Stack<T> {
+}
+
+class Test {
+}
+
+class T {
+ Stack<Test,Test> a;
+
+ static void Main()
+ {
+ }
+}
--- /dev/null
+// CS0305: Using the generic type `Stack<T>' requires `1' type argument(s)
+// Line: 9
+
+class Stack<T>
+{ }
+
+class X
+{
+ Stack stack;
+}
--- /dev/null
+// CS0305: Using the generic type `A.B<T>' requires `1' type argument(s)
+// Line: 12
+
+class A
+{
+ class B<T>
+ {
+ }
+
+ static void Main()
+ {
+ B b = new B<A>();
+ }
+}
--- /dev/null
+// CS0305: Using the generic method `C.Test<T,Y>(C.Func<T>)' requires `2' type argument(s)
+// Line: 14
+
+public class C
+{
+ public delegate int Func<T> (T t);
+
+ public static void Test<T, Y> (Func<T> f)
+ {
+ }
+
+ public static void Main ()
+ {
+ Test<int> (delegate (int i) { return i; });
+ }
+}
--- /dev/null
+// CS0305: Using the generic type `System.Collections.Generic.List<T>' requires `1' type argument(s)
+// Line: 8
+
+using System.Collections.Generic;
+
+class X
+{
+ List<int,long> list;
+}
--- /dev/null
+// CS0305: Using the generic method `X.G<T>()' requires `1' type argument(s)
+// Line: 17
+
+using System;
+
+delegate int E ();
+
+class X
+{
+ public static T G<T> ()
+ {
+ throw new ArgumentException ();
+ }
+
+ static void Main ()
+ {
+ E e2 = new E (G);
+ }
+}
--- /dev/null
+// CS0305: Using the generic type `N1.A<T>' requires `1' type argument(s)
+// Line: 12
+namespace N1
+{
+ class A<T>
+ {
+ }
+}
+
+namespace N3
+{
+ using W = N1.A;
+
+ class X
+ {
+ static void Main ()
+ {
+ }
+ }
+}
--- /dev/null
+// CS0306: The type `int*' may not be used as a type argument
+// Line: 11
+// Compiler options: -unsafe
+
+using System.Linq;
+
+public class C
+{
+ public static unsafe void Main ()
+ {
+ var e = from int* a in "aaa"
+ select a;
+ }
+}
--- /dev/null
+// CS0306: The type `System.ArgIterator' may not be used as a type argument
+// Line: 6
+
+class G<T> {}
+
+class C : G<System.ArgIterator>
+{
+}
--- /dev/null
+// gcs0306.cs: The type `char*' may not be used as a type argument
+// Line: 9
+// Compiler options: -unsafe
+
+class F<U> {}
+unsafe class O {
+ F<char *> f;
+ static void Main () {}
+}
--- /dev/null
+// CS0307: The namespace `N.M' cannot be used with type arguments
+// Line: 15
+
+namespace N
+{
+ namespace M
+ {
+ }
+}
+
+class Test
+{
+ static void Main ()
+ {
+ var a = N.M<int> ();
+ }
+}
--- /dev/null
+// CS0307: The variable `a' cannot be used with type arguments
+// Line: 9
+
+public class Tests
+{
+ public static void Test (int a)
+ {
+ a<int> ();
+ }
+}
--- /dev/null
+// CS0307: The variable `d' cannot be used with type arguments
+// Line: 9
+
+public class Tests
+{
+ public static void Main ()
+ {
+ var d = 0;
+ d<int> ();
+ }
+}
--- /dev/null
+// CS0307: The property `Test<T,U>.Value' cannot be used with type arguments
+// Line: 16
+
+class Test<T, U>
+{
+ public object Value {
+ get { return null; }
+ }
+
+ public class B
+ {
+ public B (object arg)
+ {
+ }
+
+ public static B Default = new B (Value<U>.Default);
+ }
+}
--- /dev/null
+// CS0307: The variable `a' cannot be used with type arguments
+// Line: 9
+
+public class Tests
+{
+ public static void Test<a> ()
+ {
+ a<int> ();
+ }
+}
--- /dev/null
+// CS0307: The property `B.Get' cannot be used with type arguments
+// Line: 14
+public class B
+{
+ public virtual int Get {
+ get { return 3; }
+ }
+}
+
+public class A : B
+{
+ public override int Get {
+ get {
+ return base.Get<int>;
+ }
+ }
+
+ public static void Main ()
+ {
+ }
+}
--- /dev/null
+// CS0308: The non-generic type `NamingContext' cannot be used with the type arguments
+// Line: 6
+
+class Program
+{
+ static NamingContext<int> Lookup ()
+ {
+ return null;
+ }
+}
+
+class NamingContext
+{
+}
\ No newline at end of file
--- /dev/null
+// CS0308: The non-generic type `System.DateTime' cannot be used with the type arguments
+// Line: 8
+
+using System;
+
+class X
+{
+ DateTime<int> now;
+}
--- /dev/null
+// CS0308: The non-generic type `Stack' cannot be used with the type arguments
+// Line: 9
+
+class Stack
+{ }
+
+class X
+{
+ Stack<float> stack;
+}
--- /dev/null
+// CS0308: The non-generic method `X.Foo()' cannot be used with the type arguments
+// Line: 12
+
+class X
+{
+ public void Foo ()
+ {
+ }
+
+ void Test ()
+ {
+ Foo<int> ();
+ }
+}
--- /dev/null
+// CS0308: The non-generic type `BaseGeneric<T>.InnerDerived' cannot be used with the type arguments
+// Line: 19
+
+class BaseGeneric<T>
+{
+ public class InnerDerived
+ {
+ }
+}
+
+class BaseConcrete : BaseGeneric<string>
+{
+}
+
+class Program
+{
+ static void Main ()
+ {
+ new BaseConcrete.InnerDerived<int>();
+ }
+}
--- /dev/null
+// CS0308: The non-generic type `Foo' cannot be used with the type arguments
+// Line: 16
+
+public class Foo
+{
+ public string Test<T> ()
+ {
+ return null;
+ }
+}
+
+public static class Driver
+{
+ static object UseBrokenType ()
+ {
+ return Foo<int> ().Test ();
+ }
+}
--- /dev/null
+// CS0308: The non-generic type `N1.A' cannot be used with the type arguments
+// Line: 11
+namespace N1
+{
+ class A
+ { }
+}
+
+namespace N3
+{
+ using W = N1.A<int>;
+
+ class X
+ {
+ static void Main ()
+ {
+ }
+ }
+}
--- /dev/null
+// CS0310: The type `A' must have a public parameterless constructor in order to use it as parameter `T' in the generic type or method `Foo<T>'
+// Line: 20
+
+public class Foo<T>
+ where T : new ()
+{
+}
+
+class A
+{
+ private A ()
+ { }
+}
+
+class X
+{
+ static void Main ()
+ {
+ object o = new Foo<A> ();
+ }
+}
--- /dev/null
+// CS0310: The type `A' must have a public parameterless constructor in order to use it as parameter `T' in the generic type or method `Foo<T>'
+// Line: 18
+
+public class Foo<T>
+ where T : new ()
+{
+}
+
+abstract class A
+{
+ public A ()
+ { }
+}
+
+class X
+{
+ Foo<A> foo;
+
+ static void Main ()
+ {
+ }
+}
--- /dev/null
+// CS0310: The type `Foo' must have a public parameterless constructor in order to use it as parameter `a' in the generic type or method `C<a>'
+// Line: 14
+class C <a> where a : new () {
+}
+
+class Foo {
+ public Foo (int x) { }
+}
+
+class X
+{
+ static void Main ()
+ {
+ C<Foo> x;
+ }
+}
+
+
--- /dev/null
+// CS0310: The type `string' must have a public parameterless constructor in order to use it as parameter `T' in the generic type or method `Program.Ret<T>()'
+// Line: 10
+
+public static class Program
+{
+ static void Main ()
+ {
+ Ret<string> ();
+ }
+
+ static T Ret<T> () where T : new ()
+ {
+ return new T ();
+ }
+}
--- /dev/null
+// CS0310: The type `A' must have a public parameterless constructor in order to use it as parameter `T' in the generic type or method `Foo<T>'
+// Line: 18
+
+public class Foo<T>
+ where T : new ()
+{
+}
+
+class A
+{
+ private A ()
+ { }
+}
+
+class X
+{
+ Foo<A> foo;
+
+ static void Main ()
+ {
+ }
+}
--- /dev/null
+// CS031: The type `B' cannot be used as type parameter `T' in the generic type or method `Foo<T>'. There is no implicit reference conversion from `B' to `I'
+// Line: 21
+
+public class Foo<T>
+ where T : A, I
+{
+}
+
+public interface I
+{ }
+
+public class A
+{ }
+
+public class B : A
+{ }
+
+class X
+{
+ Foo<B> foo;
+
+ static void Main ()
+ {
+ }
+}
--- /dev/null
+// CS0311: The type `B' cannot be used as type parameter `T' in the generic type or method `Foo<T>'. There is no implicit reference conversion from `B' to `A'
+// Line: 35
+using System;
+
+public class Foo<T>
+ where T : A
+{
+ public void Test (T t)
+ {
+ Console.WriteLine (t);
+ Console.WriteLine (t.GetType ());
+ t.Hello ();
+ }
+}
+
+public class A
+{
+ public void Hello ()
+ {
+ Console.WriteLine ("Hello World");
+ }
+}
+
+public class B
+{
+ public static implicit operator A (B b)
+ {
+ return new A ();
+ }
+}
+
+class X
+{
+ Foo<B> b;
+
+ static void Main ()
+ {
+ }
+}
--- /dev/null
+// CS0311: The type `B<int>' cannot be used as type parameter `X' in the generic type or method `C<X>'. There is no implicit reference conversion from `B<int>' to `D<B<int>>'
+// Line: 3
+class A : C<B<int>> {}
+class B<X> {}
+interface C<X> where X : D<X> {}
+interface D<X> {}
--- /dev/null
+// CS0311: The type `object' cannot be used as type parameter `U' in the generic type or method `G<C>.Method<U>()'. There is no implicit reference conversion from `object' to `C'
+// Line: 9
+
+public class C
+{
+ public static void Main ()
+ {
+ var mc = new G<C> ();
+ mc.Method<object> ();
+ }
+}
+
+public class G<T> where T : C
+{
+ public void Method<U> () where U : T
+ {
+ }
+}
--- /dev/null
+// CS0311: The type `B' cannot be used as type parameter `T' in the generic type or method `Foo<T>'. There is no implicit reference conversion from `B' to `A'
+// Line: 19
+
+public class Foo<T>
+ where T : A
+{
+}
+
+public class A
+{
+}
+
+public class B
+{
+}
+
+class X
+{
+ Foo<B> foo;
+
+ static void Main ()
+ {
+ }
+}
--- /dev/null
+// CS0313: The type `S?' cannot be used as type parameter `T' in the generic type or method `S.Foo<T>(T)'. The nullable type `S?' never satisfies interface constraint
+// Line: 16
+
+interface I
+{
+}
+
+struct S : I
+{
+ static void Foo<T> (T t) where T : I
+ {
+ }
+
+ static void Test (S? s)
+ {
+ Foo (s);
+ }
+}
--- /dev/null
+// CS0314: The type `T' cannot be used as type parameter `T' in the generic type or method `IB<K,T>'. There is no boxing or type parameter conversion from `T' to `System.IDisposable'
+// Line: 20
+
+public interface IA<K>
+ where K : System.IComparable, System.IComparable<K>
+{
+}
+
+public class A<K> : IA<K>
+ where K : System.IComparable, System.IComparable<K>
+{
+}
+
+public interface IB<K,T>
+ where T : System.IDisposable
+{
+}
+
+public class B<K,T> : IB<K,T>
+ where T : B<K,T>.Element, new()
+ where K : System.IComparable, System.IComparable<K>
+{
+ public abstract class Element : A<K>
+ {
+ }
+}
+
+
+
+
--- /dev/null
+// CS0314: The type `U' cannot be used as type parameter `T' in the generic type or method `A<T>'. There is no boxing or type parameter conversion from `U' to `System.IComparable'
+// Line: 13
+
+using System;
+
+class A<T>
+ where T: IComparable
+{
+}
+
+class B<U,V>
+ where V: A<U>
+{
+}
+
+class Driver
+{
+ public static void Main ()
+ {
+ }
+}
--- /dev/null
+// CS0315: The type `ushort' cannot be used as type parameter `T' in the generic type or method `A<T>'. There is no boxing conversion from `ushort' to `A<ushort>.N1<ushort>'
+// Line: 9
+// Compiler options: -r:CS0315-2-lib.dll
+
+public class Test
+{
+ public static void Main ()
+ {
+ A<ushort>.N1<ushort> a = null;
+ }
+}
--- /dev/null
+// CS0315: The type `int' cannot be used as type parameter `U' in the generic type or method `A<int?>.Test<U>()'. There is no boxing conversion from `int' to `int?'
+// Line: 19
+
+class A<T>
+{
+ public static void Test<U> () where U : T
+ {
+ }
+}
+
+class B : A<int?>
+{
+}
+
+class Program
+{
+ public static void Main ()
+ {
+ B.Test<int> ();
+ }
+}
--- /dev/null
+// CS0315: The type `int' cannot be used as type parameter `TEventArgs' in the generic type or method `System.EventHandler<TEventArgs>'. There is no boxing conversion from `int' to `System.EventArgs'
+// Line: 5
+
+class X {
+ System.EventHandler <int> x;
+ static void Main () {}
+}
+
+
--- /dev/null
+// CS0401: The `new()' constraint must be the last constraint specified
+// Line: 4
+
+class Foo<T> where T : new (), new ()
+{
+}
--- /dev/null
+// gcs0402-2.cs: `C.Main<T,U>()': an entry point cannot be generic or in a generic type
+// Line: 7
+// Compiler options: -warnaserror -warn:4
+
+class C
+{
+ public static void Main<T, U> ()
+ {
+ }
+}
\ No newline at end of file
--- /dev/null
+// gcs0402.cs: `TestClass<T>.Main()': an entry point cannot be generic or in a generic type
+// Line: 7
+// Compiler options: -warnaserror -warn:4
+
+class TestClass<T>
+{
+ public static void Main ()
+ {
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS0403: Cannot convert null to the type parameter `T' because it could be a value type. Consider using `default (T)' instead
+// Line: 8
+
+struct S
+{
+ public void Foo<T> () where T : struct
+ {
+ T t = null;
+ }
+
+ static void Main ()
+ { }
+}
--- /dev/null
+// CS0403: Cannot convert null to the type parameter `T' because it could be a value type. Consider using `default (T)' instead
+// Line: 8
+
+class X
+{
+ public static T CreateMethod<T> ()
+ {
+ return (T)null;
+ }
+}
--- /dev/null
+// CS0403: Cannot convert null to the type parameter `T' because it could be a value type. Consider using `default (T)' instead
+// Line: 7
+class Test<T>
+{
+ public T Null ()
+ {
+ return null;
+ }
+}
+
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+// CS0404: '<' unexpected: attributes cannot be generic
+// Line: 3
+[Test<T>]
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+// gcs0405.cs: Duplicate constraint `I' for type parameter `T'
+// Line: 8
+
+interface I { }
+
+class Foo<T>
+ where T : I, I
+{
+}
--- /dev/null
+// CS0406: The class type constraint `A' must be listed before any other constraints. Consider moving type constraint to the beginning of the constraint list
+// Line: 7
+
+class A { }
+interface I { }
+
+class Foo<T> where T : I, A
+{
+}
--- /dev/null
+// CS0406: The class type constraint `B' must be listed before any other constraints. Consider moving type constraint to the beginning of the constraint list
+// Line: 8
+
+class A { }
+class B { }
+
+class Foo<T>
+ where T : A, B
+{
+}
--- /dev/null
+// gcs0409.cs: A constraint clause has already been specified for type parameter `U'
+// Line: 7
+
+class C<T, U> where U: class, new() where U: new()
+{
+}
--- /dev/null
+// CS0411: The type arguments for method `C.Foo<T>(T)' cannot be inferred from the usage. Try specifying the type arguments explicitly
+// Line: 14
+// Compiler options: -unsafe
+
+class C
+{
+ static void Foo<T> (T t)
+ {
+ }
+
+ unsafe static void Test ()
+ {
+ int* i = null;
+ Foo (i);
+ }
+}
--- /dev/null
+// CS0411: The type arguments for method `C.Foo<T>(I<T>)' cannot be inferred from the usage. Try specifying the type arguments explicitly
+// Line: 17
+
+interface I<T>
+{
+}
+
+class C : I<long>, I<int>
+{
+ static void Foo<T> (I<T> i)
+ {
+ }
+
+ static void Main ()
+ {
+ C c = new C ();
+ Foo (c);
+ }
+}
--- /dev/null
+// CS0411: The type arguments for method `Foo<U>.DoSomething<U>(System.Func<U,U>)' cannot be inferred from the usage. Try specifying the type arguments explicitly
+// Line: 15
+
+using System;
+
+public class Foo<T>
+{
+ public void DoSomething<U> (Func<U, T> valueExpression) { }
+}
+
+public class Bar
+{
+ protected void DoAnything<T, U> (U value)
+ {
+ new Foo<U> ().DoSomething (value);
+ }
+}
--- /dev/null
+// CS0411: The type arguments for method `C.Foo<T>(T[], T[])' cannot be inferred from the usage. Try specifying the type arguments explicitly
+// Line: 12
+
+class C
+{
+ public static void Foo<T> (T[] t1, T[] t2)
+ {
+ }
+
+ public static void Main ()
+ {
+ Foo (new int[0], new byte[0]);
+ }
+}
--- /dev/null
+// CS0411: The type arguments for method `C.Foo<T>(ref T, ref T)' cannot be inferred from the usage. Try specifying the type arguments explicitly
+// Line: 14
+
+class C
+{
+ public static void Foo<T> (ref T t1, ref T t2)
+ {
+ }
+
+ public static void Main ()
+ {
+ string s = "a";
+ object o = null;
+ Foo (ref s, ref o);
+ }
+}
--- /dev/null
+// CS0411: The type arguments for method `C.Foo<T>(IFoo<T>, IFoo<T>)' cannot be inferred from the usage. Try specifying the type arguments explicitly
+// Line: 18
+// Compiler options: -langversion:future
+
+interface IFoo<in T>
+{
+}
+
+class C
+{
+ public static void Foo<T> (IFoo<T> e1, IFoo<T> e2)
+ {
+ }
+
+ public static void Main ()
+ {
+ IFoo<int> a = null;
+ IFoo<object> b = null;
+ Foo (a, b);
+ }
+}
--- /dev/null
+// CS0411: The type arguments for method `M.Foo<T>(System.Func<T>)' cannot be inferred from the usage. Try specifying the type arguments explicitly
+// Line: 14
+
+using System;
+
+class M
+{
+ static void Foo<T> (Func<T> t)
+ {
+ }
+
+ public static void Main ()
+ {
+ Foo (delegate { throw new Exception("foo"); });
+ }
+}
--- /dev/null
+// CS0411: The type arguments for method `C.Test<T>(System.Func<T>)' cannot be inferred from the usage. Try specifying the type arguments explicitly
+// Line: 14
+
+using System;
+
+interface IB
+{
+}
+
+class C
+{
+ public static void Main ()
+ {
+ Test (() => { if (true) return (C) null; return (IB) null; });
+ }
+
+ static void Test<T> (Func<T> f)
+ {
+ }
+}
--- /dev/null
+// CS0411: The type arguments for method `Test<float>.Foo<V,W>(V, V)' cannot be inferred from the usage. Try specifying the type arguments explicitly
+// Line: 15
+
+class Test<A>
+{
+ public void Foo<V,W> (V v, V w)
+ { }
+}
+
+class X
+{
+ static void Main ()
+ {
+ Test<float> test = new Test<float> ();
+ test.Foo (8, 9);
+ }
+}
+
--- /dev/null
+// CS0411: The type arguments for method `C.Foo<T>(T)' cannot be inferred from the usage. Try specifying the type arguments explicitly
+// Line: 12
+
+class C
+{
+ static void X ()
+ {
+ }
+
+ static void Foo<T> (T t)
+ {
+ Foo(X ());
+ }
+}
--- /dev/null
+// CS0411: The type arguments for method `Hello.World<U>(IFoo<U>)' cannot be inferred from the usage. Try specifying the type arguments explicitly
+// Line: 16
+public interface IFoo<T>
+{ }
+
+public class Foo : IFoo<int>, IFoo<string>
+{ }
+
+public class Hello
+{
+ public void World<U> (IFoo<U> foo)
+ { }
+
+ public void Test (Foo foo)
+ {
+ World (foo);
+ }
+}
+
+class X
+{
+ static void Main ()
+ {
+ }
+}
--- /dev/null
+// CS0411: The type arguments for method `Hello.World<U>(U, IFoo<U>)' cannot be inferred from the usage. Try specifying the type arguments explicitly
+// Line: 16
+public interface IFoo<T>
+{ }
+
+public class Foo : IFoo<int>, IFoo<string>
+{ }
+
+public class Hello
+{
+ public void World<U> (U u, IFoo<U> foo)
+ { }
+
+ public void Test (Foo foo)
+ {
+ World ("Canada", foo);
+ }
+}
+
+class X
+{
+ static void Main ()
+ {
+ }
+}
--- /dev/null
+// CS0411: The type arguments for method `C.Foo<T>(T, System.Collections.Generic.Comparer<T>)' cannot be inferred from the usage. Try specifying the type arguments explicitly
+// Line: 20
+
+using System;
+using System.Collections.Generic;
+
+public class C
+{
+ static void Foo<T>(T t, Comparer<T> tc)
+ {
+ }
+
+ static int Compare (int a, int b)
+ {
+ return -1;
+ }
+
+ public static void Main ()
+ {
+ Foo (1, Compare);
+ }
+}
--- /dev/null
+// CS0411: The type arguments for method `C.Test<TR,TA>(C.Func<TR,TA>, C.Func<TR,TA>)' cannot be inferred from the usage. Try specifying the type arguments explicitly
+// Line: 16
+
+
+public class C
+{
+ public delegate T1 Func<T1, T2> (T2 t);
+
+ public static TR Test<TR, TA> (Func<TR, TA> f, Func<TR, TA> f2)
+ {
+ return default (TR);
+ }
+
+ public static void Main()
+ {
+ int s = Test (delegate (int i) { return 0; }, delegate (int i) { return "a"; });
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS0411: The type arguments for method `Test.Foo<A>(D<A>)' cannot be inferred from the usage. Try specifying the type arguments explicitly
+// Line: 15
+
+delegate void D<T> (T t);
+
+class Test
+{
+ public static D<A> Foo<A> (D<A> a)
+ {
+ return null;
+ }
+
+ public static void Main ()
+ {
+ Foo (delegate {});
+ }
+}
+
--- /dev/null
+// CS0411: The type arguments for method `Test<float>.Foo<V>(V, V)' cannot be inferred from the usage. Try specifying the type arguments explicitly
+// Line: 15
+
+class Test<A>
+{
+ public void Foo<V> (V v, V w)
+ { }
+}
+
+class X
+{
+ static void Main ()
+ {
+ Test<float> test = new Test<float> ();
+ test.Foo (8, "Hello World");
+ }
+}
+
--- /dev/null
+// CS0412: The type parameter name `T' is the same as local variable or parameter name
+// Line: 8
+
+using System;
+
+interface I
+{
+ T Foo<T>(IComparable T);
+}
--- /dev/null
+// CS0412: The type parameter name `T' is the same as local variable or parameter name
+// Line: 8
+
+class C
+{
+ public void Foo<T> (int value)
+ {
+ int T;
+ }
+}
--- /dev/null
+// CS0412: The type parameter name `T' is the same as local variable or parameter name
+// Line: 6
+
+class C
+{
+ public void Foo<T> (string T)
+ {
+ }
+}
--- /dev/null
+// CS0413: The `as' operator cannot be used with a non-reference type parameter `T'. Consider adding `class' or a reference type constraint
+// Line: 8
+
+public class SomeClass {
+}
+
+public class Foo<T> where T : struct {
+ public T Do (object o) { return o as T; }
+}
+
+class Driver {
+ static void Main ()
+ {
+ Foo<SomeClass> f = new Foo<SomeClass> ();
+ f.Do ("something");
+ }
+}
+
--- /dev/null
+// CS0413: The `as' operator cannot be used with a non-reference type parameter `T'. Consider adding `class' or a reference type constraint
+// Line: 7
+
+public class SomeClass {}
+
+public class Foo<T> {
+ public T Do (object o) { return o as T; }
+}
+
+class Driver {
+ static void Main ()
+ {
+ Foo<SomeClass> f = new Foo<SomeClass> ();
+ f.Do ("something");
+ }
+}
+
--- /dev/null
+// cs0414.cs: The private field `X.i' is assigned but its value is never used
+// Line: 6
+// Compiler options: -warnaserror -warn:3
+
+class X {
+ int i = 3;
+
+ public void Y ()
+ {
+ }
+}
--- /dev/null
+// CS0416: `N.C<T>': an attribute argument cannot use type parameters
+// Line: 15
+
+using System;
+
+public class TestAttribute : Attribute
+{
+ object type;
+
+ public object Type
+ {
+ get
+ {
+ return type;
+ }
+ set
+ {
+ type = value;
+ }
+ }
+}
+
+namespace N
+{
+ class C<T>
+ {
+ [Test(Type=typeof(C<T>))]
+ public void Foo()
+ {
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS0416: `C<T>.N': an attribute argument cannot use type parameters
+// Line: 17
+
+using System;
+
+public class TestAttribute : Attribute
+{
+ public TestAttribute(Type type)
+ {
+ }
+}
+
+class C<T>
+{
+ class N
+ {
+ [Test(typeof(N))]
+ public static void Foo()
+ {
+ }
+ }
+}
--- /dev/null
+// CS0416: `C<T>': an attribute argument cannot use type parameters
+// Line: 15
+
+using System;
+
+public class TestAttribute : Attribute
+{
+ public TestAttribute(Type type)
+ {
+ }
+}
+
+class C<T>
+{
+ [Test(typeof(C<T>))]
+ public static void Foo()
+ {
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS0417.cs: `T': cannot provide arguments when creating an instance of a variable type
+// Line: 9
+
+public class Foo<T>
+ where T : new ()
+{
+ public T Create ()
+ {
+ return new T (8);
+ }
+}
+
+class X
+{
+ static void Main ()
+ {
+ }
+}
--- /dev/null
+// CS0425: The constraints for type parameter `V' of method `Foo<T>.Test<V>()' must match the constraints for type parameter `U' of interface method `IFoo<T>.Test<U>()'. Consider using an explicit interface implementation instead
+// Line: 13
+interface IFoo<T>
+{
+ void Test<U> ()
+ where U : T;
+}
+
+class Foo<T> : IFoo<T>
+{
+ public void Test<V> ()
+ where V :X
+ { }
+}
+
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+// CS0425: The constraints for type parameter `T' of method `C.Foo<T>()' must match the constraints for type parameter `T' of interface method `I.Foo<T>()'. Consider using an explicit interface implementation instead
+// Line: 11
+
+interface I
+{
+ void Foo<T> ();
+}
+
+class C : I
+{
+ public void Foo<T> () where T : struct
+ {
+ }
+}
--- /dev/null
+// CS0425: The constraints for type parameter `T' of method `Test.Baz.Method<T,V>()' must match the constraints for type parameter `T' of interface method `Test.IBar.Method<T,V>()'. Consider using an explicit interface implementation instead
+// Line: 18
+namespace Test
+{
+ using System;
+
+ public interface IFoo
+ {
+ }
+
+ public interface IBar
+ {
+ void Method<T, V>() where T : IFoo where V : T;
+ }
+
+ public class Baz : IBar
+ {
+ public void Method<T, V>() where T : IBar where V : T
+ {
+ }
+ }
+}
--- /dev/null
+// CS0425: The constraints for type parameter `V' of method `Foo<T,X>.Test<V>()' must match the constraints for type parameter `U' of interface method `IFoo<T>.Test<U>()'. Consider using an explicit interface implementation instead
+// Line: 11
+
+interface IFoo<T>
+{
+ void Test<U> () where U : T;
+}
+
+class Foo<T, X> : IFoo<T>
+{
+ public void Test<V> () where V : X
+ {
+ }
+}
--- /dev/null
+// CS0425: The constraints for type parameter `V' of method `Foo<T>.Test<V>()' must match the constraints for type parameter `U' of interface method `IFoo<T>.Test<U>()'. Consider using an explicit interface implementation instead
+// Line: 12
+interface IFoo<T>
+{
+ void Test<U> ()
+ where U : T;
+}
+
+class Foo<T> : IFoo<T>
+{
+ public void Test<V> ()
+ { }
+}
+
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+// CS0428: Cannot convert method group `Count' to non-delegate type `int'. Consider using parentheses to invoke the method
+// Line: 11
+
+using System.Linq;
+
+public class A
+{
+ public A ()
+ {
+ string [] test = new string [5];
+ A [] array = new A [test.Count];
+ }
+}
--- /dev/null
+// CS0449: The `class' or `struct' constraint must be the first constraint specified
+// Line: 8
+
+public interface I
+{
+}
+
+public class C<T> where T : I, class
+{
+}
\ No newline at end of file
--- /dev/null
+// CS0449: The `class' or `struct' constraint must be the first constraint specified
+// Line: 6
+
+public class C<T>
+{
+ public void Foo<T>() where T : class, struct
+ {
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS0449: The `class' or `struct' constraint must be the first constraint specified
+// Line: 6
+
+interface I
+{
+ void Foo<T> () where T : class, struct;
+}
--- /dev/null
+// CS0450: `A<bool,int>': cannot specify both a constraint class and the `class' or `struct' constraint
+// Line: 8
+
+class A<T, U>
+{
+}
+
+delegate void Test<T>() where T : struct, A<bool, int>;
--- /dev/null
+// CS0450: `A': cannot specify both a constraint class and the `class' or `struct' constraint
+// Line: 8
+
+class A
+{
+}
+
+class B<T> where T : class, A
+{
+}
--- /dev/null
+// CS0451: The `new()' constraint cannot be used with the `struct' constraint
+// Line: 6
+
+class C
+{
+ public static void Foo<T>() where T : struct, new ()
+ {
+ }
+}
--- /dev/null
+// CS0452: The type `int' must be a reference type in order to use it as type parameter `T' in the generic type or method `Foo.Test<T>(ref T)'
+// Line: 14
+public class Foo
+{
+ public static void Test<T> (ref T t)
+ where T : class
+ { }
+}
+
+public class C {
+ public static void Main ()
+ {
+ int i = 0;
+ Foo.Test<int> (ref i);
+ }
+}
--- /dev/null
+// CS0452: The type `int' must be a reference type in order to use it as type parameter `T' in the generic type or method `TestClass<T>'
+// Line: 23
+using System;
+
+public class TestClass<T> where T : class
+{
+ static public T meth()
+ {
+ return null;
+ }
+
+ static public T Value;
+}
+
+public class Test
+{
+ public Test()
+ {
+ }
+
+ static public void Main()
+ {
+ int i = TestClass<int>.meth();
+ Console.WriteLine (i);
+ }
+}
--- /dev/null
+// CS0452: The type `int' must be a reference type in order to use it as type parameter `T' in the generic type or method `TestClass<T>'
+// Line: 23
+using System;
+
+public class TestClass<T> where T : class
+{
+ static public T meth()
+ {
+ return null;
+ }
+
+ static public T Value;
+}
+
+public class Test
+{
+ public Test()
+ {
+ }
+
+ static public void Main()
+ {
+ int j = TestClass<int>.Value;
+ Console.WriteLine (j);
+ }
+}
--- /dev/null
+// CS0452: The type `Foo' must be a reference type in order to use it as type parameter `T' in the generic type or method `MyObject<T>'
+// Line: 13
+public class MyObject<T>
+ where T : class
+{ }
+
+struct Foo
+{ }
+
+class X
+{
+ MyObject<Foo> foo;
+
+ static void Main ()
+ { }
+}
--- /dev/null
+// CS0453: The type `Foo' must be a non-nullable value type in order to use it as type parameter `T' in the generic type or method `System.Nullable<T>'
+// Line: 10
+public class Foo
+{ }
+
+class X
+{
+ static void Main ()
+ {
+ Foo? foo = new Foo ();
+ }
+}
--- /dev/null
+// CS0453: The type `Bar?' must be a non-nullable value type in order to use it as type parameter `T' in the generic type or method `Foo<T>'
+// Line: 14
+public class Foo<T>
+ where T : struct
+{ }
+
+public struct Bar
+{ }
+
+class X
+{
+ static void Main ()
+ {
+ Foo<Bar?> foo;
+ }
+}
--- /dev/null
+// CS0453: The type `T' must be a non-nullable value type in order to use it as type parameter `T' in the generic type or method `System.Nullable<T>'
+// Line: 14
+
+using System;
+
+public static class Nullable_Test {
+ public static int Compare<T> (Nullable<T> left)
+ {
+ return 0;
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS0453: The type `B.M' must be a non-nullable value type in order to use it as type parameter `T' in the generic type or method `Foo.Test_2<T>(this T)'
+// Line: 20
+
+
+using System;
+
+public static class Foo
+{
+ public static string Test_2<T> (this T s) where T : struct
+ {
+ return null;
+ }
+}
+
+namespace B
+{
+ public class M
+ {
+ public static void Main ()
+ {
+ new M().Test_2();
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS0453: The type `X' must be a non-nullable value type in order to use it as type parameter `T' in the generic type or method `MyValue<T>'
+// Line: 10
+public class MyValue<T>
+ where T : struct
+{ }
+
+class X
+{
+ MyValue<X> x;
+
+ static void Main ()
+ { }
+}
--- /dev/null
+// CS0454: Circular constraint dependency involving `T' and `U'
+// Line: 7
+using System;
+
+class Foo<T,U>
+ where T : U
+ where U : T
+{ }
+
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+// CS0455: Type parameter `V' inherits conflicting constraints `B' and `A'
+// Line: 13
+
+class A
+{ }
+
+class B
+{ }
+
+class Foo<T,U, V>
+ where T : A
+ where U : B
+ where V : U, T
+{
+}
--- /dev/null
+// CS0455: Type parameter `T' inherits conflicting constraints `System.ValueType' and `Test'
+// Line: 8
+
+class Test
+{ }
+
+class Foo<T,U>
+ where T : struct, U
+ where U : Test
+{ }
--- /dev/null
+// CS0455: Type parameter `Y' inherits conflicting constraints `long' and `long?'
+// Line: 11
+
+abstract class A<T1, T2>
+{
+ public abstract void Foo<U> () where U : T1, T2;
+}
+
+class B : A<long, long?>
+{
+ public override void Foo<Y> ()
+ {
+ }
+}
--- /dev/null
+// CS0455: Type parameter `Y' inherits conflicting constraints `class' and `long'
+// Line: 11
+
+abstract class A<T>
+{
+ public abstract void Foo<U> () where U : class, T;
+}
+
+class B : A<long>
+{
+ public override void Foo<Y> ()
+ {
+ }
+}
--- /dev/null
+// CS0455: Type parameter `T' inherits conflicting constraints `Test' and `World'
+// Line: 11
+
+class Test
+{ }
+
+class World
+{ }
+
+class Foo<T,U>
+ where T : Test, U
+ where U : World
+{ }
--- /dev/null
+// CS0456: Type parameter `U' has the `struct' constraint, so it cannot be used as a constraint for `T'
+// Line: 7
+using System;
+
+class Foo<T,U>
+ where T : U
+ where U : struct
+{ }
+
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+// CS0458: The result of the expression is always `null' of type `bool?'
+// Line: 8
+// Compiler options: -warnaserror -warn:2
+
+class C
+{
+ static void Foo()
+ {
+ bool? b = false | null;
+ }
+}
--- /dev/null
+// CS0458: The result of the expression is always `null' of type `ulong?'
+// Line: 10
+// Compiler options: -warnaserror -warn:2
+
+class C
+{
+ static void Foo()
+ {
+ ulong a = 100;
+ var res = a << null;
+ }
+}
--- /dev/null
+// CS0458: The result of the expression is always `null' of type `int?'
+// Line: 9
+// Compiler options: -warnaserror -warn:2
+
+class C
+{
+ static void Foo()
+ {
+ var res = null >> 2;
+ }
+}
--- /dev/null
+// CS0458: The result of the expression is always `null' of type `int?'
+// Line: 9
+// Compiler options: -warnaserror -warn:2
+
+class C
+{
+ static void Foo()
+ {
+ var res = null << 2;
+ }
+}
--- /dev/null
+// CS0458: The result of the expression is always `null' of type `int?'
+// Line: 8
+// Compiler options: -warnaserror -warn:2
+
+public class MainClass
+{
+ public static void Main()
+ {
+ object d = (int?)null as int?;
+ }
+}
+
--- /dev/null
+// CS0458: The result of the expression is always `null' of type `int?'
+// Line: 8
+// Compiler options: -warnaserror -warn:2
+
+class C
+{
+ static void Main ()
+ {
+ int? i = 2;
+ i *= null;
+ }
+}
--- /dev/null
+// CS0458: The result of the expression is always `null' of type `int?'
+// Line: 8
+// Compiler options: -warnaserror -warn:2
+
+class C
+{
+ static void Main ()
+ {
+ ushort us = 22;
+ int? r = us << null;
+ }
+}
--- /dev/null
+// CS0458: The result of the expression is always `null' of type `E?'
+// Line: 15
+// Compiler options: -warnaserror -warn:2
+
+enum E
+{
+ V
+}
+
+public class C
+{
+ public static void Main ()
+ {
+ E e = E.V;
+ object o = e + null;
+ }
+}
--- /dev/null
+// CS0458: The result of the expression is always `null' of type `int?'
+// Line: 15
+// Compiler options: -warnaserror -warn:2
+
+enum E
+{
+ V
+}
+
+public class C
+{
+ public static void Main ()
+ {
+ E e = E.V;
+ object o = null - e;
+ }
+}
--- /dev/null
+// CS0472: The result of the expression is always `null' of type `MyEnum?'
+// Line: 17
+// Compiler options: -warnaserror -warn:2
+
+using System;
+
+enum MyEnum
+{
+ Value_1
+}
+
+class C
+{
+ public static void Main ()
+ {
+ var d = MyEnum.Value_1;
+ var x = d & null;
+ }
+}
--- /dev/null
+// CS0458: The result of the expression is always `null' of type `E?'
+// Line: 15
+// Compiler options: -warnaserror -warn:2
+
+enum E
+{
+ V
+}
+
+public class C
+{
+ public static void Main ()
+ {
+ E e = E.V;
+ object o = null + e;
+ }
+}
--- /dev/null
+// CS0458: The result of the expression is always `null' of type `int?'
+// Line: 9
+// Compiler options: -warnaserror -warn:2
+
+public class C
+{
+ public static void Main ()
+ {
+ b = (null & 0) != null;
+ }
+}
--- /dev/null
+// CS0458: The result of the expression is always `null' of type `bool?'
+// Line: 8
+// Compiler options: -warnaserror -warn:2
+
+class C
+{
+ static void Foo()
+ {
+ bool? b = null as bool?;
+ }
+}
--- /dev/null
+// CS0460: `C.Test<T>()': Cannot specify constraints for overrides and explicit interface implementation methods
+// Line: 11
+
+abstract class A
+{
+ protected abstract int Test<T>() where T : class;
+}
+
+class C : A
+{
+ protected override int Test<T>() where T : new()
+ {
+ }
+}
--- /dev/null
+// CS0460: `C.I.Test<C>()': Cannot specify constraints for overrides and explicit interface implementation methods
+// Line: 11
+
+interface I
+{
+ void Test<T>() where T : new ();
+}
+
+class C : I
+{
+ void I.Test<C>() where C : class
+ {
+ }
+}
--- /dev/null
+// CS0464: The result of comparing type `int?' with null is always `false'
+// Line: 9
+// Compiler options: -warnaserror -warn:2
+
+public class X
+{
+ public static bool Compute (int? x)
+ {
+ return x >= null;
+ }
+}
--- /dev/null
+// CS0464: The result of comparing type `int?' with null is always `false'
+// Line: 9
+// Compiler options: -warnaserror -warn:2
+
+public class X
+{
+ public static bool Compute ()
+ {
+ return null >= null;
+ }
+}
--- /dev/null
+// CS0464: The result of comparing type `int' with null is always `false'
+// Line: 9
+// Compiler options: -warnaserror -warn:2
+
+public class X
+{
+ public static bool Compute (int x)
+ {
+ return x < null;
+ }
+}
--- /dev/null
+// CS0472: The result of comparing value type `int' with null is `false'
+// Line: 8
+// Compiler options: -warnaserror -warn:2
+
+public class X {
+ public static bool Compute (int x)
+ {
+ return x == null;
+ }
+}
--- /dev/null
+// CS0472: The result of comparing value type `int' with null is `true'
+// Line: 9
+// Compiler options: -warnaserror -warn:2
+
+public class X
+{
+ public static void Compute (int x)
+ {
+ if (true && x != null)
+ return;
+ }
+}
--- /dev/null
+// CS0472: The result of comparing value type `int' with null is `false'
+// Line: 9
+// Compiler options: -warnaserror -warn:2
+
+class C
+{
+ public static void Main ()
+ {
+ System.Console.WriteLine(5 == (long?)null);
+ }
+}
--- /dev/null
+// CS0472: The result of comparing value type `int' with null is `true'
+// Line: 8
+// Compiler options: -warnaserror -warn:2
+
+public class X {
+ public static bool Compute (int x)
+ {
+ return x != null;
+ }
+}
--- /dev/null
+// CS0501: `X.Mine.get' must have a body because it is not marked abstract, extern, or partial
+// Line: 6
+
+class X
+{
+ public int Mine { get; set {} }
+}
--- /dev/null
+// CS0508: `A<T>.B.getT()': return type must be `A<T>.B' to match overridden member `A<A<T>.B>.getT()'
+// Line: 10
+
+abstract class A<T>
+{
+ public abstract T getT ();
+
+ public class B : A<B>
+ {
+ public override B getT ()
+ {
+ throw new System.Exception ("The method or operation is not implemented.");
+ }
+ }
+}
--- /dev/null
+// CS0508: `A<T>.B<H>.Test()': return type must be `A<T>.B<H>' to match overridden member `A<A<T>.B<H>>.Test()'
+// Line: 10
+
+abstract class A<T>
+{
+ public abstract T Test ();
+
+ public class B<H> : A<B<H>>
+ {
+ public override B<H> Test ()
+ {
+ return this;
+ }
+ }
+}
--- /dev/null
+// CS0508: `A<T>.B.getT()': return type must be `A<T>.B' to match overridden member `A<A<T>.B>.getT()'
+// Line: 10
+
+abstract class A<T>
+{
+ public abstract T getT ();
+
+ public class B : A<B>
+ {
+ public override B getT ()
+ {
+ return default (B);
+ }
+ }
+}
--- /dev/null
+// CS0515: `N.G<T>.G()': static constructor cannot have an access modifier
+// Line: 7
+
+namespace N
+{
+ class G<T> {
+ public static G ()
+ {
+ }
+ }
+}
--- /dev/null
+// CS0523: Struct member `A.a' of type `A?' causes a cycle in the struct layout
+// Line: 6
+
+struct A
+{
+ static A? a;
+}
--- /dev/null
+// CS0523: Struct member `S<T>.s' of type `S<T[]>' causes a cycle in the struct layout
+// Line: 6
+
+struct S<T>
+{
+ static S<T[]> s;
+}
--- /dev/null
+// CS0523: Struct member `S<T>.s' of type `S<int>' causes a cycle in the struct layout
+// Line: 6
+
+struct S<T>
+{
+ S<int> s;
+}
--- /dev/null
+// CS0523: Struct member `Foo.Handle' of type `Handle<Foo>' causes a cycle in the struct layout
+// Line: 13
+// NOTE: Not detected by csc only by runtime loader
+
+using System;
+
+struct Handle<T>
+{
+ public IntPtr Value;
+}
+
+struct Foo
+{
+ public readonly Handle<Foo> Handle;
+}
--- /dev/null
+// CS0523: Struct member `A<T>.a' of type `A<T>' causes a cycle in the struct layout
+// Line: 6
+
+struct A<T>
+{
+ A<T> a;
+}
--- /dev/null
+// CS0555: User-defined operator cannot take an object of the enclosing type and convert to an object of the enclosing type
+// Line: 6
+
+struct S
+{
+ public static implicit operator S (S? s)
+ {
+ return new S ();
+ }
+}
--- /dev/null
+// CS0612: `O1' is obsolete
+// Line: 23
+// Compiler options: -warnaserror
+
+using System;
+
+[Obsolete]
+class O1
+{
+}
+
+#pragma warning disable 612
+class A
+{
+ public virtual void Foo<T> () where T : O1
+ {
+ }
+}
+#pragma warning restore 612
+
+class B : A
+{
+ public override void Foo<U> ()
+ {
+ }
+}
--- /dev/null
+// CS0612: `O2' is obsolete
+// Line: 23
+// Compiler options: -warnaserror
+
+using System;
+
+[Obsolete]
+interface O2
+{
+}
+
+#pragma warning disable 612
+class A
+{
+ public virtual void Foo<T> () where T : O2
+ {
+ }
+}
+#pragma warning restore 612
+
+class B : A
+{
+ public override void Foo<U> ()
+ {
+ }
+}
--- /dev/null
+// CS0619: `ObsoleteInterface<T>' is obsolete: `'
+// Line: 15
+
+using System;
+
+[Obsolete("", true)]
+interface ObsoleteInterface<T>
+{
+}
+
+class C
+{
+ public static void Main ()
+ {
+ var v = typeof (ObsoleteInterface<>);
+ }
+}
--- /dev/null
+// gcs0633-4.cs: The argument to the `System.Diagnostics.ConditionalAttribute' attribute must be a valid identifier
+// Line: 6
+
+using System.Diagnostics;
+
+[Conditional("DEBUG+2")]
+public class Test: System.Attribute {}
--- /dev/null
+// CS0633: Overloaded method `C.Foo(string)' cannot differ on use of parameter modifiers only
+// Line: 11
+
+
+public static class C
+{
+ static void Foo (this string eType)
+ {
+ }
+
+ static void Foo (string value)
+ {
+ }
+}
--- /dev/null
+// CS0677: `C<T>.t': A volatile field cannot be of the type `T'
+// Line: 8
+
+public class C<T>
+{
+ volatile T t;
+}
--- /dev/null
+// CS0677: `C<T>.t': A volatile field cannot be of the type `T'
+// Line: 8
+
+public class C<T> where T : struct
+{
+ volatile T t;
+}
--- /dev/null
+// CS0689: `Stack<T>': Cannot derive from type parameter `T'
+// Line: 4
+
+class Stack<T> : T { }
--- /dev/null
+// gcs0692.cs: Duplicate type parameter `A'
+// Line: 4
+
+class X <A,A> {
+}
--- /dev/null
+// CS0693: Type parameter `T' has the same name as the type parameter from outer type `R<U>.A<T>'
+// Line: 9
+// Compiler options: -warnaserror -warn:3
+
+class R<U>
+{
+ class A<T>
+ {
+ struct I<T>
+ {
+ }
+ }
+}
--- /dev/null
+// CS0693: Type parameter `T' has the same name as the type parameter from outer type `C<T>'
+// Line: 7
+// Compiler options: -warnaserror -warn:3
+
+class C<T>
+{
+ void Foo<T> (T t)
+ {
+ }
+}
--- /dev/null
+// CS0693: Type parameter `T' has the same name as the type parameter from outer type `A<T>'
+// Line: 7
+// Compiler options: -warnaserror -warn:3
+
+class A<T>
+{
+ interface I<T>
+ {
+ }
+}
\ No newline at end of file
--- /dev/null
+// gcs0694.cs: Type parameter `Y' has same name as containing type, or method
+// Line: 4
+
+class Y <Y> {
+}
+
+class Test
+{
+ static void Main ()
+ { }
+}
+
--- /dev/null
+// CS0695: `A<X,Y,Z>' cannot implement both `I<X>' and `I<A<Y,Y,Z>>' because they may unify for some type parameter substitutions
+// Line: 7
+
+interface I<X>
+{ }
+
+class A<X,Y,Z> : I<X>, I<A<Y,Y,Z>>
+{ }
--- /dev/null
+// CS0695: `C<X,Y>' cannot implement both `I<X>' and `I<K<Y>>' because they may unify for some type parameter substitutions
+// Line: 10
+
+interface I<X>
+{ }
+
+interface K<X>
+{ }
+
+class C<X,Y> : I<X>, I<K<Y>>
+{ }
--- /dev/null
+// CS0695: `C<X,Y>' cannot implement both `I<K<Y>>' and `I<X>' because they may unify for some type parameter substitutions
+// Line: 10
+
+interface I<X>
+{ }
+
+interface K<X>
+{ }
+
+class C<X,Y> : I<K<Y>>, I<X>
+{ }
--- /dev/null
+// CS0695: `A<X,Y>' cannot implement both `I<X>' and `I<Y>' because they may unify for some type parameter substitutions
+// Line: 7
+
+interface I<X>
+{ }
+
+class A<X,Y> : I<X>, I<Y>
+{ }
--- /dev/null
+// cs0698.cs: A generic type cannot derive from `System.Attribute' because it is an attribute class
+// Line: 6
+
+using System;
+
+class Stack<T> : Attribute
+{ }
+
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+// CS0699: `I<T>': A constraint references nonexistent type parameter `U'
+// Line: 8
+
+partial interface I<T>
+{
+}
+
+partial interface I<T> where U : class
+{
+}
--- /dev/null
+// CS0699: `Test<T>()': A constraint references nonexistent type parameter `U'
+// Line: 6
+
+interface I
+{
+ void Test<T>() where U : class;
+}
--- /dev/null
+// CS0701: `S' is not a valid constraint. A constraint must be an interface, a non-sealed class or a type parameter
+// Line: 8
+
+struct S
+{
+}
+
+class Foo<T> where T : S
+{
+}
--- /dev/null
+// CS0701: `string' is not a valid constraint. A constraint must be an interface, a non-sealed class or a type parameter
+// Line: 4
+
+class Foo<T> where T : string
+{
+}
--- /dev/null
+// CS0701: `A' is not a valid constraint. A constraint must be an interface, a non-sealed class or a type parameter
+// Line: 6
+
+sealed class A { }
+
+class Foo<T> where T : A
+{
+}
--- /dev/null
+// CS0702: A constraint cannot be special class `object'
+// Line: 8
+
+using System;
+
+class Foo<T>
+ where T : object
+{
+}
--- /dev/null
+// CS0702: A constraint cannot be special class `System.MulticastDelegate'
+// Line: 6
+
+using System;
+
+class C<T> where T : MulticastDelegate
+{
+}
--- /dev/null
+// CS0702: A constraint cannot be special class `System.Array'
+// Line: 8
+
+using System;
+
+class Foo<T>
+ where T : Array
+{
+}
--- /dev/null
+// CS0703: Inconsistent accessibility: constraint type `A.B<T>.C' is less accessible than `A.B<T>'
+// Line: 6
+
+public class A
+{
+ protected internal class B<T> where T : B<T>.C
+ {
+ internal class C
+ {
+ }
+ }
+}
--- /dev/null
+// CS0703: Inconsistent accessibility: constraint type `C.I' is less accessible than `C.Foo<T>()'
+// Line: 10
+
+public class C
+{
+ interface I
+ {
+ }
+
+ public void Foo<T>() where T : I
+ {
+ }
+}
--- /dev/null
+// CS0703: Inconsistent accessibility: constraint type `I' is less accessible than `C<T>'
+// Line: 8
+
+interface I
+{
+}
+
+public class C<T> where T : I
+{
+}
\ No newline at end of file
--- /dev/null
+// CS0704: A nested type cannot be specified through a type parameter `T'
+// Line: 6
+
+class G<T>
+{
+ T.A x;
+}
--- /dev/null
+// CS0706: Invalid constraint type `string[]'
+// Line: 4
+
+public class C<T> where T : string[]
+{
+}
--- /dev/null
+// CS0717: `S' is not a valid constraint. Static classes cannot be used as constraints
+// Line: 8
+
+static class S
+{
+}
+
+class Foo<T> where T : S
+{
+}
--- /dev/null
+// CS0718: `S': static classes cannot be used as generic arguments
+// Line: 14
+
+static class S
+{
+}
+
+class C<T>
+{
+}
+
+class Test
+{
+ C<S> foo;
+}
\ No newline at end of file
--- /dev/null
+// CS0721: `C': static types cannot be used as parameters
+// Line: 6
+
+
+static class C
+{
+ static void Foo (this C c)
+ {
+ }
+}
--- /dev/null
+// CS0723: `C<T>.t': cannot declare variables of static types
+// Line: 10
+
+static class S<T>
+{
+}
+
+public class C<T>
+{
+ S<T> t;
+}
\ No newline at end of file
--- /dev/null
+// gcs0729.cs: Cannot forward type `C' because it is defined in this assembly
+// Line: 7
+
+using System;
+using System.Runtime.CompilerServices;
+
+[assembly: TypeForwardedTo(typeof (C))]
+
+class C
+{
+}
\ No newline at end of file
--- /dev/null
+// CS0730: Cannot forward type `C.CC' because it is a nested type
+// Line: 8
+// Compiler options: -r:CS0730-lib.dll
+
+using System;
+using System.Runtime.CompilerServices;
+
+[assembly: TypeForwardedTo(typeof (C.CC))]
--- /dev/null
+// gcs0735-2.cs: Invalid type specified as an argument for TypeForwardedTo attribute
+// Line: 7
+
+using System;
+using System.Runtime.CompilerServices;
+
+[assembly: TypeForwardedTo(typeof (int[]))]
\ No newline at end of file
--- /dev/null
+// gcs0735.cs: Invalid type specified as an argument for TypeForwardedTo attribute
+// Line: 7
+
+using System;
+using System.Runtime.CompilerServices;
+
+[assembly: TypeForwardedTo((Type)null)]
\ No newline at end of file
--- /dev/null
+// CS0739: A duplicate type forward of type `int'
+// Line: 8
+
+using System;
+using System.Runtime.CompilerServices;
+
+[assembly: TypeForwardedTo(typeof (int))]
+[assembly: TypeForwardedTo(typeof (int))]
--- /dev/null
+// CS0746: Invalid anonymous type member declarator. Anonymous type members must be a member assignment, simple name or member access expression
+// Line: 16
+
+
+using System;
+
+public class Test
+{
+ static void Main ()
+ {
+ var c = new { new Test () };
+ }
+}
--- /dev/null
+// CS0747: Inconsistent `object initializer' member declaration
+// Line: 16
+
+
+using System;
+using System.Collections;
+
+class Data
+{
+}
+
+public class Test
+{
+ static void Main ()
+ {
+ var c = new ArrayList { Count = 1, 1 };
+ }
+}
--- /dev/null
+// CS0747: Inconsistent `collection initializer' member declaration
+// Line: 16
+
+
+using System;
+using System.Collections;
+
+class Data
+{
+}
+
+public class Test
+{
+ static void Main ()
+ {
+ var c = new ArrayList { 1, Count = 1 };
+ }
+}
--- /dev/null
+// CS0748: All lambda parameters must be typed either explicitly or implicitly
+// Line: 11
+
+
+public class C
+{
+ delegate void E ();
+
+ public static void Main ()
+ {
+ e = (ref int E, v) => {};
+ }
+}
--- /dev/null
+// CS0755: A partial method declaration and partial method implementation must be both an extension method or neither
+// Line: 11
+
+
+public static partial class C
+{
+ static partial void Foo (this string eType)
+ {
+ }
+
+ static partial void Foo (string value);
+}
--- /dev/null
+// CS0818: An implicitly typed local variable declarator must include an initializer
+// Line: 9
+
+
+public class Test
+{
+ static void Main ()
+ {
+ var v;
+ }
+}
+
--- /dev/null
+// CS0820: An implicitly typed local variable declarator cannot use an array initializer
+// Line: 9
+
+
+public class Test
+{
+ static void Main ()
+ {
+ var v = { 0 };
+ }
+}
+
--- /dev/null
+// CS0821: A fixed statement cannot use an implicitly typed local variable
+// Line: 9
+// Compiler options: -unsafe
+
+public class Point
+{
+ public int X;
+ public int Y;
+}
+
+public class Test
+{
+ unsafe static void Main ()
+ {
+ Point p = new Point ();
+ p.X = 42;
+ p.Y = 16;
+
+ fixed (var x = &p.X)
+ {
+ }
+ }
+}
+
--- /dev/null
+// CS0822: An implicitly typed local variable cannot be a constant
+// Line: 9
+
+
+public class Test
+{
+ static void Main ()
+ {
+ const var v = 0;
+ }
+}
+
--- /dev/null
+// CS0825: The contextual keyword `var' may only appear within a local variable declaration
+// Line: 9
+
+
+public class Test
+{
+ event var v;
+}
+
--- /dev/null
+// CS0825: The contextual keyword `var' may only appear within a local variable declaration
+// Line: 9
+
+
+public class Test
+{
+ const var v = 9;
+}
+
--- /dev/null
+// CS0825: The contextual keyword `var' may only appear within a local variable declaration
+// Line: 9
+
+
+public class Test
+{
+ var v = "a";
+}
+
--- /dev/null
+// CS0826: The type of an implicitly typed array cannot be inferred from the initializer. Try specifying array type explicitly
+// Line: 9
+
+
+public class Test
+{
+ static void Main ()
+ {
+ var e = new[] { null };
+ }
+}
+
--- /dev/null
+// CS0826: The type of an implicitly typed array cannot be inferred from the initializer. Try specifying array type explicitly
+// Line: 13
+
+
+public class Test
+{
+ static void TestMethod ()
+ {
+ }
+
+ static void Main ()
+ {
+ var e = new[] { TestMethod () };
+ }
+}
+
--- /dev/null
+// CS0826: The type of an implicitly typed array cannot be inferred from the initializer. Try specifying array type explicitly
+// Line: 9
+
+
+public class Test
+{
+ static void Main ()
+ {
+ var e = new[,,,] { 1, 2 };
+ }
+}
+
--- /dev/null
+// CS0826: The type of an implicitly typed array cannot be inferred from the initializer. Try specifying array type explicitly
+// Line: 9
+
+
+public class Test
+{
+ static void Main ()
+ {
+ var e = new[] { delegate {} };
+ }
+}
+
--- /dev/null
+// CS0826: The type of an implicitly typed array cannot be inferred from the initializer. Try specifying array type explicitly
+// Line: 8
+
+public class Test
+{
+ static void Main ()
+ {
+ var e = new[] { 1, "a" };
+ }
+}
+
--- /dev/null
+// CS0826: The type of an implicitly typed array cannot be inferred from the initializer. Try specifying array type explicitly
+// Line: 8
+
+public class Test
+{
+ static void Main ()
+ {
+ var e = new[] { 1, null };
+ }
+}
+
--- /dev/null
+// CS0826: The type of an implicitly typed array cannot be inferred from the initializer. Try specifying array type explicitly
+// Line: 8
+
+public class Test
+{
+ static void Main ()
+ {
+ var e = new[] { Main };
+ }
+}
+
--- /dev/null
+// CS0826: The type of an implicitly typed array cannot be inferred from the initializer. Try specifying array type explicitly
+// Line: 9
+
+
+public class Test
+{
+ static void Main ()
+ {
+ var e = new[] { };
+ }
+}
+
--- /dev/null
+// CS0828: An anonymous type property `Value' cannot be initialized with `int*'
+// Line: 9
+// Compiler options: -unsafe
+
+public unsafe class Test
+{
+ static int* Error ()
+ {
+ return (int*)0;
+ }
+
+ static void Main ()
+ {
+ var v = new { Value = Error () };
+ }
+}
--- /dev/null
+// CS0828: An anonymous type property `Value' cannot be initialized with `anonymous method'
+// Line: 9
+
+
+public class Test
+{
+ static void Main ()
+ {
+ var v = new { Value = delegate () { return 1; } };
+ }
+}
--- /dev/null
+// CS0828: An anonymous type property `Value' cannot be initialized with `lambda expression'
+// Line: 9
+
+
+public class Test
+{
+ static void Main ()
+ {
+ var v = new { Value = i => 1 };
+ }
+}
--- /dev/null
+// CS0828: An anonymous type property `Value' cannot be initialized with `void'
+// Line: 13
+
+
+public class Test
+{
+ static void Error ()
+ {
+ }
+
+ static void Main ()
+ {
+ var v = new { Value = Error () };
+ }
+}
--- /dev/null
+// CS0828: An anonymous type property `Value' cannot be initialized with `method group'
+// Line: 12
+
+public class Test
+{
+ static void Error ()
+ {
+ }
+
+ static void Main ()
+ {
+ var v = new { Value = Error };
+ }
+}
--- /dev/null
+// CS0828: An anonymous type property `Value' cannot be initialized with `null'
+// Line: 9
+
+
+public class Test
+{
+ static void Main ()
+ {
+ int A = 9;
+ var v1 = new { A, Value = null };
+ }
+}
--- /dev/null
+// CS0831: An expression tree may not contain a base access
+// Line: 14
+
+using System;
+using System.Linq.Expressions;
+
+class B
+{
+ protected bool Core {
+ get {
+ return true;
+ }
+ }
+}
+
+class C : B
+{
+ public void Test ()
+ {
+ Expression<Func<bool>> e = () => base.Core;
+ }
+}
--- /dev/null
+// CS0831: An expression tree may not contain a base access
+// Line: 20
+
+using System;
+using System.Linq.Expressions;
+
+class B
+{
+ protected B this [int i] {
+ get {
+ return null;
+ }
+ }
+}
+
+class C : B
+{
+ public void Test ()
+ {
+ Expression<Func<B>> e = () => base [8];
+ }
+}
--- /dev/null
+// CS0831: An expression tree may not contain a base access
+// Line: 14
+
+using System;
+using System.Linq.Expressions;
+
+class B
+{
+ protected int Core ()
+ {
+ return 4;
+ }
+}
+
+class C : B
+{
+ public void Test ()
+ {
+ Expression<Func<int>> e = () => base.Core ();
+ }
+}
--- /dev/null
+// CS0832: An expression tree cannot contain an assignment operator
+// Line: 13
+
+using System;
+using System.Linq.Expressions;
+
+class C
+{
+ delegate void D (string s);
+
+ public static void Main ()
+ {
+ Expression<D> e = (a) => a = "a";
+ }
+}
--- /dev/null
+// CS0832: An expression tree cannot contain an assignment operator
+// Line: 11
+
+using System;
+using System.Linq.Expressions;
+
+class C
+{
+ public static void Main ()
+ {
+ Expression<Func<int, int>> e = (a) => --a;
+ }
+}
--- /dev/null
+// CS0832: An expression tree cannot contain an assignment operator
+// Line: 19
+
+using System;
+using System.Linq.Expressions;
+
+public delegate void EventHandler (int i, int j);
+
+public class Button
+{
+ public event EventHandler Click;
+}
+
+public class Blah
+{
+ public static void Main ()
+ {
+ Button b = new Button ();
+ Expression<Action> e = () => b.Click += new EventHandler (Button1_Click);
+ }
+
+ public static void Button1_Click (int i, int j)
+ {
+ }
+}
--- /dev/null
+// CS0832: An expression tree cannot contain an assignment operator
+// Line: 13
+
+using System;
+using System.Linq.Expressions;
+
+class C
+{
+ delegate void D (string s);
+
+ public static void Main ()
+ {
+ Expression<D> e = (a) => a = "a";
+ }
+}
--- /dev/null
+// CS0833: `Value': An anonymous type cannot have multiple properties with the same name
+// Line: 9
+
+
+public class Test
+{
+ static void Main ()
+ {
+ var v1 = new { Value = 1, Value = 0 };
+ }
+}
--- /dev/null
+// CS0834: A lambda expression with statement body cannot be converted to an expresion tree
+// Line: 12
+
+using System.Linq.Expressions;
+
+class C
+{
+ delegate void D ();
+
+ public void Foo ()
+ {
+ Expression<D> e = () => { };
+ }
+}
--- /dev/null
+// CS0834: A lambda expression with statement body cannot be converted to an expresion tree
+// Line: 12
+
+using System.Linq.Expressions;
+
+class C
+{
+ delegate bool D ();
+
+ public void Foo ()
+ {
+ Expression<D> e = () => { return true; };
+ }
+}
--- /dev/null
+// CS0835: Cannot convert `lambda expression' to an expression tree of non-delegate type `string'
+// Line: 10
+
+using System.Linq.Expressions;
+
+class C
+{
+ public void Foo ()
+ {
+ Expression<string> e = () => "a";
+ }
+}
--- /dev/null
+// CS0836: Anonymous types cannot be used in this expression
+// Line: 6
+
+public class C
+{
+ const object o = new { };
+}
--- /dev/null
+// CS0837: The `as' operator cannot be applied to a lambda expression or anonymous method
+// Line: 15
+
+
+class X
+{
+ delegate void D ();
+
+ static void Test (D d)
+ {
+ }
+
+ static void Main ()
+ {
+ Test ((() => { }) as D);
+ }
+}
--- /dev/null
+// CS0838: An expression tree cannot contain a multidimensional array initializer
+// Line: 11
+
+using System;
+using System.Linq.Expressions;
+
+class C
+{
+ void Foo ()
+ {
+ Expression<Func<char [,]>> e = () => new char [,] { { 'x', 'y' }, { 'a', 'b' }};
+ }
+}
--- /dev/null
+// CS0840: `Test.Property.get' must have a body because it is not marked abstract or extern. The property can be automatically implemented when you define both accessors
+// Line: 7
+
+
+public abstract class Test
+{
+ public string Property { get; }
+}
--- /dev/null
+// CS0841: A local variable `v' cannot be used before it is declared
+// Line: 9
+
+
+public class Test
+{
+ static void Main ()
+ {
+ var v = ++v;
+ }
+}
+
--- /dev/null
+// CS0842: Automatically implemented property `S.Value' cannot be used inside a type with an explicit StructLayout attribute
+// Line: 10
+
+using System.Runtime.InteropServices;
+
+[StructLayout(LayoutKind.Explicit)]
+class S
+{
+ public int Value {
+ get; set;
+ }
+}
--- /dev/null
+// CS0845: An expression tree cannot contain a coalescing operator with null left side
+// Line: 11
+
+using System;
+using System.Linq.Expressions;
+
+class C
+{
+ public static void Main ()
+ {
+ Expression<Func<bool?, bool?>> e = (a) => null ?? a;
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS0853: An expression tree cannot contain named argument
+// Line: 15
+// Compiler options: -langversion:future
+
+using System;
+using System.Linq.Expressions;
+
+class M
+{
+ static void Named (int i)
+ {
+ }
+
+ public static void Main ()
+ {
+ Expression<Action> e = () => Named (i : 1);
+ }
+}
--- /dev/null
+// CS0854: An expression tree cannot contain an invocation which uses optional parameter
+// Line: 15
+
+using System;
+using System.Linq.Expressions;
+
+class M
+{
+ public M (string s = "value")
+ {
+ }
+
+ public static void Main ()
+ {
+ Expression<Action> e = () => new M ();
+ }
+}
--- /dev/null
+// CS0854: An expression tree cannot contain an invocation which uses optional parameter
+// Line: 15
+// Compiler options: -langversion:future
+
+using System;
+using System.Linq.Expressions;
+
+class M
+{
+ static void Optional (int i, string s = "value")
+ {
+ }
+
+ public static void Main ()
+ {
+ Expression<Action> e = () => Optional (1);
+ }
+}
--- /dev/null
+// cs1058.cs: A previous catch clause already catches all exceptions. All non-exceptions thrown will be wrapped in a `System.Runtime.CompilerServices.RuntimeWrappedException'
+// Line: 11
+// Compiler options: -warnaserror -warn:4
+
+class C
+{
+ static void Main()
+ {
+ try {}
+ catch (System.Exception) { }
+ catch {}
+ }
+}
+
--- /dev/null
+// gcs1058.cs: A previous catch clause already catches all exceptions. All non-exceptions thrown will be wrapped in a `System.Runtime.CompilerServices.RuntimeWrappedException'
+// Line: 15
+// Compiler options: -warnaserror -warn:4
+
+using System.Runtime.CompilerServices;
+
+[assembly: RuntimeCompatibility (WrapNonExceptionThrows=true)]
+
+class C
+{
+ static void Main()
+ {
+ try {}
+ catch (System.Exception) { }
+ catch {}
+ }
+}
--- /dev/null
+// CS1061: Type `X' does not contain a definition for `Test' and no extension method `Test' of type `X' could be found (are you missing a using directive or an assembly reference?)
+// Line: 12
+
+class A<X>
+{
+ //
+ // This is to test the lookup rules for SimpleNames:
+ // `X' is the type parameter, not the class.
+ //
+ public void Test (X x)
+ {
+ x.Test ();
+ }
+}
+
+class X
+{
+ public void Test ()
+ { }
+
+ public static void Main ()
+ { }
+}
--- /dev/null
+// CS1061: Type `int' does not contain a definition for `Value' and no extension method `Value' of type `int' could be found (are you missing a using directive or an assembly reference?)
+// Line: 24
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Test
+{
+ static class Ex
+ {
+ public static IEnumerable<TR> Foo<T, TR> (this IEnumerable<T> t, Func<T, TR> f)
+ {
+ return null;
+ }
+ }
+
+ public class C
+ {
+ public static void Main ()
+ {
+ int[] i = null;
+ int p;
+ var prods = from pe in i.Foo (p9 => p.Value) select pe;
+ }
+ }
+}
--- /dev/null
+// CS1061: Type `T' does not contain a definition for `Name' and no extension method `Name' of type `T' could be found (are you missing a using directive or an assembly reference?)
+// Line: 11
+
+using System;
+using System.Collections.Generic;
+
+public class C<T, U>
+{
+ public C (IEnumerable<T> t)
+ {
+ new List<T>(t).ConvertAll(p => p.Name);
+ }
+}
--- /dev/null
+// CS1061: Type `int' does not contain a definition for `Foo' and no extension method `Foo' of type `int' could be found (are you missing a using directive or an assembly reference?)
+// Line: 9
+
+
+public class M
+{
+ public static void Main ()
+ {
+ 1.Foo ("foo");
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS1061: Type `string' does not contain a definition for `Length2' and no extension method `Length2' of type `string' could be found (are you missing a using directive or an assembly reference?)
+// Line: 12
+
+
+using System.Linq;
+
+public class M
+{
+ public static void Main ()
+ {
+ var e = from values in new [] { "value" }
+ let length = values.Length2
+ select length;
+ }
+}
--- /dev/null
+// CS1061: Type `int' does not contain a definition for `E' and no extension method `E' of type `int' could be found (are you missing a using directive or an assembly reference?)
+// Line: 7
+
+class T {
+ public static int Main (string [] args )
+ {
+ int x = 1.E;
+ return 0;
+ }
+}
--- /dev/null
+// CS1067: Partial declarations of `I<T>' must have the same type parameter variance modifiers
+// Line: 8
+
+partial interface I<in T>
+{
+}
+
+partial interface I<out T>
+{
+}
--- /dev/null
+// CS1100: The parameter modifier `this' can only be used on the first parameter
+// Line: 6
+
+static class S
+{
+ static void Foo (bool b, this string s)
+ {
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS1101: The parameter modifiers `this' and `ref' cannot be used altogether
+// Line: 6
+
+static class S
+{
+ static void Foo (ref this string s)
+ {
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS1102: The parameter modifiers `this' and `out' cannot be used altogether
+// Line: 6
+
+static class S
+{
+ static void Foo (this out string s)
+ {
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS1103: The extension method cannot be of type `int*'
+// Line: 7
+// Compiler options: -unsafe
+
+static class S
+{
+ unsafe static void Foo (this int* iptr)
+ {
+ }
+}
--- /dev/null
+// CS1104: The parameter modifiers `this' and `params' cannot be used altogether
+// Line: 6
+
+static class S
+{
+ static void Foo (params this int[] o)
+ {
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS1105: `S.Foo(this int?)': Extension methods must be declared static
+// Line: 6
+
+
+static class S
+{
+ void Foo (this int? s)
+ {
+ }
+}
--- /dev/null
+// CS1106: `S<T>.Foo(this string)': Extension methods must be defined in a non-generic static class
+// Line: 6
+
+
+static class S<T>
+{
+ static void Foo (this string s)
+ {
+ }
+}
--- /dev/null
+// CS1106: `S.Foo(this string)': Extension methods must be defined in a non-generic static class
+// Line: 6
+
+
+class S
+{
+ static void Foo (this string s)
+ {
+ }
+}
--- /dev/null
+// CS1109: `C.S.Foo(this string)': Extension methods cannot be defined in a nested class
+// Line: 8
+
+
+class C
+{
+ static class S
+ {
+ static void Foo (this string s)
+ {
+ }
+ }
+}
--- /dev/null
+// CS1110: `C.Foo(this string)': Extension methods cannot be declared without a reference to System.Core.dll assembly. Add the assembly reference or remove `this' modifer from the first parameter
+// Line: 7
+// Compiler options: -noconfig
+
+static class C
+{
+ static void Foo (this string s)
+ {
+ }
+}
--- /dev/null
+// CS1112: Do not use `System.Runtime.CompilerServices.ExtensionAttribute' directly. Use parameter modifier `this' instead
+// Line: 16
+
+
+using System;
+using System.Runtime.CompilerServices;
+
+namespace System.Runtime.CompilerServices
+{
+ public class ExtensionAttribute : Attribute
+ {
+ }
+}
+
+static class C
+{
+ [Extension]
+ static void Foo (this string s)
+ {
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS1112: Do not use `System.Runtime.CompilerServices.ExtensionAttribute' directly. Use parameter modifier `this' instead
+// Line: 7
+
+
+using System.Runtime.CompilerServices;
+
+[assembly: ExtensionAttribute]
--- /dev/null
+// CS1112: Do not use `System.Runtime.CompilerServices.ExtensionAttribute' directly. Use parameter modifier `this' instead
+// Line: 8
+
+
+using System.Runtime.CompilerServices;
+
+static class C
+{
+ [Extension]
+ static void Foo (this string s)
+ {
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS1113: Extension method `Extension.Foo(this S)' of value type `S' cannot be used to create delegates
+// Line: 11
+
+delegate void D ();
+
+public class C
+{
+ static void Main ()
+ {
+ S s = new S ();
+ D d = s.Foo;
+ }
+}
+
+public struct S
+{
+ public void Foo (int i)
+ {
+ }
+}
+
+public static class Extension
+{
+ public static void Foo (this S s) { }
+}
--- /dev/null
+// CS1113: Extension method `Extension.Foo(this S)' of value type `S' cannot be used to create delegates
+// Line: 12
+
+
+delegate void D ();
+
+public class C
+{
+ static void Main ()
+ {
+ S s = new S ();
+ D d = s.Foo;
+ }
+}
+
+public struct S
+{
+}
+
+public static class Extension
+{
+ public static void Foo (this S s) { }
+}
--- /dev/null
+// CS1501: No overload for method `Foo' takes `2' arguments
+// Line: 17
+
+
+static class Extensions
+{
+ public static string Foo (this string s)
+ {
+ return s;
+ }
+}
+
+public class M
+{
+ public static void Main ()
+ {
+ 1.Foo ("foo");
+ }
+}
--- /dev/null
+// CS1501: No overload for method `Select' takes `1' arguments
+// Line: 17
+
+
+using System;
+
+class TestA
+{
+ public string value;
+
+ public TestA (string value)
+ {
+ this.value = value;
+ }
+
+ public string Select (int i, Func<TestA, TestA> f)
+ {
+ return value;
+ }
+}
+
+public class M
+{
+ static void Main ()
+ {
+ var v = new TestA ("Oh yes");
+ string foo = from a in v select a;
+ }
+}
--- /dev/null
+// CS1501: No overload for method `Foo' takes `0' arguments
+// Line: 15
+
+class Base<T>
+{
+ protected virtual void Foo<U> (U u)
+ {
+ }
+}
+
+class Derived<T> : Base<int>
+{
+ protected override void Foo<U> (U u)
+ {
+ base.Foo ();
+ }
+}
--- /dev/null
+// CS1501: No overload for method `Test' takes `2' arguments
+// Line: 16
+// Compiler options: -langversion:future
+
+static class S
+{
+ public static int Test (this int value)
+ {
+ return value;
+ }
+}
+
+class M
+{
+ public static void Main ()
+ {
+ 1.Test (value: 1);
+ }
+}
--- /dev/null
+// CS1502: The best overloaded method match for `Global.Test1(int?)' has some invalid arguments
+// Line: 8
+
+using System;
+
+class Global {
+ static void Main() {
+ Console.Write(Test1((decimal?)2));
+ }
+ static string Test1(int? value) {
+ return "ok";
+ }
+}
--- /dev/null
+// cs1502-3.cs: The best overloaded method match for `T.Blah(out int)' has some invalid arguments
+// Line: 11
+
+using System;
+
+class T {
+ static void Blah (out int g) { g = 0; }
+
+ static int Main (string [] args) {
+ IntPtr g;
+ Blah (out g);
+ return (int) g;
+ }
+}
--- /dev/null
+// CS1502: The best overloaded method match for `A.A(System.Collections.Generic.IList<int>[])' has some invalid arguments
+// Line: 40
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+public struct MyStruct : IList<int>
+{
+ public int this [int x] { get { return 0; } set { return; } }
+ public int IndexOf (int x) { return 0; }
+ public void Insert (int x, int y) { return; }
+ public void RemoveAt (int x) { return; }
+ public int Count { get { return 0; } }
+ public bool IsReadOnly { get { return false; } }
+ public void Add (int x) { return; }
+ public void Clear () { return; }
+ public bool Contains (int x) { return false; }
+ public void CopyTo (int[] x, int y) { return; }
+ public bool Remove (int x) { return false; }
+ public IEnumerator<int> GetEnumerator() { yield return 0; }
+ IEnumerator IEnumerable.GetEnumerator() { yield return 0; }
+}
+
+public class A
+{
+ // This version does not compile:
+ public A(IList<int>[] x) { }
+
+ // This version compiles fine, but results in an exception:
+ public A(IList<IList<int>> x) { }
+}
+
+public class Test
+{
+ static void Main ()
+ {
+ MyStruct[] myStructArray = new MyStruct[1];
+
+ Console.WriteLine ("Trying to construct an A...");
+ A a = new A (myStructArray);
+ Console.WriteLine ("success!");
+ }
+}
--- /dev/null
+// CS1503: Argument `#1' cannot convert `bool' expression to type `int[]'
+// Line: 13
+
+public class X
+{
+ public static void Test (params int[] a)
+ {
+ }
+
+ public static void Main()
+ {
+ int i;
+ Test (true);
+ }
+}
--- /dev/null
+// CS1503: Argument `#1' cannot convert `bool' expression to type `int'
+// Line: 12
+
+public class C
+{
+ static void Foo<T>(T t)
+ {
+ }
+
+ public static void Main ()
+ {
+ Foo<int> (true);
+ }
+}
--- /dev/null
+// CS1521: Invalid base type `C?'
+// Line: 8
+
+struct C
+{
+}
+
+class C2: C?
+{
+}
+
--- /dev/null
+// CS1525: Unexpected symbol `<', expecting `,' or `>'
+// Line: 9
+
+interface IFoo<T>
+{
+}
+
+public class Bar {
+ public void GetItemCommand<IFoo<int>>()
+ {
+ }
+}
--- /dev/null
+// CS1525: Unexpected symbol `>', expecting `[', `identifier', `in', or `out'
+// Line: 4
+
+public class C<>
+{
+}
--- /dev/null
+// CS1525: Unexpected symbol `='
+// Line: 10
+
+public class Test
+{
+ private string name;
+
+ public string Name
+ {
+ get { return name ?? name = string.Empty; }
+ }
+}
--- /dev/null
+// CS1547: Keyword `void' cannot be used in this context
+// Line: 10
+class Foo<T>
+{ }
+
+class X
+{
+ static void Main ()
+ {
+ Foo<void> foo;
+ }
+}
--- /dev/null
+// CS1547: Keyword `void' cannot be used in this context
+// Line: 8
+
+class X
+{
+ static void Main ()
+ {
+ object o = default(void);
+ }
+}
--- /dev/null
+// CS1547: Keyword `void' cannot be used in this context
+// Line: 8
+
+
+class X
+{
+ static void Main ()
+ {
+ var e = from void v in new int [] { 0 } select i;
+ }
+}
--- /dev/null
+// CS1579: foreach statement cannot operate on variables of type `Foo' because it does not contain a definition for `GetEnumerator' or is inaccessible
+// Line: 12
+
+using System;
+using System.Collections;
+
+public class Test
+{
+ public static void Main ()
+ {
+ Foo f = new Foo ();
+ foreach (object o in f)
+ Console.WriteLine (o);
+ }
+}
+
+public class Foo
+{
+ public Func<IEnumerator> GetEnumerator;
+}
--- /dev/null
+// CS1593: Delegate `System.Func<int,int>' does not take `2' arguments
+// Line: 11
+
+
+using System;
+
+class C
+{
+ static void Main (string [] args)
+ {
+ M ((x, y) => 2);
+ }
+
+ static void M (Func<int, int> a)
+ {
+ }
+}
--- /dev/null
+// CS1624: The body of `C.Test<TSource>(System.Collections.Generic.IEnumerable<TSource>)' cannot be an iterator block because `TSource' is not an iterator interface type
+// Line: 8
+
+using System.Collections.Generic;
+
+public class C
+{
+ public static TSource Test<TSource>(IEnumerable<TSource> source)
+ {
+ foreach (TSource element in source)
+ yield return element;
+ }
+}
--- /dev/null
+// CS1640: foreach statement cannot operate on variables of type `T' because it contains multiple implementation of `System.Collections.Generic.IEnumerable<T>'. Try casting to a specific implementation
+// Line: 11
+
+using System.Collections.Generic;
+
+public class C
+{
+ public static void Test<T>(T t)
+ where T: IEnumerable<string>, IEnumerable<int>
+ {
+ foreach (int i in t)
+ {
+ }
+ }
+}
--- /dev/null
+// cs1642.cs: `C.test_1': Fixed size buffer fields may only be members of structs
+// Line: 7
+// Compiler options: -unsafe
+
+public unsafe class C
+{
+ private fixed char test_1 [128];
+}
--- /dev/null
+// CS1644: Feature `generic type variance' cannot be used because it is not part of the C# 2.0 language specification
+// Line: 5
+// Compiler options: -langversion:iso-2
+
+ public interface IFoo<out T> {
+ }
--- /dev/null
+// CS1644: Feature `generic type variance' cannot be used because it is not part of the C# 2.0 language specification
+// Line: 5
+// Compiler options: -langversion:iso-2
+
+ public interface IFoo<in T> {
+ }
--- /dev/null
+// CS1644: Feature `generic type variance' cannot be used because it is not part of the C# 3.0 language specification
+// Line: 5
+// Compiler options: -langversion:3
+
+public interface IFoo<in T>
+{
+}
--- /dev/null
+// CS1644: Feature `query expressions' cannot be used because it is not part of the C# 2.0 language specification
+// Line: 11
+// Compiler options: -langversion:ISO-2
+
+using System.Linq;
+
+public class C
+{
+ public static void Main ()
+ {
+ var e = from a in "aaa" select a;
+ }
+}
--- /dev/null
+// CS1644: Feature `automatically implemented properties' cannot be used because it is not part of the C# 2.0 language specification
+// Line: 7
+// Compiler options: -langversion:ISO-2
+
+class P
+{
+ public string Name { get; set; }
+}
--- /dev/null
+// CS1644: Feature `nullable types' cannot be used because it is not part of the C# 1.0 language specification
+// Line: 7
+// Compiler options: -langversion:ISO-1
+
+class Test
+{
+ int? i;
+ static void Main () {}
+}
--- /dev/null
+// CS1644: Feature `default value expression' cannot be used because it is not part of the C# 1.0 language specification
+// Line: 7
+// Compiler options: -langversion:ISO-1
+
+class Test
+{
+ int i = default (int);
+}
--- /dev/null
+// CS1644: Feature `generics' cannot be used because it is not part of the C# 1.0 language specification
+// Line: 5
+// Compiler options: -langversion:ISO-1
+
+class Stack < type >
+{
+}
+
--- /dev/null
+// CS1644: Feature `lambda expressions' cannot be used because it is not part of the C# 2.0 language specification
+// Line: 11
+// Compiler options: -langversion:ISO-2
+
+class C
+{
+ delegate void D ();
+
+ public void Foo ()
+ {
+ D e = () => { };
+ }
+}
+
--- /dev/null
+// CS1644: Feature `nullable types' cannot be used because it is not part of the C# 1.0 language specification
+// Line: 9
+// Compiler options: -langversion:ISO-1
+
+struct C
+{
+ void G ()
+ {
+ object o = (C?[]) this;
+ }
+}
--- /dev/null
+// CS1644: Feature `object initializers' cannot be used because it is not part of the C# 2.0 language specification
+// Line: 14
+// Compiler options: -langversion:ISO-2
+
+class Data
+{
+ public int Value;
+}
+
+class A
+{
+ void Foo ()
+ {
+ new Data () { Value = 3 };
+ }
+}
--- /dev/null
+// CS1644: Feature `implicitly typed arrays' cannot be used because it is not part of the C# 1.0 language specification
+// Line: 7
+// Compiler options: -langversion:ISO-1
+
+class A
+{
+ string[] array = new [] { "Foo", "Bar", "Baz" };
+}
--- /dev/null
+// CS1644: Feature `partial methods' cannot be used because it is not part of the C# 2.0 language specification
+// Line: 7
+// Compiler options: -langversion:ISO-2
+
+partial class P
+{
+ partial void Foo ();
+}
--- /dev/null
+// CS1644: Feature `extension methods' cannot be used because it is not part of the C# 2.0 language specification
+// Line: 17
+// Compiler options: -langversion:ISO-2
+
+static class Extensions
+{
+ static string Foo (string s, this bool b, int i)
+ {
+ return s;
+ }
+}
--- /dev/null
+// cs1644.cs: Feature `generics' cannot be used because it is not part of the C# 1.0 language specification
+// Line: 5
+// Compiler options: -langversion:ISO-1
+
+class X<V>
+{
+}
+
+class X
+{
+ static void Main ()
+ { }
+}
--- /dev/null
+// CS1644: Feature `anonymous types' cannot be used because it is not part of the C# 1.0 language specification
+// Line: 9
+// Compiler options: -langversion:ISO-1
+
+class A
+{
+ void Foo ()
+ {
+ var v = new { X = "Bar" };
+ }
+}
--- /dev/null
+// CS1644: Feature `collection initializers' cannot be used because it is not part of the C# 2.0 language specification
+// Line: 9
+// Compiler options: -langversion:ISO-2
+
+using System.Collections.Generic;
+
+class A
+{
+ void Foo ()
+ {
+ object o = new List<int> { 1, 2, 3 };
+ }
+}
--- /dev/null
+// CS1660: Cannot convert `lambda expression' to non-delegate type `object'
+// Line: 9
+
+using System;
+
+class X {
+ static void Main ()
+ {
+ object o = () => true;
+ }
+}
--- /dev/null
+// CS1661: Cannot convert `lambda expression' to delegate type `C.WithOutParam' since there is a parameter mismatch
+// Line: 10
+
+
+class C
+{
+ delegate void WithOutParam (out string value);
+
+ static void Main()
+ {
+ WithOutParam o = (string l) => { return; };
+ }
+}
--- /dev/null
+// CS1662: Cannot convert `lambda expression' to delegate type `D' because some of the return types in the block are not implicitly convertible to the delegate return type
+// Line: 13
+
+
+using System;
+
+delegate int D (int i);
+
+class X
+{
+ static void Main ()
+ {
+ D d = (int l) => Main ();
+ }
+}
--- /dev/null
+// cs1663.cs: `S.test': Fixed size buffers type must be one of the following: bool, byte, short, int, long, char, sbyte, ushort, uint, ulong, float or double
+// Line: 6
+
+public struct S
+{
+ public fixed decimal test [4];
+}
--- /dev/null
+// cs1664.cs: Fixed size buffer `C.test_1' of length `1073741825' and type `long' exceeded 2^31 limit
+// Line: 7
+// Compiler options: -unsafe
+
+public unsafe struct C
+{
+ private fixed long test_1 [1073741825];
+}
--- /dev/null
+// cs1665.cs: `S.test20': Fixed size buffers must have a length greater than zero
+// Line: 7
+// Compiler options: -unsafe
+
+public unsafe struct S
+{
+ public fixed bool test20 [-4];
+}
--- /dev/null
+// cs1666.cs: You cannot use fixed size buffers contained in unfixed expressions. Try using the fixed statement
+// Line: 11
+// Compiler options: -unsafe
+
+public unsafe struct S
+{
+ fixed char test_1 [128];
+
+ public void Test ()
+ {
+ test_1 [55] = 'g';
+ }
+}
--- /dev/null
+// CS1675: Enums cannot have type parameters
+// Line: 4
+
+enum E<T>
+{
+}
--- /dev/null
+// CS1676: Parameter `1' must be declared with the `out' keyword
+// Line: 10
+
+class C
+{
+ delegate int D (out int i);
+
+ public static void Main ()
+ {
+ D d = a => 1;
+ }
+}
--- /dev/null
+// CS1677: Parameter `1' should not be declared with the `ref' keyword
+// Line: 9
+
+
+delegate void D (int x);
+
+class X
+{
+ static void Main ()
+ {
+ D d2 = (ref int x) => {};
+ }
+}
--- /dev/null
+// CS1685: The predefined type `System.Runtime.CompilerServices.ExtensionAttribute' is defined in multiple assemblies. Using definition from `System.Core'
+// Line: 0
+// Compiler options: -warn:1 -warnaserror -r:System.Core.dll -r:CS1685-2-lib.dll
+
--- /dev/null
+// CS1686: Local variable or parameter `str' cannot have their address taken and be used inside an anonymous method or lambda expression
+// Line: 11
+// Compiler options: -unsafe
+
+using System;
+
+unsafe struct S
+{
+ public fixed int i [10];
+}
+
+class C
+{
+ static void Main ()
+ {
+ unsafe {
+ S str;
+ Func<int> e = () => str.i [3];
+ }
+ }
+}
--- /dev/null
+// cs1689.cs: Attribute `System.Diagnostics.ConditionalAttribute' is only valid on methods or attribute classes
+// Line: 6
+
+using System.Diagnostics;
+
+[Conditional("DEBUG")]
+public class Test {}
+
\ No newline at end of file
--- /dev/null
+// gcs1700.cs: Assembly reference `MyAssemblyName, Version=' is invalid and cannot be resolved
+// Line: 8
+// Compiler options: -warnaserror -warn:3
+
+using System;
+using System.Runtime.CompilerServices;
+
+[assembly: InternalsVisibleTo ("MyAssemblyName, Version=")]
+
+public class InternalsVisibleToTest
+{
+ static void Main ()
+ {
+ }
+
+}
+
--- /dev/null
+// CS1708: `S.array': Fixed size buffers can only be accessed through locals or fields
+// Line: 27
+// Compiler options: -unsafe
+
+using System;
+
+unsafe struct S
+{
+ public fixed int array [2];
+}
+
+class C
+{
+ unsafe public S Get ()
+ {
+ return new S ();
+ }
+}
+
+public class Tester
+{
+ public static void Main() { }
+
+ unsafe void setName()
+ {
+ C c = new C();
+ c.Get ().array [1] = 44;
+ }
+}
+
--- /dev/null
+// cs1716.cs: Do not use 'System.Runtime.CompilerServices.FixedBuffer' attribute. Use the 'fixed' field modifier instead
+// Line: 6
+
+public class C
+{
+ [System.Runtime.CompilerServices.FixedBuffer (typeof (int), 1)]
+ public int i;
+}
\ No newline at end of file
--- /dev/null
+// CS1718: A comparison made to same variable. Did you mean to compare something else?
+// Line: 10
+// Compiler options: -warnaserror -warn:3
+
+class C
+{
+ public static void Main ()
+ {
+ int? a = 20;
+ if (a > a) {
+ return;
+ }
+ }
+}
+
--- /dev/null
+// CS1720: Expression will always cause a `System.NullReferenceException'
+// Line: 9
+// Compiler options: -warnaserror -warn:1
+
+public class Tester
+{
+ public static void GenericClass<T>(T t) where T : class
+ {
+ string s = default(T).ToString();
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS1720: Expression will always cause a `System.NullReferenceException'
+// Line: 11
+// Compiler options: -warnaserror -warn:1
+
+using System;
+
+public class Tester
+{
+ public static void Foo ()
+ {
+ Console.WriteLine(default(Tester).ToString());
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS1724: Value specified for the argument to `System.Runtime.InteropServices.DefaultCharSetAttribute' is not valid
+// Line: 7
+
+using System;
+using System.Runtime.InteropServices;
+
+[module: DefaultCharSet ((CharSet)30)]
--- /dev/null
+// gcs1726-2.cs: Friend assembly reference `MyAssemblyName, PublicKeyToken=43b5d2e9a794bdcb' is invalid. Strong named assemblies must specify a public key in their InternalsVisibleTo declarations
+// Line: 8
+// Compiler options: -keyfile:InternalsVisibleTest.snk
+
+using System;
+using System.Runtime.CompilerServices;
+
+[assembly: InternalsVisibleTo ("MyAssemblyName, PublicKeyToken=43b5d2e9a794bdcb")]
+
+public class Test
+{
+ static void Main ()
+ {
+ }
+}
+
--- /dev/null
+// gcs1726.cs: Friend assembly reference `MyAssemblyName' is invalid. Strong named assemblies must specify a public key in their InternalsVisibleTo declarations
+// Line: 8
+// Compiler options: -keyfile:InternalsVisibleTest.snk
+
+using System;
+using System.Runtime.CompilerServices;
+
+[assembly: InternalsVisibleTo ("MyAssemblyName")]
+
+public class Test
+{
+ static void Main ()
+ {
+ }
+}
+
--- /dev/null
+// CS1728: Cannot create delegate from method `long?.GetValueOrDefault()' because it is a member of System.Nullable<T> type
+// Line: 10
+
+using System;
+
+class C
+{
+ public static void Main ()
+ {
+ Func<long> a = new long?().GetValueOrDefault;
+ }
+}
--- /dev/null
+// CS1728: Cannot create delegate from method `int?.GetValueOrDefault()' because it is a member of System.Nullable<T> type
+// Line: 14
+
+using System;
+
+class C
+{
+ delegate int Test ();
+ event Test MyEvent;
+
+ void Error ()
+ {
+ int? i = 0;
+ MyEvent += new Test (i.GetValueOrDefault);
+ }
+}
--- /dev/null
+// CS1744: Named argument `a' cannot be used for a parameter which has positional argument specified
+// Line: 13
+// Compiler options: -langversion:future
+
+static class C
+{
+ public static int Test (this int a, int b)
+ {
+ return a * 3 + b;
+ }
+
+ public static void Main ()
+ {
+ 1.Test (a : 2);
+ }
+}
--- /dev/null
+// CS1745: Cannot specify `System.Runtime.InteropServices.DefaultParameterValue' attribute on optional parameter `u'
+// Line: 8
+// Compiler options: -langversion:future
+
+using System.Runtime.InteropServices;
+
+public class C
+{
+ public static void Test ([DefaultParameterValue (1)] int u = 2)
+ {
+ }
+}
--- /dev/null
+// CS1750: Optional parameter expression of type `decimal' cannot be converted to parameter type `int?'
+// Line: 6
+
+public class TS
+{
+ public static void Test (int? i = 1m)
+ {
+ }
+}
--- /dev/null
+// CS1770: The expression being assigned to nullable optional parameter `d' must be default value
+// Line: 8
+
+using System;
+
+class C
+{
+ public static void Foo (DateTime? d = new DateTime ())
+ {
+ }
+}
--- /dev/null
+// gcs1908.cs: The type of the default value should match the type of the parameter
+// Line:
+
+class Test {
+ internal void f ([System.Runtime.InteropServices.DefaultParameterValue (null)] short x)
+ {
+ }
+}
--- /dev/null
+// gcs1908.cs: The type of the default value should match the type of the parameter
+// Line:
+
+class Test<T> where T : class {
+ internal void f ([System.Runtime.InteropServices.DefaultParameterValue (null)] T x)
+ {
+ }
+}
--- /dev/null
+// gcs1908.cs: The type of the default value should match the type of the parameter
+// Line:
+
+class Test {
+ internal void f ([System.Runtime.InteropServices.DefaultParameterValue ((short) 1)] int x)
+ {
+ }
+}
--- /dev/null
+// gcs1908.cs: The type of the default value should match the type of the parameter
+// Line: 5
+
+class Test {
+ internal void f ([System.Runtime.InteropServices.DefaultParameterValue (1)] short x)
+ {
+ }
+}
--- /dev/null
+// CS1909: The DefaultParameterValue attribute is not applicable on parameters of type `System.Type'
+// Line: 7
+
+using System.Runtime.InteropServices;
+
+interface ITest {
+ void f ([DefaultParameterValue (typeof (ITest))] System.Type x);
+}
--- /dev/null
+// CS1909: The DefaultParameterValue attribute is not applicable on parameters of type `int[]'
+// Line: 7
+
+using System.Runtime.InteropServices;
+
+class Test {
+ void f ([DefaultParameterValue (new int[0])] int[] x)
+ {
+ }
+}
--- /dev/null
+// CS1910: Argument of type `int[]' is not applicable for the DefaultParameterValue attribute
+// Line: 7
+
+using System.Runtime.InteropServices;
+using System;
+
+class Test {
+ void f ([DefaultParameterValue (new int[0])] object x)
+ {
+ }
+}
--- /dev/null
+// CS1910: Argument of type `System.Type' is not applicable for the DefaultParameterValue attribute
+// Line: 7
+
+using System.Runtime.InteropServices;
+
+class Test {
+ void f ([DefaultParameterValue (typeof (object))] object x)
+ {
+ }
+}
--- /dev/null
+// CS1912: An object initializer includes more than one member `Count' initialization
+// Line: 17
+
+
+using System;
+using System.Collections.Generic;
+
+public class Test
+{
+ class Container
+ {
+ public int Count;
+ }
+
+ static void Main ()
+ {
+ var c = new Container { Count = 1, Count = 10 };
+ }
+}
--- /dev/null
+// CS1913: Member `Data.Count()' cannot be initialized. An object initializer may only be used for fields, or properties
+// Line: 17
+
+
+using System;
+using System.Collections.Generic;
+
+class Data
+{
+ public int Count ()
+ {
+ return 1;
+ }
+}
+
+public class Test
+{
+ static void Main ()
+ {
+ var c = new Data { Count = 10 };
+ }
+}
--- /dev/null
+// CS1913: Member `Data.Count' cannot be initialized. An object initializer may only be used for fields, or properties
+// Line: 17
+
+
+using System;
+using System.Collections.Generic;
+
+class Data
+{
+ public delegate int Count ();
+}
+
+public class Test
+{
+ delegate void S ();
+
+ static void Main ()
+ {
+ //S s = new S ();
+ //string drawBackLabel = string.Length("absDrawBack");
+ var c = new Data { Count = 10 };
+ }
+}
--- /dev/null
+// CS1914: Static field or property `Data.Count' cannot be assigned in an object initializer
+// Line: 17
+
+
+using System;
+using System.Collections.Generic;
+
+class Data
+{
+ public static int Count;
+}
+
+public class Test
+{
+ static void Main ()
+ {
+ var c = new Data { Count = 10 };
+ }
+}
--- /dev/null
+// CS1918: Members of value type `S' cannot be assigned using a property `C.Value' object initializer
+// Line: 18
+
+
+struct S
+{
+ public int X;
+}
+
+class C
+{
+ public S Value {
+ set { }
+ }
+
+ static void Main ()
+ {
+ C c = new C { Value = { X = 2 } };
+ }
+}
--- /dev/null
+// CS1920: An element initializer cannot be empty
+// Line: 11
+
+
+using System.Collections.Generic;
+
+public class Test
+{
+ static void Main ()
+ {
+ var d = new Dictionary <string, int> { { } };
+ }
+}
--- /dev/null
+// CS1922: A field or property `System.Type' cannot be initialized with a collection object initializer because type `System.Type' does not implement `System.Collections.IEnumerable' interface
+// Line: 13
+
+using System;
+using System.Xml.Serialization;
+
+namespace test
+{
+ public class Test
+ {
+ static void Main ()
+ {
+ XmlSerializer xs = new XmlSerializer (typeof (string), new Type () { typeof (bool) });
+ }
+ }
+}
+
--- /dev/null
+// CS1922: A field or property `Data.Value' cannot be initialized with a collection object initializer because type `int' does not implement `System.Collections.IEnumerable' interface
+// Line: 16
+
+
+using System;
+
+class Data
+{
+ public int Value;
+}
+
+public class Test
+{
+ static void Main ()
+ {
+ var c = new Data { Value = { 0, 1, 2 } };
+ }
+}
--- /dev/null
+// CS1925: Cannot initialize object of type `string[]' with a collection initializer
+// Line: 10
+
+class C
+{
+ string[] values;
+
+ static void Main ()
+ {
+ var v = new C { values = { "a" } };
+ }
+}
--- /dev/null
+// CS1928: Type `System.Collections.IList' does not contain a member `Frobnicate' and the best extension method overload `Extensions.Frobnicate<Test>(this Test)' has some invalid arguments
+// Line: 20
+
+using System;
+using System.Collections;
+
+static class Extensions
+{
+ public static void Frobnicate<T> (this T foo) where T : IList
+ {
+ }
+}
+
+public class Test
+{
+ IList mFoo;
+
+ void Frobnicate ()
+ {
+ mFoo.Frobnicate<Test> ();
+ }
+}
--- /dev/null
+// CS1928: Type `int' does not contain a member `Foo' and the best extension method overload `S.Foo(this uint)' has some invalid arguments
+// Line: 15
+
+static class S
+{
+ public static void Foo (this uint i)
+ {
+ }
+}
+
+class B
+{
+ static void Main ()
+ {
+ 55.Foo ();
+ }
+}
--- /dev/null
+// CS1928: Type `string' does not contain a member `Check' and the best extension method overload `C.Check(this string, int)' has some invalid arguments
+// Line: 12
+
+static class C
+{
+ public static void Check (this string s, int i)
+ {
+ }
+
+ static void Main ()
+ {
+ "alo".Check ("o");
+ }
+}
--- /dev/null
+// CS1929: Extension method instance type `int' cannot be converted to `string'
+// Line: 12
+
+static class C
+{
+ public static void Check (this string s)
+ {
+ }
+
+ static void Main ()
+ {
+ 1.Check ();
+ }
+}
--- /dev/null
+// CS1930: A range variable `i' has already been declared in this scope
+// Line: 14
+
+
+using System;
+using System.Linq;
+
+class C
+{
+ public static void Main ()
+ {
+ var e = from v in "a"
+ let i = 1
+ let i = 2
+ select v;
+ }
+}
--- /dev/null
+// CS1930: A range variable `v' has already been declared in this scope
+// Line: 13
+
+
+using System;
+using System.Linq;
+
+class C
+{
+ public static void Main ()
+ {
+ var e = from v in "a"
+ let v = 1
+ select v;
+ }
+}
--- /dev/null
+// CS1931: A range variable `i' conflicts with a previous declaration of `i'
+// Line: 13
+
+
+using System;
+using System.Linq;
+
+class C
+{
+ public void Foo (int i)
+ {
+ var e = from v in "a"
+ let i = 2
+ select v;
+ }
+}
--- /dev/null
+// CS1931: A range variable `ii' conflicts with a previous declaration of `ii'
+// Line: 14
+
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+class Test
+{
+ public static void Main ()
+ {
+ int[] int_array = null;
+ int ii = 0;
+ IEnumerable<int> e = from int ii in int_array select "1";
+ }
+}
--- /dev/null
+// CS1931: A range variable `i' conflicts with a previous declaration of `i'
+// Line: 12
+
+using System;
+using System.Linq;
+
+class C
+{
+ public static void Main ()
+ {
+ int i = 9;
+ var e = from i in "a"
+ select 1;
+ }
+}
--- /dev/null
+// CS1931: A range variable `i' conflicts with a previous declaration of `i'
+// Line: 14
+
+
+using System;
+using System.Linq;
+
+class C
+{
+ public static void Main ()
+ {
+ int i = 9;
+ var e = from v in "a"
+ let i = 2
+ select v;
+ }
+}
--- /dev/null
+// CS1932: A range variable `ii' cannot be initialized with `method group'
+// Line: 12
+
+using System;
+using System.Linq;
+
+class C
+{
+ public void Foo (int i)
+ {
+ var e = from v in "a"
+ let ii = Foo
+ select v;
+ }
+}
--- /dev/null
+// CS1932: A range variable `ii' cannot be initialized with `void'
+// Line: 13
+
+
+using System;
+using System.Linq;
+
+class C
+{
+ public void Foo (int i)
+ {
+ var e = from v in "a"
+ let ii = Foo (2)
+ select v;
+ }
+}
--- /dev/null
+// CS1935: An implementation of `Cast' query expression pattern could not be found. Are you missing `System.Linq' using directive or `System.Core.dll' assembly reference?
+// Line: 12
+
+
+public class Test
+{
+ class Enumerable {}
+
+ static void Main ()
+ {
+ var v = new int[0];
+ var foo = from int a in v where a > 0 select a;
+ }
+}
--- /dev/null
+// CS1935: An implementation of `Select' query expression pattern could not be found. Are you missing `System.Linq' using directive or `System.Core.dll' assembly reference?
+// Line: 10
+
+
+public class Test
+{
+ static void Main ()
+ {
+ var v = new int[0];
+ var foo = from a in v select a;
+ }
+}
--- /dev/null
+// CS1936: An implementation of `Select' query expression pattern for source type `Item' could not be found
+// Line: 16
+
+
+using System.Linq;
+
+class Item
+{
+}
+
+public static class Test
+{
+ static void Main ()
+ {
+ var v = new Item ();
+ var foo = from a in v select a;
+ }
+}
--- /dev/null
+// CS1930: A range variable `v' may not be passes as `ref' or `out' parameter
+// Line: 19
+
+
+using System;
+using System.Linq;
+
+class C
+{
+ static int Foo (ref int value)
+ {
+ return 1;
+ }
+
+ public static void Main ()
+ {
+ var e = from v in "a"
+ let r = 1
+ select Foo (ref v);
+ }
+}
--- /dev/null
+// CS1940: Ambiguous implementation of the query pattern `Select' for source type `Multiple'
+// Line: 10
+
+class Multiple
+{
+ delegate int D1 (int x);
+ delegate int D2 (int x);
+
+ int Select (D1 d)
+ {
+ return 0;
+ }
+
+ int Select (D2 d)
+ {
+ return 1;
+ }
+
+ public static void Main ()
+ {
+ var q = from x in new Multiple () select x;
+ }
+}
--- /dev/null
+// CS1942: An expression type in `select' clause is incorrect. Type inference failed in the call to `Select'
+// Line: 18
+
+using System;
+
+class TestA
+{
+ public string Select<U> (Func<TestA, U> f)
+ {
+ return "";
+ }
+}
+
+public class C
+{
+ static void Main ()
+ {
+ string foo = from a in new TestA () select null;
+ }
+}
--- /dev/null
+// CS1942: An expression type in `select' clause is incorrect. Type inference failed in the call to `Select'
+// Line: 12
+
+using System;
+using System.Linq;
+
+class C
+{
+ public static void Main ()
+ {
+ var e = from values in "abcd"
+ select null;
+ }
+}
--- /dev/null
+// CS1943: An expression type is incorrect in a subsequent `from' clause in a query expression with source type `string'
+// Line: 11
+
+using System.Linq;
+
+class Test
+{
+ static void Main ()
+ {
+ var e = from a in "abcd"
+ from b in new Test ()
+ select b;
+ }
+}
--- /dev/null
+// CS1944: An expression tree cannot contain an unsafe pointer operation
+// Line: 15
+// Compiler options: -unsafe
+
+using System;
+using System.Linq.Expressions;
+
+class C
+{
+ unsafe delegate int* D (int i);
+
+ public static void Main ()
+ {
+ unsafe {
+ Expression<D> e = (int p) => &p;
+ }
+ }
+}
--- /dev/null
+// CS1944: An expression tree cannot contain an unsafe pointer operation
+// Line: 15
+// Compiler options: -unsafe
+
+using System;
+using System.Linq.Expressions;
+
+class C
+{
+ unsafe delegate int D (int* i);
+
+ public static void Main ()
+ {
+ unsafe {
+ Expression<D> e = p => *p;
+ }
+ }
+}
--- /dev/null
+// CS1944: An expression tree cannot contain an unsafe pointer operation
+// Line: 15
+// Compiler options: -unsafe
+
+using System;
+using System.Linq.Expressions;
+
+class C
+{
+ unsafe delegate int* D (int* i);
+
+ public static void Main ()
+ {
+ unsafe {
+ Expression<D> e = p => p + 1;
+ }
+ }
+}
--- /dev/null
+// CS1944: An expression tree cannot contain an unsafe pointer operation
+// Line: 13
+// Compiler options: -unsafe
+
+using System;
+using System.Linq.Expressions;
+
+class C
+{
+ public static void Main ()
+ {
+ unsafe {
+ Expression<Func<int>> e = () => sizeof (long*);
+ }
+ }
+}
--- /dev/null
+// CS1944: An expression tree cannot contain an unsafe pointer operation
+// Line: 14
+// Compiler options: -unsafe
+
+using System;
+using System.Linq.Expressions;
+
+class C
+{
+ unsafe delegate byte* D (int*[] d);
+ public static void Main ()
+ {
+ unsafe {
+ Expression<D> e6 = (p) => (byte*)p [10];
+ }
+ }
+}
--- /dev/null
+// CS1944: An expression tree cannot contain an unsafe pointer operation
+// Line: 15
+// Compiler options: -unsafe
+
+using System;
+using System.Linq.Expressions;
+
+class C
+{
+ unsafe delegate int* D ();
+
+ public static void Main ()
+ {
+ unsafe {
+ Expression<D> e = () => default (int*);
+ }
+ }
+}
--- /dev/null
+// CS1944: An expression tree cannot contain an unsafe pointer operation
+// Line: 14
+// Compiler options: -unsafe
+
+using System;
+using System.Linq.Expressions;
+
+class C
+{
+ public static void Main ()
+ {
+ unsafe {
+ int*[] p = null;
+ Expression<Func<int>> e6 = () => (int)p [10];
+ }
+ }
+}
--- /dev/null
+// CS1945: An expression tree cannot contain an anonymous method expression
+// Line: 11
+
+using System;
+using System.Linq.Expressions;
+
+class C
+{
+ public static void Main ()
+ {
+ Expression<Func<Func<int>>> e = () => delegate () { return 1; };
+ }
+}
--- /dev/null
+// CS1946: An anonymous method cannot be converted to an expression tree
+// Line: 11
+
+using System;
+using System.Linq.Expressions;
+
+class C
+{
+ delegate string D ();
+
+ public static void Main ()
+ {
+ Expression<D> e = delegate () { return "a"; };
+ }
+}
--- /dev/null
+// CS1947: A range variable `v' cannot be assigned to. Consider using `let' clause to store the value
+// Line: 15
+
+using System;
+using System.Linq;
+
+class Test
+{
+ public static int Main ()
+ {
+ int[] int_array = new int [] { 0, 1 };
+
+ var e = from int i in int_array
+ let v = true
+ where v = false
+ select v;
+ }
+}
--- /dev/null
+// CS1948: A range variable `T' conflicts with a method type parameter
+// Line: 13
+
+using System;
+using System.Linq;
+
+class C
+{
+ public static void Foo <T> ()
+ {
+ var s = "0";
+ var e = from T in "a"
+ select T + s;
+ }
+}
--- /dev/null
+// CS1948: A range variable `T' conflicts with a method type parameter
+// Line: 12
+
+
+using System;
+using System.Linq;
+
+class C
+{
+ public static void Foo <T> ()
+ {
+ var e = from T in "a"
+ select T;
+ }
+}
--- /dev/null
+// CS1954: The best overloaded collection initalizer method `Data.Add(__arglist)' has some invalid arguments
+// Line: 16
+
+
+using System;
+using System.Collections;
+
+class Data : IEnumerable
+{
+ public IEnumerator GetEnumerator () { return null; }
+
+ public void Add (__arglist)
+ {
+ }
+}
+
+public class Test
+{
+ static void Main ()
+ {
+ var c = new Data { 1 };
+ }
+}
--- /dev/null
+// CS1951: An expression tree parameter cannot use `ref' or `out' modifier
+// Line: 13
+
+using System;
+using System.Linq.Expressions;
+
+class C
+{
+ delegate int D (out int a);
+
+ public static void Main ()
+ {
+ Expression<D> e = (out int a) => a = 0;
+ }
+}
--- /dev/null
+// CS1951: An expression tree parameter cannot use `ref' or `out' modifier
+// Line: 13
+
+using System;
+using System.Linq.Expressions;
+
+class C
+{
+ delegate int D (ref int a);
+
+ public static void Main ()
+ {
+ Expression<D> e = (ref int a) => a;
+ }
+}
--- /dev/null
+// CS1952: An expression tree cannot contain a method with variable arguments
+// Line: 11
+
+using System;
+using System.Linq.Expressions;
+
+class C
+{
+ void Foo ()
+ {
+ Expression<Func<int>> e = () => InstanceArgList (__arglist (0));
+ }
+
+ int InstanceArgList (__arglist)
+ {
+ return 54;
+ }
+}
--- /dev/null
+// CS1953: An expression tree cannot contain an expression with method group
+// Line: 11
+
+using System;
+using System.Linq.Expressions;
+
+class C
+{
+ public static void Main ()
+ {
+ Expression<Func<bool>> e = () => "1".ToString is string;
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS1954: The best overloaded collection initalizer method `Data.Add(ref int)' cannot have 'ref', or `out' modifier
+// Line: 16
+
+
+using System;
+using System.Collections;
+
+class Data : IEnumerable
+{
+ public IEnumerator GetEnumerator () { return null; }
+
+ public void Add (ref int b)
+ {
+ }
+}
+
+public class Test
+{
+ static void Main ()
+ {
+ var c = new Data { 1 };
+ }
+}
--- /dev/null
+// CS1959: Type parameter `T' cannot be declared const
+// Line: 8
+
+struct S
+{
+ public void Foo<T> () where T : struct
+ {
+ const T t = null;
+ }
+}
--- /dev/null
+// CS1959: Type parameter `T' cannot be declared const
+// Line: 10
+
+class C
+{
+}
+
+class C<T> where T : C
+{
+ const T t = null;
+}
--- /dev/null
+// CS1960: Variant type parameters can only be used with interfaces and delegates
+// Line: 5
+// Compiler options: -langversion:future
+
+class A<in T>
+{
+}
--- /dev/null
+// CS1960: Variant type parameters can only be used with interfaces and delegates
+// Line: 5
+// Compiler options: -langversion:future
+
+class A<out T>
+{
+}
--- /dev/null
+// CS1961: The contravariant type parameter `T' must be invariantly valid on `B<T>()'
+// Line: 9
+// Compiler options: -langversion:future
+
+interface A<T>
+{
+}
+
+delegate A<A<T>> B<in T> ();
--- /dev/null
+// CS1961: The contravariant type parameter `T' must be invariantly valid on `B<T>(A<T>)'
+// Line: 9
+// Compiler options: -langversion:future
+
+interface A<T>
+{
+}
+
+delegate void B<in T> (A<T> a);
--- /dev/null
+// CS1961: The contravariant type parameter `T' must be invariantly valid on `B<T>(A<A<T>>)'
+// Line: 9
+// Compiler options: -langversion:future
+
+interface A<T>
+{
+}
+
+delegate void B<in T> (A<A<T>> a);
--- /dev/null
+// CS1961: The contravariant type parameter `T' must be covariantly valid on `B<T>.A'
+// Line: 9
+// Compiler options: -langversion:future
+
+interface A<out T>
+{
+}
+
+interface B<in T>
+{
+ A<T> A { get; }
+}
--- /dev/null
+// CS1961: The contravariant type parameter `T' must be invariantly valid on `B<T>.C(A<T>)'
+// Line: 9
+// Compiler options: -langversion:future
+
+interface A<T>
+{
+}
+
+interface B<in T>
+{
+ void C(A<T> a);
+}
--- /dev/null
+// CS1961: The covariant type parameter `U' must be contravariantly valid on `D<U>()'
+// Line: 9
+// Compiler options: -langversion:future
+
+interface I<in T>
+{
+}
+
+delegate I<U[]> D<out U> ();
--- /dev/null
+// CS1961: The contravariant type parameter `T' must be invariantly valid on `B<T>'
+// Line: 9
+// Compiler options: -langversion:future
+
+interface A<T>
+{
+}
+
+interface B<in T> : A<T>
+{
+}
--- /dev/null
+// CS1961: The contravariant type parameter `T' must be covariantly valid on `B<T>'
+// Line: 9
+// Compiler options: -langversion:future
+
+interface A<out T>
+{
+}
+
+interface B<in T> : A<T>
+{
+}
--- /dev/null
+// CS1961: The covariant type parameter `T' must be invariantly valid on `B<T>.A'
+// Line: 9
+// Compiler options: -langversion:future
+
+interface A<T>
+{
+}
+
+interface B<out T>
+{
+ A<T> A { get; }
+}
--- /dev/null
+// CS1961: The covariant type parameter `T' must be invariantly valid on `B<T>.A'
+// Line: 9
+// Compiler options: -langversion:future
+
+interface A<T>
+{
+}
+
+interface B<out T>
+{
+ A<A<T>> A { get; }
+}
--- /dev/null
+// CS1961: The contravariant type parameter `T' must be covariantly valid on `D<T>()'
+// Line: 5
+// Compiler options: -langversion:future
+
+delegate T D<in T> ();
--- /dev/null
+// CS1961: The covariant type parameter `T' must be invariantly valid on `B<T>.C()'
+// Line: 9
+// Compiler options: -langversion:future
+
+interface A<T>
+{
+}
+
+interface B<out T>
+{
+ A<T> C();
+}
--- /dev/null
+// CS1961: The covariant type parameter `T' must be invariantly valid on `B<T>.C()'
+// Line: 9
+// Compiler options: -langversion:future
+
+interface A<T>
+{
+}
+
+interface B<out T>
+{
+ A<A<T>> C();
+}
--- /dev/null
+// CS1961: The covariant type parameter `T' must be invariantly valid on `B<T>.C(A<T>)'
+// Line: 9
+// Compiler options: -langversion:future
+
+interface A<T>
+{
+}
+
+interface B<out T>
+{
+ void C(A<T> a);
+}
--- /dev/null
+// CS1923: The covariant type parameter `T' must be invariantly valid on `B<T>.C(A<A<T>>)'
+// Line: 9
+// Compiler options: -langversion:future
+
+interface A<T>
+{
+}
+
+interface B<out T>
+{
+ void C(A<A<T>> a);
+}
--- /dev/null
+// CS1961: The covariant type parameter `T' must be invariantly valid on `B<T>()'
+// Line: 9
+// Compiler options: -langversion:future
+
+interface A<T>
+{
+}
+
+delegate A<T> B<out T> ();
--- /dev/null
+// CS1961: The covariant type parameter `T' must be invariantly valid on `B<T>()'
+// Line: 9
+// Compiler options: -langversion:future
+
+interface A<T>
+{
+}
+
+delegate A<A<T>> B<out T> ();
--- /dev/null
+// CS1961: The covariant type parameter `T' must be invariantly valid on `B<T>(A<T>)'
+// Line: 9
+// Compiler options: -langversion:future
+
+interface A<T>
+{
+}
+
+delegate void B<out T> (A<T> a);
--- /dev/null
+// CS1961: The covariant type parameter `T' must be invariantly valid on `B<T>(A<A<T>>)'
+// Line: 9
+// Compiler options: -langversion:future
+
+interface A<T>
+{
+}
+
+delegate void B<out T> (A<A<T>> a);
--- /dev/null
+// CS1961: The covariant type parameter `T' must be contravariantly valid on `B<T>.A'
+// Line: 9
+// Compiler options: -langversion:future
+
+interface A<in T>
+{
+}
+
+interface B<out T>
+{
+ A<T> A { get; }
+}
--- /dev/null
+// CS1961: The covariant type parameter `T' must be invariantly valid on `B<T>.C(A<T>)'
+// Line: 9
+// Compiler options: -langversion:future
+
+interface A<T>
+{
+}
+
+interface B<out T>
+{
+ void C(A<T> a);
+}
--- /dev/null
+// CS1961: The contravariant type parameter `T' must be invariantly valid on `B<T>.A'
+// Line: 9
+// Compiler options: -langversion:future
+
+interface A<T>
+{
+}
+
+interface B<in T>
+{
+ A<T> A { get; }
+}
--- /dev/null
+// CS1961: The covariant type parameter `U' must be contravariantly valid on `D<U>()'
+// Line: 7
+// Compiler options: -langversion:future
+
+interface IContravariant<in T> { }
+
+delegate IContravariant<U[]> D<out U> ();
--- /dev/null
+// CS1961: The covariant type parameter `T' must be invariantly valid on `B<T>'
+// Line: 9
+// Compiler options: -langversion:future
+
+interface A<T>
+{
+}
+
+interface B<out T> : A<T>
+{
+}
--- /dev/null
+// CS1961: The covariant type parameter `T' must be contravariantly valid on `B<T>'
+// Line: 9
+// Compiler options: -langversion:future
+
+interface A<in T>
+{
+}
+
+interface B<out T> : A<T>
+{
+}
--- /dev/null
+// CS1961: The contravariant type parameter `T' must be invariantly valid on `A<T>.B(out T)'
+// Line: 5
+// Compiler options: -langversion:future
+
+interface A<in T>
+{
+ void B(out T t);
+}
--- /dev/null
+// CS1961: The contravariant type parameter `T' must be invariantly valid on `A<T>.B(ref T)'
+// Line: 5
+// Compiler options: -langversion:future
+
+interface A<in T>
+{
+ void B(ref T t);
+}
--- /dev/null
+// CS1961: The covariant type parameter `T' must be contravariantly valid on `A<T>.B(T)'
+// Line: 7
+// Compiler options: -langversion:future
+
+interface A<out T>
+{
+ void B(T t);
+}
--- /dev/null
+// CS1961: The covariant type parameter `T' must be invariantly valid on `A<T>.B(out T)'
+// Line: 7
+// Compiler options: -langversion:future
+
+interface A<out T>
+{
+ void B(out T t);
+}
--- /dev/null
+// CS1961: The covariant type parameter `T' must be invariantly valid on `A<T>.B(ref T)'
+// Line: 5
+// Compiler options: -langversion:future
+
+interface A<out T>
+{
+ void B(ref T t);
+}
--- /dev/null
+// CS1961: The covariant type parameter `V' must be invariantly valid on `Both<U,V>(Covariant<None<Contra<V>>>)'
+// Line: 9
+// Compiler options: -langversion:future
+
+delegate T Covariant<out T> ();
+delegate void Contra<in T> (T t);
+delegate void None<T> (T t);
+
+delegate void Both<in U, out V> (Covariant<None<Contra<V>>> b);
--- /dev/null
+// CS1961: The covariant type parameter `V' must be contravariantly valid on `I<V>.Foo<T>(T)'
+// Line: 6
+
+interface I<out V>
+{
+ void Foo<T> (T t) where T : V;
+}
--- /dev/null
+// CS1961: The contravariant type parameter `T' must be invariantly valid on `B<T>.A'
+// Line: 9
+// Compiler options: -langversion:future
+
+interface A<T>
+{
+}
+
+interface B<in T>
+{
+ A<A<T>> A { get; }
+}
--- /dev/null
+// CS1961: The contravariant type parameter `T' must be invariantly valid on `B<T>.C()'
+// Line: 9
+// Compiler options: -langversion:future
+
+interface A<T>
+{
+}
+
+interface B<in T>
+{
+ A<T> C();
+}
--- /dev/null
+// CS1961: The contravariant type parameter `T' must be invariantly valid on `B<T>.C()'
+// Line: 9
+// Compiler options: -langversion:future
+
+interface A<T>
+{
+}
+
+interface B<in T>
+{
+ A<A<T>> C();
+}
--- /dev/null
+// CS1961: The contravariant type parameter `T' must be invariantly valid on `B<T>.C(A<T>)'
+// Line: 9
+// Compiler options: -langversion:future
+
+interface A<T>
+{
+}
+
+interface B<in T>
+{
+ void C(A<T> a);
+}
--- /dev/null
+// CS1961: The contravariant type parameter `T' must be invariantly valid on `B<T>.C(A<A<T>>)'
+// Line: 9
+// Compiler options: -langversion:future
+
+interface A<T>
+{
+}
+
+interface B<in T>
+{
+ void C(A<A<T>> a);
+}
--- /dev/null
+// CS1961: The contravariant type parameter `T' must be invariantly valid on `B<T>()'
+// Line: 9
+// Compiler options: -langversion:future
+
+interface A<T>
+{
+}
+
+delegate A<T> B<in T> ();
--- /dev/null
+// CS1961: The contravariant type parameter `T' must be covariantly valid on `A<T>.B()'
+// Line: 7
+// Compiler options: -langversion:future
+
+interface A<in T>
+{
+ T B();
+}
--- /dev/null
+// CS3001: Argument type `sbyte' is not CLS-compliant
+// Line: 9
+// Compiler options: -warnaserror -warn:1
+
+using System;
+[assembly:CLSCompliant (true)]
+
+public static class CLSClass
+{
+ public static void Foo (this sbyte value) { }
+}
--- /dev/null
+// CS3002: Return type of `CLSClass.Foo()' is not CLS-compliant
+// Line: 10
+// Compiler options: -warnaserror -warn:1
+
+using System;
+[assembly:CLSCompliant(true)]
+
+public class CLSClass
+{
+ protected ulong? Foo()
+ {
+ return 5;
+ }
+}
--- /dev/null
+// CS3003: Type of `S.test2' is not CLS-compliant
+// Line: 11
+// Compiler options: -unsafe -warnaserror -warn:1
+
+using System;
+
+[assembly: CLSCompliant (true)]
+
+public unsafe struct S
+{
+ public fixed bool test2 [4];
+}
--- /dev/null
+// CS3005: Identifier `CLSClass.Method<T>(int)' differing only in case is not CLS-compliant
+// Line: 12
+// Compiler options: -warnaserror
+
+[assembly:System.CLSCompliant (true)]
+
+public class BaseClass {
+ public int method;
+}
+
+public class CLSClass : BaseClass {
+ public static void Method<T>(int arg) {}
+}
--- /dev/null
+// CS3009: `C': base type `C<ulong>' is not CLS-compliant
+// Line: 14
+// Compiler options: -warnaserror -warn:1
+
+using System;
+[assembly:CLSCompliant(true)]
+
+public class C<T>
+{
+}
+
+public class C : C<ulong>
+{
+}
--- /dev/null
+// CS3019: CLS compliance checking will not be performed on `T' because it is not visible from outside this assembly
+// Line: 8
+// Compiler options: -warnaserror -warn:2
+
+using System;
+[assembly:CLSCompliant(true)]
+
+public class CLSClass<[CLSCompliant (false)] T>
+{
+}
\ No newline at end of file
--- /dev/null
+// CS3024: Constraint type `A' is not CLS-compliant
+// Line: 15
+// Compiler options: -warn:1 -warnaserror
+
+using System;
+[assembly:CLSCompliant (true)]
+
+[CLSCompliant (false)]
+public abstract class A
+{
+}
+
+public class C
+{
+ public static void Foo<T>() where T : A
+ {
+ }
+}
+
--- /dev/null
+// CS3024: Constraint type `I' is not CLS-compliant
+// Line: 13
+// Compiler options: -warn:1 -warnaserror
+
+using System;
+[assembly:CLSCompliant (true)]
+
+[CLSCompliant (false)]
+public interface I
+{
+}
+
+public class C<T> where T : I
+{
+}
+
+++ /dev/null
-// CS0019: Operator `==' cannot be applied to operands of type `object' and `V'
-// Line: 9
-
-public class C<V>
-{
- public bool TryGet (V v)
- {
- object tmp = null;
- return tmp == v;
- }
-}
+++ /dev/null
-// CS0019: Operator `+' cannot be applied to operands of type `null' and `MyTypeImplicitOnly?'
-// Line: 13
-
-struct MyTypeImplicitOnly
-{
-}
-
-class C
-{
- static void Main ()
- {
- MyTypeImplicitOnly? mt = null;
- mt = null + mt;
- }
-}
+++ /dev/null
-// CS0019: Operator `??' cannot be applied to operands of type `null' and `bool'
-// Line: 8
-
-class Program
-{
- static void Main()
- {
- object s = null ?? true;
- }
-}
+++ /dev/null
-// CS0019: Operator `??' cannot be applied to operands of type `null' and `method group'
-// Line: 8
-
-class C
-{
- delegate void D ();
-
- static void Main ()
- {
- D d = null ?? Main;
- }
-}
+++ /dev/null
-// CS0019: Operator `==' cannot be applied to operands of type `A.D' and `anonymous method'
-// Line: 11
-
-class A
-{
- delegate void D ();
-
- static void Main ()
- {
- D d = null;
- bool r = d == (() => { });
- }
-}
+++ /dev/null
-// CS0019: Operator `==' cannot be applied to operands of type `A' and `int?'
-// Line: 22
-
-class A
-{
- public static bool operator == (A a, int b)
- {
- return false;
- }
-
- public static bool operator != (A a, int b)
- {
- return false;
- }
-}
-
-class C
-{
- public static void Main ()
- {
- A a = new A ();
- object b = a == Id;
- }
-
- static int? Id {
- get { return 1; }
- }
-}
+++ /dev/null
-// CS0019: Operator `+' cannot be applied to operands of type `Program' and `Program'
-// Line: 8
-
-public class Program
-{
- static void Main ()
- {
- Program b = default (Program) + default (Program);
- }
-}
+++ /dev/null
-// CS0019: Operator `==' cannot be applied to operands of type `T' and `U'
-// Line: 12
-
-interface I
-{
-}
-
-class Program
-{
- bool Test<T, U> (T t, U u) where T : I where U : I
- {
- return t == u;
- }
-}
+++ /dev/null
-// CS0019: Operator `&=' cannot be applied to operands of type `bool' and `byte?'
-// Line: 10
-
-public class Test
-{
- public static void Main()
- {
- bool b = false;
- byte? b2 = 0;
- b &= b2;
- }
-}
+++ /dev/null
-// CS0019: Operator `^' cannot be applied to operands of type `S2' and `float'
-// Line: 9
-
-public class Test
-{
- public static void Main()
- {
- S2 s2 = new S2 ();
- int r = s2 ^ 5.04f;
- }
-}
-
-struct S2
-{
- public static int operator ^ (double? p1, S2 s2)
- {
- return 1;
- }
-
- public static implicit operator int? (S2 s1)
- {
- return int.MinValue;
- }
-}
+++ /dev/null
-// CS0019: Operator `==' cannot be applied to operands of type `T' and `T'
-// Line: 5
-public class TestClass<T>
-{
- public bool Check (T x, T y) { return x == y; }
-}
-
-public class X
-{
- static void Main ()
- { }
-}
-
-
+++ /dev/null
-// CS0019: Operator `>' cannot be applied to operands of type `S' and `S?'
-// Line: 9
-
-public class Test
-{
- public static void Main ()
- {
- S a = new S ();
- S? b = null;
- string res = a > b;
- }
-}
-
-struct S
-{
- public static string operator > (S a, S b)
- {
- return ">";
- }
-
- public static string operator < (S a, S b)
- {
- return "<";
- }
-}
+++ /dev/null
-// CS0019: Operator `==' cannot be applied to operands of type `S?' and `int'
-// Line: 15
-
-struct S
-{
- public static bool operator != (S s, int a) { return true; }
- public static bool operator == (S s, int a) { return false; }
-}
-
-public class C
-{
- public static void Main ()
- {
- S? s;
- var b = s == 1;
- }
-}
+++ /dev/null
-// CS0019: Operator `==' cannot be applied to operands of type `int' and `S?'
-// Line: 15
-
-struct S
-{
- public static bool operator !=(int a, S s) { return true; }
- public static bool operator ==(int a, S s) { return false; }
-}
-
-public class C
-{
- public static void Main ()
- {
- S? s;
- var b = 1 == s;
- }
-}
+++ /dev/null
-// CS0019: Operator `&&' cannot be applied to operands of type `bool?' and `bool?'
-// Line: 10
-using System;
-
-class X
-{
- static void Main ()
- {
- bool? a = false, b = false;
- Console.WriteLine (a && b);
- }
-}
+++ /dev/null
-// CS0019: Operator `==' cannot be applied to operands of type `method group' and `null'
-// Line: 8
-
-public class C
-{
- public static void Main ()
- {
- bool a = DelegateMethod == null;
- }
-
- static int DelegateMethod(bool b)
- {
- return 3;
- }
-}
+++ /dev/null
-// CS0019: Operator `==' cannot be applied to operands of type `method group' and `method group'
-// Line: 8
-
-public class C
-{
- public static void Main ()
- {
- bool a = DelegateMethod == DelegateMethod;
- }
-
- static int DelegateMethod(bool b)
- {
- return 3;
- }
-}
+++ /dev/null
-// CS0019: Operator `??' cannot be applied to operands of type `null' and `anonymous method'
-// Line: 8
-
-delegate void D ();
-
-class F
-{
- D d = null ?? delegate { };
-}
+++ /dev/null
-// CS0019: Operator `??' cannot be applied to operands of type `T' and `T'
-// Line: 8
-
-class F
-{
- T Bar<T> (T t)
- {
- return t ?? default(T);
- }
-}
+++ /dev/null
-// CS0019: Operator `!=' cannot be applied to operands of type `ulong?' and `int'
-// Line: 8
-
-class C
-{
- static void Test (ulong? x, int y)
- {
- if (x != y)
- {
- }
- }
-}
+++ /dev/null
-// CS0019: Operator `??' cannot be applied to operands of type `int' and `int'
-// Line: 8
-class X
-{
- static void Main ()
- {
- int a = 5;
- int b = a ?? 3;
- }
-}
+++ /dev/null
-// CS0021: Cannot apply indexing with [] to an expression of type `G'
-// Line: 5
-public class Foo<G> {
- public static void Bar() {
- int i = default(G)[0];
- }
-}
-
+++ /dev/null
-// CS0029: Cannot implicitly convert type `A<int>.B<long>' to `A<long>.B<long>'
-// Line: 14
-
-class A<T>
-{
- public class B<U>
- {
- }
-}
-
-class Test
-{
- static A<int>.B<long> a;
- static A<long>.B<long> b = a;
-}
+++ /dev/null
-// CS0029: Cannot implicitly convert type `T' to `EventHandler'
-// Line: 14
-
-using System;
-
-public delegate void EventHandler (int i, int j);
-
-public class Button {
-
- public event EventHandler Click;
-
- public void Connect<T> () where T : class
- {
- Click += default (T);
- }
-}
+++ /dev/null
-// CS0029: Cannot implicitly convert type `T' to `int*'
-// Line : 8
-// Compiler options: -unsafe
-
-class T {
- static unsafe void Main ()
- {
- int *a = default(T);
- }
-}
+++ /dev/null
-// CS0029: Cannot implicitly convert type `bool' to `int'
-// Line : 7
-
-class T {
- static int Main ()
- {
- int a = default(bool);
- }
-}
+++ /dev/null
-// CS0029: Cannot implicitly convert type `T' to `int*'
-// Line : 8
-// Compiler options: -unsafe
-
-class T {
- static unsafe int Main ()
- {
- int *a = default(T);
- }
-}
+++ /dev/null
-// CS0029: Cannot implicitly convert type `anonymous type' to `bool'
-// Line: 10
-
-
-public class Test
-{
- static void Main ()
- {
- var o = new { Value = 1 };
- bool b = o;
- }
-}
+++ /dev/null
-// CS0029: Cannot implicitly convert type `string' to `int'
-// Line: 28
-
-
-delegate string funcs (string s);
-delegate int funci (int i);
-
-class X
-{
- static void Foo (funci fi)
- {
- }
-
- static void Foo (funcs fs)
- {
- }
-
- static void Main ()
- {
- Foo (x => {
- int a = "a";
- return 2;
- });
- }
-}
\ No newline at end of file
+++ /dev/null
-// CS0029: Cannot implicitly convert type `T[]' to `I[]'
-// Line: 12
-
-interface I
-{
-}
-
-class C
-{
- static void Foo<T> (T [] t) where T : I
- {
- I [] i = t;
- }
-}
+++ /dev/null
-// CS0029: Cannot implicitly convert type `T' to `int*'
-// Line: 8
-// Compiler options: -unsafe
-
-class T
-{
- static unsafe void Main ()
- {
- int* a = default (T);
- }
-}
+++ /dev/null
-// CS0029: Cannot implicitly convert type `T2' to `T1'
-// Line: 8
-
-class Test
-{
- static void Foo<T1, T2> (T1 t1, T2 t2)
- {
- T1 a = default (T2);
- }
-}
+++ /dev/null
-// CS0029: Cannot implicitly convert type `Bar<long>' to `Foo<int>'
-// Line: 15
-class Foo<T>
-{
-}
-
-class Bar<T> : Foo<T>
-{
-}
-
-class X
-{
- static void Main ()
- {
- Foo<int> foo = new Bar<long> ();
- }
-}
+++ /dev/null
-// CS0030: Cannot convert type `X' to `S'
-// Line: 10
-
-struct S {
-}
-
-class X {
- static void Main ()
- {
- S s = (S)default(X);
- }
-}
+++ /dev/null
-// CS0030: Cannot convert type `T[,]' to `System.Collections.Generic.IEnumerable<T>'
-// Line: 10
-
-using System.Collections.Generic;
-
-class C
-{
- IEnumerable<T> Foo<T> (T [,] a)
- {
- return (IEnumerable<T>) a;
- }
-}
+++ /dev/null
-// CS0030: Cannot convert type `T' to `X'
-// Line: 8
-class Foo<T>
- where T : System.ICloneable
-{
- public X Test (T t)
- {
- return (X) t;
- }
-}
-
-class X
-{
- static void Main ()
- { }
-}
+++ /dev/null
-// cs0031-5.cs: Constant value `200000000000' cannot be converted to a `int'
-// Line: 7
-// Compiler options: -unsafe
-
-public unsafe struct C
-{
- private fixed long test_1 [200000000000];
-}
-
+++ /dev/null
-// CS0037: Cannot convert null to `bool' because it is a value type
-// Line: 19
-
-
-using System;
-
-class TestA
-{
- public string Select (Func<TestA, bool> f)
- {
- return "";
- }
-}
-
-public class C
-{
- static void Main ()
- {
- string foo = from a in new TestA () select null;
- }
-}
+++ /dev/null
-// CS0051: Inconsistent accessibility: parameter type `C.S?[][]' is less accessible than method `C.Foo(C.S?[][])'
-// Line: 7
-
-public class C
-{
- struct S {}
- public void Foo (S?[][] o) {}
-}
+++ /dev/null
-// CS0060: Inconsistent accessibility: base class `A<C>.B' is less accessible than class `D'
-// Line: 13
-
-public class A<T>
-{
- public class B {}
-}
-
-internal class C : A<C>
-{
-}
-
-public class D : C.B
-{
-}
+++ /dev/null
-// CS0060: Inconsistent accessibility: base class `Foo<Bar.Baz>' is less accessible than class `Bar'
-// Line: 7
-
-public class Foo<K> {
-}
-
-public class Bar : Foo<Bar.Baz> {
- private class Baz {
- }
-}
+++ /dev/null
-// CS0060: Inconsistent accessibility: base class `Foo<Bar.Baz>' is less accessible than class `Bar'
-// Line: 7
-
-public class Foo<K> {
-}
-
-public class Bar : Foo<Bar.Baz> {
- internal class Baz {
- }
-}
+++ /dev/null
-// CS0065: `EventClass<T>.handler': event property must have both add and remove accessors
-// Line: 10
-
-using System;
-
-public delegate void EventHandler (object sender, EventArgs e);
-
-public class EventClass<T>
-{
- event EventHandler handler { add {} }
-}
-
+++ /dev/null
-// CS0069: Event in interface cannot have add or remove accessors
-// Line: 11
-
-using System;
-
-public delegate void FooHandler ();
-
-interface IBar<T>
-{
- event FooHandler OnFoo {
- remove { }
- }
-}
-
+++ /dev/null
-// cs0080.cs: Constraints are not allowed on non-generic declarations
-// Line: 5
-
-using System.Collections;
-class Dingus where T : IEnumerable {
-}
-
-class D {
- static void Main ()
- {
- }
-}
+++ /dev/null
-// gcs0081-2.cs: Type parameter declaration must be an identifier not a type
-// Line: 6
-
-class D
-{
- public void Foo<int>()
- {
- }
-}
+++ /dev/null
-// gcs0081.cs: Type parameter declaration must be an identifier not a type
-// Line: 4
-
-partial class A<T, bool>
-{
-}
-
-partial class A<T, O>
-{
-}
+++ /dev/null
-// gcs0081.cs: Type parameter declaration must be an identifier not a type
-// Line: 4
-
-class D<string>
-{
-}
+++ /dev/null
-// CS0100: The parameter name `a' is a duplicate
-// Line: 10
-
-using System;
-
-class C
-{
- static void Main ()
- {
- Func<int, int, int> l = (a, a) => 1;
- }
-}
+++ /dev/null
-// gcs0102.cs: The type `X<T>' already contains a definition for `T'
-// Line: 11
-
-class X <T> {
- int T;
-}
-
-class W {
- static void Main () {}
-}
+++ /dev/null
-// CS0103: The name `Value' does not exist in the current context
-// Line: 9
-
-
-public class Test
-{
- static void Main ()
- {
- var v = new { Field = Value };
- }
-}
+++ /dev/null
-// CS0103: The name `a' does not exist in the current context
-// Line: 11
-
-using System.Linq;
-
-class C
-{
- public static void Main ()
- {
- var e = from a in "abcd"
- join b in "defg" on "a" equals a
- select a;
- }
-}
+++ /dev/null
-// CS0103: The name `b' does not exist in the current context
-// Line: 11
-
-using System.Linq;
-
-class C
-{
- public static void Main ()
- {
- var e = from a in "abcd"
- join b in "defg" on b equals "g"
- select a;
- }
-}
+++ /dev/null
-// CS0103: The name `a1' does not exist in the current context
-// Line: 11
-
-using System.Linq;
-
-class C
-{
- public static void Main ()
- {
- var e =
- from a1 in "abcd"
- select a1;
-
- a1 = null;
- }
-}
+++ /dev/null
-// CS0103: The name `Console' does not exist in the current context
-// Line: 10
-
-
-class C
-{
- delegate void WithOutParam (string value);
-
- static void Main()
- {
- WithOutParam o = (s) => Console.WriteLine();
- }
-}
+++ /dev/null
-// CS0108: `Derived.Action<U>' hides inherited member `Base.Action<U>'. Use the new keyword if hiding was intended
-// Line: 12
-// Compiler options: -warnaserror
-
-public abstract class Base
-{
- public delegate void Action<U> (U val);
-}
-
-public class Derived : Base
-{
- public delegate void Action<U> (U i);
-}
+++ /dev/null
-// CS0108: `BaseConcrete.InnerDerived<T>()' hides inherited member `BaseGeneric<string>.InnerDerived'. Use the new keyword if hiding was intended
-// Line: 14
-// Compiler options: -warn:2 -warnaserror
-
-class BaseGeneric<T>
-{
- public class InnerDerived
- {
- }
-}
-
-class BaseConcrete : BaseGeneric<string>
-{
- public void InnerDerived<T> ()
- {
- }
-}
+++ /dev/null
-// CS0109: The member `Derived<U>.Action' does not hide an inherited member. The new keyword is not required
-// Line: 12
-// Compiler options: -warnaserror -warn:4
-
-public abstract class Base
-{
- public delegate void Action<U>(U val);
-}
-
-public class Derived<U> : Base
-{
- new internal Action<U> Action;
-}
+++ /dev/null
-// CS0109: The member `Derived.Action<T,U>' does not hide an inherited member. The new keyword is not required
-// Line: 12
-// Compiler options: -warnaserror -warn:4
-
-public abstract class Base
-{
- public delegate void Action<U> (U val);
-}
-
-public class Derived : Base
-{
- public new delegate void Action<T, U> (U val);
-}
+++ /dev/null
-// CS0111: A member `Blah.I.M<U>(int)' is already defined. Rename this member or use different parameter types
-// Line : 12
-
-public interface I
-{
- void M<T> (int i);
-}
-
-public class Blah: I
-{
- void I.M<T> (int i) {}
- void I.M<U> (int i) {}
-}
+++ /dev/null
-// CS0111: A member `C.Foo<U>(U)' is already defined. Rename this member or use different parameter types
-// Line : 12
-
-public class C
-{
- void Foo<T> (T i)
- {
- }
-
- void Foo<U> (U i)
- {
- }
-}
+++ /dev/null
-// CS0111: A member `C.Foo<U>(U)' is already defined. Rename this member or use different parameter types
-// Line : 12
-
-public class C
-{
- void Foo (int i)
- {
- }
-
- void Foo<T> (T i)
- {
- }
-
- void Foo<U> (U i)
- {
- }
-}
+++ /dev/null
-// CS0111: A member `MyClass.IMyInterface<System.String>.Prop' is already defined. Rename this member or use different parameter types
-// Line: 18
-
-using System;
-
-interface IMyInterface<T>
-{
- bool Prop { set; }
-}
-
-public class MyClass: IMyInterface<string>
-{
- bool IMyInterface<string>.Prop
- {
- set {}
- }
-
- bool IMyInterface<System.String>.Prop
- {
- set {}
- }
-}
+++ /dev/null
-// CS0111: A member `C.I<int>.Prop' is already defined. Rename this member or use different parameter types
-// Line: 12
-
-interface I<T>
-{
- T Prop { get; set; }
-}
-
-class C : I<int>
-{
- int I<int>.Prop { get; set; }
- int I<int>.Prop { get; set; }
-}
+++ /dev/null
-// CS0111: A member `Blah.I.M<X>()' is already defined. Rename this member or use different parameter types
-// Line : 12
-
-public interface I
-{
- void M<X> ();
-}
-
-public class Blah: I
-{
- void I.M<X> () {}
- void I.M<X> () {}
-}
-
+++ /dev/null
-// CS0111: A member `C.Foo<U>(G<U>)' is already defined. Rename this member or use different parameter types
-// Line : 14
-
-class G<T>
-{
-}
-
-public class C
-{
- void Foo<T> (G<T> g)
- {
- }
-
- void Foo<U> (G<U> u)
- {
- }
-}
+++ /dev/null
-// CS0111: A member `Dictionary<K,V>.Add(V)' is already defined. Rename this member or use different parameter types
-// Line: 14
-
-using System;
-using System.Collections.Generic;
-
-public class Dictionary<K,V>
-{
- public void Add (V key)
- {
- throw new InvalidOperationException ();
- }
-
- public void Add (V value)
- {
- throw new InvalidOperationException ();
- }
-}
+++ /dev/null
-// CS0117: `Data' does not contain a definition for `Count'
-// Line: 15
-
-
-using System;
-
-class Data
-{
-}
-
-public class Test
-{
- static void Main ()
- {
- var c = new Data { Count = 10 };
- }
-}
+++ /dev/null
-// CS0117: `A' does not contain a definition for `Method'
-// Line: 8
-
-public class E : A
-{
- void Test ()
- {
- base.Method ();
- }
-}
-
-static class S
-{
- public static void Method (this A a)
- {
- }
-}
-
-public class A
-{
-}
\ No newline at end of file
+++ /dev/null
-// CS0118: `N' is a `namespace' but a `type' was expected
-// Line: 8
-
-namespace N
-{
-}
-
-public class C<T> where T : N
-{
-}
\ No newline at end of file
+++ /dev/null
-// CS0119: Expression denotes a `type', where a `variable' or `value' was expected
-// Line: 12
-
-public class Foo<T>
-{
-}
-
-class X
-{
- static void Main ()
- {
- Foo<X> = new Foo<X> ();
- }
-}
+++ /dev/null
-// CS0119: Expression denotes a `type parameter', where a `variable', `value' or `type' was expected
-// Line: 15
-
-class A
-{
- public class T
- {
- }
-}
-
-class B<T> : A
-{
- void Foo ()
- {
- T.Equals (null, null);
- }
-}
+++ /dev/null
-// CS0119: Expression denotes a `type parameter', where a `variable', `value' or `type' was expected
-// Line: 8
-
-class C
-{
- static void Foo<T> ()
- {
- T.ToString ();
- }
-}
+++ /dev/null
-// CS0121: The call is ambiguous between the following methods or properties: `Test.Foo<int,int>(int, System.Linq.Expressions.Expression<System.Func<int,int>>)' and `Test.Foo<int,int>(int, System.Func<int,int>)'
-// Line: 22
-
-using System;
-using System.Linq;
-using System.Linq.Expressions;
-
-class Test
-{
- static int Foo<T, R> (T t, Expression<Func<T, R>> e)
- {
- return 5;
- }
-
- static int Foo<T, R> (T t, Func<T, R> e)
- {
- return 0;
- }
-
- static void Main ()
- {
- Foo (1, i => i);
- }
-}
-
+++ /dev/null
-// CS0122: The call is ambiguous between the following methods or properties: `Test.Foo(IIn<string>)' and `Test.Foo(IIn<Test>)'
-// Line: 23
-// Compiler options: -langversion:future
-
-interface IIn<in T>
-{
-}
-
-class Test
-{
-
- static void Foo (IIn<string> f)
- {
- }
-
- static void Foo (IIn<Test> f)
- {
- }
-
- public static int Main ()
- {
- IIn<object> test = null;
- Foo (test);
-
- return 0;
- }
-}
+++ /dev/null
-// CS0121: The call is ambiguous between the following methods or properties: `Foo<int,int>.Test(int)' and `Foo<int,int>.Test(int)'
-// Line: 23
-using System;
-
-public class Foo<T,U>
-{
- public void Test (T index)
- {
- Console.WriteLine ("Test 1: {0}", index);
- }
-
- public void Test (U index)
- {
- Console.WriteLine ("Test 2: {0}", index);
- }
-}
-
-class X
-{
- static void Main ()
- {
- Foo<int,int> foo = new Foo<int,int> ();
- foo.Test (3);
- }
-}
+++ /dev/null
-// CS0122: `Test<float>' is inaccessible due to its protection level
-// Line: 8
-// Compiler options: -r:GCS0122-2-lib.dll
-
-class X
-{
- static void Main ()
- {
- Test<float> test = new Test<float> ();
- }
-}
-
+++ /dev/null
-// CS0122: `Foo.Print(this string)' is inaccessible due to its protection level
-// Line: 19
-
-
-using System;
-
-static class Foo
-{
- static void Print (this string s)
- {
- }
-}
-
-static class Program
-{
- static void Main(string[] args)
- {
- string s = "Hello, world";
- Foo.Print(s);
- }
-}
\ No newline at end of file
+++ /dev/null
-// cs0133-2.cs: The expression being assigned to `S.pathName' must be constant
-// Line: 12
-// Compiler options: -unsafe
-
-class C
-{
- public static int i = 4;
-}
-
-public unsafe struct S
-{
- private fixed char pathName [C.i];
-}
+++ /dev/null
-// CS0136: A local variable named `v' cannot be declared in this scope because it would give a different meaning to `v', which is already used in a `parent or current' scope to denote something else
-// Line: 13
-
-using System.Linq;
-
-public class Test
-{
- public static void Main ()
- {
- var l = from v in "abcd" select (v => v);
- }
-}
+++ /dev/null
-// CS0136: A local variable named `i' cannot be declared in this scope because it would give a different meaning to `i', which is already used in a `parent or current' scope to denote something else
-// Line: 10
-
-using System;
-
-class T
-{
- public void Foo (int i)
- {
- Action<int> v = x => { int i = 9; };
- }
-}
+++ /dev/null
-// CS0136: A local variable named `v' cannot be declared in this scope because it would give a different meaning to `v', which is already used in a `child' scope to denote something else
-// Line: 11
-
-using System.Linq;
-
-class C
-{
- public static void Main ()
- {
- var l = from v in "abcd" select v;
- int v;
- }
-}
+++ /dev/null
-// CS0146: Circular base class dependency involving `B<T>' and `A<float>'
-// Line: 8
-
-class A<T> : B<int>
-{
-}
-
-class B<T> : A<float>
-{ }
-
-class X
-{
- static void Main ()
- { }
-}
+++ /dev/null
-// CS0162: Unreachable code detected
-// Line: 10
-// Compiler options: -warnaserror -warn:2
-
-class C
-{
- static int Main ()
- {
- while (!new bool {});
- return 1;
- }
-}
+++ /dev/null
-// CS0162: Unreachable code detected
-// Line: 12
-// Compiler options: -warnaserror -warn:2
-
-using System;
-
-class E
-{
- public void Method<T> () where T : class
- {
- if (default (T) != null)
- throw new ArgumentNullException ();
- }
-}
+++ /dev/null
-// CS0171: Field `S<TKey>.key' must be fully assigned before control leaves the constructor
-// Line: 13
-
-public struct S<TKey> {
- private TKey key;
-
- public TKey Key {
- get { return key; }
- private set { key = value; }
- }
-
- public S (TKey key)
- {
- Key = key;
- }
-}
+++ /dev/null
-// CS0173: Type of conditional expression cannot be determined because there is no implicit conversion between `anonymous method' and `anonymous method'
-// Line: 11
-
-using System;
-
-class Test
-{
- public static void Main ()
- {
- bool descending = false;
- Comparison<int> comp = descending ? ((e1, e2) => e2 < e1) : ((e1, e2) => e1 < e2);
- }
-}
+++ /dev/null
-// CS0177: The out parameter `output' must be assigned to before control leaves the current method
-// Line: 10
-
-class Test
-{
- delegate T Creator<T> ();
-
- static bool TryAction<T> (Creator<T> creator, out T output) where T : struct
- {
- return false;
- }
-}
+++ /dev/null
-// CS0183: The given expression is always of the provided (`T') type
-// Line: 10
-// Compiler options: -warnaserror -warn:1
-
-class X
-{
- static bool Foo<T> () where T : struct
- {
- T o = default (T);
- return o is T;
- }
-}
+++ /dev/null
-// CS0183: The given expression is always of the provided (`int?') type
-// Line: 10
-// Compiler options: -warnaserror -warn:1
-
-class X
-{
- public void Foo ()
- {
- int? x = null;
- if (x is int?) {
- }
- }
-}
+++ /dev/null
-// CS0184: The given expression is never of the provided (`T') type
-// Line: 9
-// Compiler options: -warnaserror -warn:1
-
-class X<T> where T : class
-{
- static void Foo ()
- {
- if (1 is T) {
- }
- }
-}
+++ /dev/null
-// CS0184: The given expression is never of the provided (`int') type
-// Line: 10
-// Compiler options: -warnaserror -warn:1
-
-class X
-{
- public void Foo<T> () where T : class
- {
- T t = default (T);
- if (t is int) {
- }
- }
-}
+++ /dev/null
-// CS0184: The given expression is never of the provided (`bool') type
-// Line: 13
-// Compiler options: -warnaserror -warn:1
-
-using System;
-
-class X
-{
- void Foo ()
- {
- int? i = null;
-
- if (i is bool) {
- }
- }
-}
+++ /dev/null
-// CS0184: The given expression is never of the provided (`bool?') type
-// Line: 13
-// Compiler options: -warnaserror -warn:1
-
-using System;
-
-class X
-{
- void Foo ()
- {
- int? i = null;
-
- if (i is bool?) {
- }
- }
-}
+++ /dev/null
-// CS0200: Property or indexer `A.Counter' cannot be assigned to (it is read-only)
-// Line: 9
-
-class Program
-{
- static void Main()
- {
- A a = new A();
- a.Counter++;
- }
-}
-
-class A {
- private int? _counter;
- public int? Counter {
- get { return _counter; }
- }
-}
+++ /dev/null
-// CS0201: Only assignment, call, increment, decrement, and new object expressions can be used as a statement
-// Line: 13
-
-class C<T>
-{
- static T Test ()
- {
- return default (T);
- }
-
- public static void Main ()
- {
- Test ().Foo;
- }
-}
+++ /dev/null
-// CS0201: Only assignment, call, increment, decrement, and new object expressions can be used as a statement
-// Line: 10
-
-class TestClass
-{
- delegate void test_delegate (int arg);
-
- public TestClass ()
- {
- test_delegate D = (b) => "a";
- }
-}
-
+++ /dev/null
-// CS0202: foreach statement requires that the return type `System.Collections.Generic.IEnumerable<string>' of `Test.GetEnumerator()' must have a suitable public MoveNext method and public Current property
-// Line: 10
-using System;
-using System.Collections.Generic;
-
-class Test {
- static void Main ()
- {
- Test obj = new Test ();
- foreach (string s in obj) {
- }
- }
-
- public IEnumerable<string> GetEnumerator ()
- {
- return null;
- }
-}
+++ /dev/null
-// CS0206: A property, indexer or dynamic member access may not be passed as `ref' or `out' parameter
-// Line: 14
-
-class C
-{
- static void Foo (ref object o)
- {
- }
-
- public static void Main ()
- {
- var v = new { Foo = "Bar" };
-
- Foo (ref v.Foo);
- }
-}
+++ /dev/null
-// cs0208-2.cs : Cannot take the address of, get the size of, or declare a pointer to a managed type `Splay<T>.Node'
-// Line: 9
-// Compiler options: /unsafe
-
-public class Splay<T>
-{
- unsafe private struct Node
- {
- private Node * parent;
- private T data;
- }
-}
-
+++ /dev/null
-// cs0208-3.cs : Cannot take the address of, get the size of, or declare a pointer to a managed type `Splay<T>.Node'
-// Line: 10
-// Compiler options: /unsafe
-// Similar code to #75772, but without field of type T.
-
-public class Splay<T>
-{
- unsafe private struct Node
- {
- private Node * parent;
- }
-}
-
+++ /dev/null
-// cs0208-4.cs : Cannot take the address of, get the size of, or declare a pointer to a managed type `Splay<T>.Node'
-// Line: 10
-// Compiler options: /unsafe
-// similar one to #75772 but using a class instead of a struct.
-
-public class Splay<T>
-{
- unsafe private class Node
- {
- private Node * parent;
- private T data;
- }
-}
-
+++ /dev/null
-// CS0208: Cannot take the address of, get the size of, or declare a pointer to a managed type `T'
-// Line: 8
-
-class X
-{
- public static void Foo<T> (T t)
- {
- object o = sizeof (T);
- }
-}
+++ /dev/null
-// gcs0208.cs: Cannot take the address of, get the size of, or declare a pointer to a managed type `X<A>'
-// Line: 12
-// Compiler options: -unsafe
-
-class X <Y> {
-}
-
-unsafe class A {
-
- static void Main ()
- {
- int size = sizeof (X<A>);
- }
-}
+++ /dev/null
-// CS0214: Pointers and fixed size buffers may only be used in an unsafe context
-// Line: 9
-// Compiler options: -unsafe
-
-public class aClass
-{
- public struct foo_t
- {
- public fixed char b[16];
- }
-}
+++ /dev/null
-// CS0246: The type or namespace name `var' could not be found. Are you missing a using directive or an assembly reference?
-// Line: 8
-
-
-class X
-{
- public X ()
- {
- var? u = i;
- }
-}
+++ /dev/null
-// CS0246: The type or namespace name `TypeMe' could not be found. Are you missing a using directive or an assembly reference?
-// Line: 12
-
-class C
-{
- static void Foo<T> (int i)
- {
- }
-
- public static void Main ()
- {
- Foo<TypeMe> (1);
- }
-}
+++ /dev/null
-// CS0246: The type or namespace name `X' could not be found. Are you missing a using directive or an assembly reference?
-// Line: 4
-
-class A<T> where T : X
-{
- public class X {}
-}
+++ /dev/null
-// CS0246: The type or namespace name `M' could not be found. Are you missing a using directive or an assembly reference?
-// Line: 11
-
-interface I<T>
-{
- void G<TT> ();
-}
-
-class C
-{
- void I<M>.G<M> ()
- {
- }
-
- public static void Main ()
- {
- }
-}
+++ /dev/null
-// gcs0246-8.cs: The type or namespace name `B' could not be found. Are you missing a using directive or an assembly reference?
-// Line: 4
-
-class A : C<B>
-{
- class B {}
-}
-
-interface C<X> {}
+++ /dev/null
-// CS0246: The type or namespace name `NotExist' could not be found. Are you missing a using directive or an assembly reference?
-// Line: 6
-
-class X
-{
- NotExist<float> foo;
-}
+++ /dev/null
-// CS0264: Partial declarations of `A<T,O>' must have the same type parameter names in the same order
-// Line: 8
-
-partial class A<T, bool>
-{
-}
-
-partial class A<T, O>
-{
-}
+++ /dev/null
-// CS0264: Partial declarations of `Partial<U>' must have the same type parameter names in the same order
-// Line: 4
-
-partial class Partial<T>
-{
-}
-
-partial class Partial<U>
-{
-}
+++ /dev/null
-// gcs0265.cs: Partial declarations of `Partial<T>' have inconsistent constraints for type parameter `T'
-// Line: 4
-
-partial class Partial<T> where T: class, new()
-{
-}
-
-partial class Partial<T> where T : new ()
-{
-}
+++ /dev/null
-// CS0266: Cannot implicitly convert type `bool?' to `bool'. An explicit conversion exists (are you missing a cast?)
-// Line: 9
-
-class X
-{
- static void Main ()
- {
- bool? a = true;
- int? b = a ? 3 : 4;
- }
-}
+++ /dev/null
-// CS0266: Cannot implicitly convert type `bool?' to `bool'. An explicit conversion exists (are you missing a cast?)
-// Line: 9
-
-class X
-{
- static void Main ()
- {
- bool? a = true;
- bool b = a & a;
- }
-}
+++ /dev/null
-// CS0266: Cannot implicitly convert type `object' to `bool'. An explicit conversion exists (are you missing a cast?)
-// Line: 9
-
-class X
-{
- static void Main ()
- {
- object o = true;
- bool b = (o ?? string.Empty);
- }
-}
+++ /dev/null
-// CS0266: Cannot implicitly convert type `S?' to `A'. An explicit conversion exists (are you missing a cast?)
-// Line: 9
-
-struct S
-{
- public static int Main ()
- {
- S? s = null;
- A a = s;
- return 0;
- }
-}
-
-struct A
-{
- public static implicit operator A (S x)
- {
- return new A ();
- }
-}
+++ /dev/null
-// CS0266: Cannot implicitly convert type `System.Collections.Generic.IList<int>' to `Hoge<System.Collections.Generic.IList<int>>'. An explicit conversion exists (are you missing a cast?)
-// Line: 20
-
-using System;
-using System.Collections.Generic;
-
-public class Hoge<T>
-{
- public static implicit operator Hoge<T> (T value)
- {
- return null;
- }
-}
-
-public class Test
-{
- static void Main ()
- {
- IList<int> x = new List<int> ();
- Hoge<IList<int>> hoge = x;
- }
-}
+++ /dev/null
-// CS0266: Cannot implicitly convert type `I' to `C'. An explicit conversion exists (are you missing a cast?)
-// Line: 16
-
-interface I
-{
-}
-
-struct C : I
-{
-}
-
-class X
-{
- static void Main (string[] args)
- {
- C c = default (I);
- }
-}
+++ /dev/null
-// CS0267: The `partial' modifier can be used only immediately before `class', `struct', `interface', or `void' keyword
-// Line: 6
-
-public partial class C
-{
- partial virtual void Foo ()
- {
- }
-}
+++ /dev/null
-// CS0271: The property or indexer `Test.A.B' cannot be used in this context because the get accessor is inaccessible
-// Line: 17
-
-using System;
-
-public class Test
-{
- private class A
- {
- public string B { protected get; set; }
- }
-
- static void Main ()
- {
- A a = new A ();
- a.B = "foo";
- string b = a.B;
- }
-}
+++ /dev/null
-// CS0272: The property or indexer `Test.A.B' cannot be used in this context because the set accessor is inaccessible
-// Line: 16
-
-using System;
-
-public class Test
-{
- private class A
- {
- public string B { get; private set; }
- }
-
- static void Main ()
- {
- A a = new A ();
- a.B = "Foo";
- }
-}
+++ /dev/null
-// gcs0281.cs: Friend access was granted to `gcs0281, PublicKeyToken=27576a8182a18822', but the output assembly is named `gcs0281, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Try adding a reference to `gcs0281, PublicKeyToken=27576a8182a18822' or change the output assembly name to match it
-// Line: 0
-// Compiler options: -r:CSFriendAssembly-lib.dll
-
-using System;
-
-public class Test
-{
- static void Main ()
- {
- FriendClass.MyMethod ();
- }
-}
-
+++ /dev/null
-// CS0304: Cannot create an instance of the variable type `T' because it does not have the new() constraint
-// Line: 8
-
-public class Foo<T>
-{
- public T Create ()
- {
- return new T ();
- }
-}
-
-class X
-{
- static void Main ()
- {
- }
-}
+++ /dev/null
-// CS0305: Using the generic type `Stack<T>' requires `1' type argument(s)
-// Line: 11
-
-class Stack<T> {
-}
-
-class Test {
-}
-
-class T {
- Stack<Test,Test> a;
-
- static void Main()
- {
- }
-}
+++ /dev/null
-// CS0305: Using the generic type `Stack<T>' requires `1' type argument(s)
-// Line: 9
-
-class Stack<T>
-{ }
-
-class X
-{
- Stack stack;
-}
+++ /dev/null
-// CS0305: Using the generic type `A.B<T>' requires `1' type argument(s)
-// Line: 12
-
-class A
-{
- class B<T>
- {
- }
-
- static void Main()
- {
- B b = new B<A>();
- }
-}
+++ /dev/null
-// CS0305: Using the generic method `C.Test<T,Y>(C.Func<T>)' requires `2' type argument(s)
-// Line: 14
-
-public class C
-{
- public delegate int Func<T> (T t);
-
- public static void Test<T, Y> (Func<T> f)
- {
- }
-
- public static void Main ()
- {
- Test<int> (delegate (int i) { return i; });
- }
-}
+++ /dev/null
-// CS0305: Using the generic type `System.Collections.Generic.List<T>' requires `1' type argument(s)
-// Line: 8
-
-using System.Collections.Generic;
-
-class X
-{
- List<int,long> list;
-}
+++ /dev/null
-// CS0305: Using the generic method `X.G<T>()' requires `1' type argument(s)
-// Line: 17
-
-using System;
-
-delegate int E ();
-
-class X
-{
- public static T G<T> ()
- {
- throw new ArgumentException ();
- }
-
- static void Main ()
- {
- E e2 = new E (G);
- }
-}
+++ /dev/null
-// CS0305: Using the generic type `N1.A<T>' requires `1' type argument(s)
-// Line: 12
-namespace N1
-{
- class A<T>
- {
- }
-}
-
-namespace N3
-{
- using W = N1.A;
-
- class X
- {
- static void Main ()
- {
- }
- }
-}
+++ /dev/null
-// CS0306: The type `int*' may not be used as a type argument
-// Line: 11
-// Compiler options: -unsafe
-
-using System.Linq;
-
-public class C
-{
- public static unsafe void Main ()
- {
- var e = from int* a in "aaa"
- select a;
- }
-}
+++ /dev/null
-// CS0306: The type `System.ArgIterator' may not be used as a type argument
-// Line: 6
-
-class G<T> {}
-
-class C : G<System.ArgIterator>
-{
-}
+++ /dev/null
-// gcs0306.cs: The type `char*' may not be used as a type argument
-// Line: 9
-// Compiler options: -unsafe
-
-class F<U> {}
-unsafe class O {
- F<char *> f;
- static void Main () {}
-}
+++ /dev/null
-// CS0307: The namespace `N.M' cannot be used with type arguments
-// Line: 15
-
-namespace N
-{
- namespace M
- {
- }
-}
-
-class Test
-{
- static void Main ()
- {
- var a = N.M<int> ();
- }
-}
+++ /dev/null
-// CS0307: The variable `a' cannot be used with type arguments
-// Line: 9
-
-public class Tests
-{
- public static void Test (int a)
- {
- a<int> ();
- }
-}
+++ /dev/null
-// CS0307: The variable `d' cannot be used with type arguments
-// Line: 9
-
-public class Tests
-{
- public static void Main ()
- {
- var d = 0;
- d<int> ();
- }
-}
+++ /dev/null
-// CS0307: The property `Test<T,U>.Value' cannot be used with type arguments
-// Line: 16
-
-class Test<T, U>
-{
- public object Value {
- get { return null; }
- }
-
- public class B
- {
- public B (object arg)
- {
- }
-
- public static B Default = new B (Value<U>.Default);
- }
-}
+++ /dev/null
-// CS0307: The variable `a' cannot be used with type arguments
-// Line: 9
-
-public class Tests
-{
- public static void Test<a> ()
- {
- a<int> ();
- }
-}
+++ /dev/null
-// CS0307: The property `B.Get' cannot be used with type arguments
-// Line: 14
-public class B
-{
- public virtual int Get {
- get { return 3; }
- }
-}
-
-public class A : B
-{
- public override int Get {
- get {
- return base.Get<int>;
- }
- }
-
- public static void Main ()
- {
- }
-}
+++ /dev/null
-// CS0308: The non-generic type `NamingContext' cannot be used with the type arguments
-// Line: 6
-
-class Program
-{
- static NamingContext<int> Lookup ()
- {
- return null;
- }
-}
-
-class NamingContext
-{
-}
\ No newline at end of file
+++ /dev/null
-// CS0308: The non-generic type `System.DateTime' cannot be used with the type arguments
-// Line: 8
-
-using System;
-
-class X
-{
- DateTime<int> now;
-}
+++ /dev/null
-// CS0308: The non-generic type `Stack' cannot be used with the type arguments
-// Line: 9
-
-class Stack
-{ }
-
-class X
-{
- Stack<float> stack;
-}
+++ /dev/null
-// CS0308: The non-generic method `X.Foo()' cannot be used with the type arguments
-// Line: 12
-
-class X
-{
- public void Foo ()
- {
- }
-
- void Test ()
- {
- Foo<int> ();
- }
-}
+++ /dev/null
-// CS0308: The non-generic type `BaseGeneric<T>.InnerDerived' cannot be used with the type arguments
-// Line: 19
-
-class BaseGeneric<T>
-{
- public class InnerDerived
- {
- }
-}
-
-class BaseConcrete : BaseGeneric<string>
-{
-}
-
-class Program
-{
- static void Main ()
- {
- new BaseConcrete.InnerDerived<int>();
- }
-}
+++ /dev/null
-// CS0308: The non-generic type `Foo' cannot be used with the type arguments
-// Line: 16
-
-public class Foo
-{
- public string Test<T> ()
- {
- return null;
- }
-}
-
-public static class Driver
-{
- static object UseBrokenType ()
- {
- return Foo<int> ().Test ();
- }
-}
+++ /dev/null
-// CS0308: The non-generic type `N1.A' cannot be used with the type arguments
-// Line: 11
-namespace N1
-{
- class A
- { }
-}
-
-namespace N3
-{
- using W = N1.A<int>;
-
- class X
- {
- static void Main ()
- {
- }
- }
-}
+++ /dev/null
-// CS0310: The type `A' must have a public parameterless constructor in order to use it as parameter `T' in the generic type or method `Foo<T>'
-// Line: 20
-
-public class Foo<T>
- where T : new ()
-{
-}
-
-class A
-{
- private A ()
- { }
-}
-
-class X
-{
- static void Main ()
- {
- object o = new Foo<A> ();
- }
-}
+++ /dev/null
-// CS0310: The type `A' must have a public parameterless constructor in order to use it as parameter `T' in the generic type or method `Foo<T>'
-// Line: 18
-
-public class Foo<T>
- where T : new ()
-{
-}
-
-abstract class A
-{
- public A ()
- { }
-}
-
-class X
-{
- Foo<A> foo;
-
- static void Main ()
- {
- }
-}
+++ /dev/null
-// CS0310: The type `Foo' must have a public parameterless constructor in order to use it as parameter `a' in the generic type or method `C<a>'
-// Line: 14
-class C <a> where a : new () {
-}
-
-class Foo {
- public Foo (int x) { }
-}
-
-class X
-{
- static void Main ()
- {
- C<Foo> x;
- }
-}
-
-
+++ /dev/null
-// CS0310: The type `string' must have a public parameterless constructor in order to use it as parameter `T' in the generic type or method `Program.Ret<T>()'
-// Line: 10
-
-public static class Program
-{
- static void Main ()
- {
- Ret<string> ();
- }
-
- static T Ret<T> () where T : new ()
- {
- return new T ();
- }
-}
+++ /dev/null
-// CS0310: The type `A' must have a public parameterless constructor in order to use it as parameter `T' in the generic type or method `Foo<T>'
-// Line: 18
-
-public class Foo<T>
- where T : new ()
-{
-}
-
-class A
-{
- private A ()
- { }
-}
-
-class X
-{
- Foo<A> foo;
-
- static void Main ()
- {
- }
-}
+++ /dev/null
-// CS031: The type `B' cannot be used as type parameter `T' in the generic type or method `Foo<T>'. There is no implicit reference conversion from `B' to `I'
-// Line: 21
-
-public class Foo<T>
- where T : A, I
-{
-}
-
-public interface I
-{ }
-
-public class A
-{ }
-
-public class B : A
-{ }
-
-class X
-{
- Foo<B> foo;
-
- static void Main ()
- {
- }
-}
+++ /dev/null
-// CS0311: The type `B' cannot be used as type parameter `T' in the generic type or method `Foo<T>'. There is no implicit reference conversion from `B' to `A'
-// Line: 35
-using System;
-
-public class Foo<T>
- where T : A
-{
- public void Test (T t)
- {
- Console.WriteLine (t);
- Console.WriteLine (t.GetType ());
- t.Hello ();
- }
-}
-
-public class A
-{
- public void Hello ()
- {
- Console.WriteLine ("Hello World");
- }
-}
-
-public class B
-{
- public static implicit operator A (B b)
- {
- return new A ();
- }
-}
-
-class X
-{
- Foo<B> b;
-
- static void Main ()
- {
- }
-}
+++ /dev/null
-// CS0311: The type `B<int>' cannot be used as type parameter `X' in the generic type or method `C<X>'. There is no implicit reference conversion from `B<int>' to `D<B<int>>'
-// Line: 3
-class A : C<B<int>> {}
-class B<X> {}
-interface C<X> where X : D<X> {}
-interface D<X> {}
+++ /dev/null
-// CS0311: The type `object' cannot be used as type parameter `U' in the generic type or method `G<C>.Method<U>()'. There is no implicit reference conversion from `object' to `C'
-// Line: 9
-
-public class C
-{
- public static void Main ()
- {
- var mc = new G<C> ();
- mc.Method<object> ();
- }
-}
-
-public class G<T> where T : C
-{
- public void Method<U> () where U : T
- {
- }
-}
+++ /dev/null
-// CS0311: The type `B' cannot be used as type parameter `T' in the generic type or method `Foo<T>'. There is no implicit reference conversion from `B' to `A'
-// Line: 19
-
-public class Foo<T>
- where T : A
-{
-}
-
-public class A
-{
-}
-
-public class B
-{
-}
-
-class X
-{
- Foo<B> foo;
-
- static void Main ()
- {
- }
-}
+++ /dev/null
-// CS0313: The type `S?' cannot be used as type parameter `T' in the generic type or method `S.Foo<T>(T)'. The nullable type `S?' never satisfies interface constraint
-// Line: 16
-
-interface I
-{
-}
-
-struct S : I
-{
- static void Foo<T> (T t) where T : I
- {
- }
-
- static void Test (S? s)
- {
- Foo (s);
- }
-}
+++ /dev/null
-// CS0314: The type `T' cannot be used as type parameter `T' in the generic type or method `IB<K,T>'. There is no boxing or type parameter conversion from `T' to `System.IDisposable'
-// Line: 20
-
-public interface IA<K>
- where K : System.IComparable, System.IComparable<K>
-{
-}
-
-public class A<K> : IA<K>
- where K : System.IComparable, System.IComparable<K>
-{
-}
-
-public interface IB<K,T>
- where T : System.IDisposable
-{
-}
-
-public class B<K,T> : IB<K,T>
- where T : B<K,T>.Element, new()
- where K : System.IComparable, System.IComparable<K>
-{
- public abstract class Element : A<K>
- {
- }
-}
-
-
-
-
+++ /dev/null
-// CS0314: The type `U' cannot be used as type parameter `T' in the generic type or method `A<T>'. There is no boxing or type parameter conversion from `U' to `System.IComparable'
-// Line: 13
-
-using System;
-
-class A<T>
- where T: IComparable
-{
-}
-
-class B<U,V>
- where V: A<U>
-{
-}
-
-class Driver
-{
- public static void Main ()
- {
- }
-}
+++ /dev/null
-// CS0315: The type `ushort' cannot be used as type parameter `T' in the generic type or method `A<T>'. There is no boxing conversion from `ushort' to `A<ushort>.N1<ushort>'
-// Line: 9
-// Compiler options: -r:GCS0315-2-lib.dll
-
-public class Test
-{
- public static void Main ()
- {
- A<ushort>.N1<ushort> a = null;
- }
-}
+++ /dev/null
-// CS0315: The type `int' cannot be used as type parameter `U' in the generic type or method `A<int?>.Test<U>()'. There is no boxing conversion from `int' to `int?'
-// Line: 19
-
-class A<T>
-{
- public static void Test<U> () where U : T
- {
- }
-}
-
-class B : A<int?>
-{
-}
-
-class Program
-{
- public static void Main ()
- {
- B.Test<int> ();
- }
-}
+++ /dev/null
-// CS0315: The type `int' cannot be used as type parameter `TEventArgs' in the generic type or method `System.EventHandler<TEventArgs>'. There is no boxing conversion from `int' to `System.EventArgs'
-// Line: 5
-
-class X {
- System.EventHandler <int> x;
- static void Main () {}
-}
-
-
+++ /dev/null
-// CS0401: The `new()' constraint must be the last constraint specified
-// Line: 4
-
-class Foo<T> where T : new (), new ()
-{
-}
+++ /dev/null
-// gcs0402-2.cs: `C.Main<T,U>()': an entry point cannot be generic or in a generic type
-// Line: 7
-// Compiler options: -warnaserror -warn:4
-
-class C
-{
- public static void Main<T, U> ()
- {
- }
-}
\ No newline at end of file
+++ /dev/null
-// gcs0402.cs: `TestClass<T>.Main()': an entry point cannot be generic or in a generic type
-// Line: 7
-// Compiler options: -warnaserror -warn:4
-
-class TestClass<T>
-{
- public static void Main ()
- {
- }
-}
\ No newline at end of file
+++ /dev/null
-// CS0403: Cannot convert null to the type parameter `T' because it could be a value type. Consider using `default (T)' instead
-// Line: 8
-
-struct S
-{
- public void Foo<T> () where T : struct
- {
- T t = null;
- }
-
- static void Main ()
- { }
-}
+++ /dev/null
-// CS0403: Cannot convert null to the type parameter `T' because it could be a value type. Consider using `default (T)' instead
-// Line: 8
-
-class X
-{
- public static T CreateMethod<T> ()
- {
- return (T)null;
- }
-}
+++ /dev/null
-// CS0403: Cannot convert null to the type parameter `T' because it could be a value type. Consider using `default (T)' instead
-// Line: 7
-class Test<T>
-{
- public T Null ()
- {
- return null;
- }
-}
-
-class X
-{
- static void Main ()
- { }
-}
+++ /dev/null
-// CS0404: '<' unexpected: attributes cannot be generic
-// Line: 3
-[Test<T>]
-class X
-{
- static void Main ()
- { }
-}
+++ /dev/null
-// gcs0405.cs: Duplicate constraint `I' for type parameter `T'
-// Line: 8
-
-interface I { }
-
-class Foo<T>
- where T : I, I
-{
-}
+++ /dev/null
-// CS0406: The class type constraint `A' must be listed before any other constraints. Consider moving type constraint to the beginning of the constraint list
-// Line: 7
-
-class A { }
-interface I { }
-
-class Foo<T> where T : I, A
-{
-}
+++ /dev/null
-// CS0406: The class type constraint `B' must be listed before any other constraints. Consider moving type constraint to the beginning of the constraint list
-// Line: 8
-
-class A { }
-class B { }
-
-class Foo<T>
- where T : A, B
-{
-}
+++ /dev/null
-// gcs0409.cs: A constraint clause has already been specified for type parameter `U'
-// Line: 7
-
-class C<T, U> where U: class, new() where U: new()
-{
-}
+++ /dev/null
-// CS0411: The type arguments for method `C.Foo<T>(T)' cannot be inferred from the usage. Try specifying the type arguments explicitly
-// Line: 14
-// Compiler options: -unsafe
-
-class C
-{
- static void Foo<T> (T t)
- {
- }
-
- unsafe static void Test ()
- {
- int* i = null;
- Foo (i);
- }
-}
+++ /dev/null
-// CS0411: The type arguments for method `C.Foo<T>(I<T>)' cannot be inferred from the usage. Try specifying the type arguments explicitly
-// Line: 17
-
-interface I<T>
-{
-}
-
-class C : I<long>, I<int>
-{
- static void Foo<T> (I<T> i)
- {
- }
-
- static void Main ()
- {
- C c = new C ();
- Foo (c);
- }
-}
+++ /dev/null
-// CS0411: The type arguments for method `Foo<U>.DoSomething<U>(System.Func<U,U>)' cannot be inferred from the usage. Try specifying the type arguments explicitly
-// Line: 15
-
-using System;
-
-public class Foo<T>
-{
- public void DoSomething<U> (Func<U, T> valueExpression) { }
-}
-
-public class Bar
-{
- protected void DoAnything<T, U> (U value)
- {
- new Foo<U> ().DoSomething (value);
- }
-}
+++ /dev/null
-// CS0411: The type arguments for method `C.Foo<T>(T[], T[])' cannot be inferred from the usage. Try specifying the type arguments explicitly
-// Line: 12
-
-class C
-{
- public static void Foo<T> (T[] t1, T[] t2)
- {
- }
-
- public static void Main ()
- {
- Foo (new int[0], new byte[0]);
- }
-}
+++ /dev/null
-// CS0411: The type arguments for method `C.Foo<T>(ref T, ref T)' cannot be inferred from the usage. Try specifying the type arguments explicitly
-// Line: 14
-
-class C
-{
- public static void Foo<T> (ref T t1, ref T t2)
- {
- }
-
- public static void Main ()
- {
- string s = "a";
- object o = null;
- Foo (ref s, ref o);
- }
-}
+++ /dev/null
-// CS0411: The type arguments for method `C.Foo<T>(IFoo<T>, IFoo<T>)' cannot be inferred from the usage. Try specifying the type arguments explicitly
-// Line: 18
-// Compiler options: -langversion:future
-
-interface IFoo<in T>
-{
-}
-
-class C
-{
- public static void Foo<T> (IFoo<T> e1, IFoo<T> e2)
- {
- }
-
- public static void Main ()
- {
- IFoo<int> a = null;
- IFoo<object> b = null;
- Foo (a, b);
- }
-}
+++ /dev/null
-// CS0411: The type arguments for method `M.Foo<T>(System.Func<T>)' cannot be inferred from the usage. Try specifying the type arguments explicitly
-// Line: 14
-
-using System;
-
-class M
-{
- static void Foo<T> (Func<T> t)
- {
- }
-
- public static void Main ()
- {
- Foo (delegate { throw new Exception("foo"); });
- }
-}
+++ /dev/null
-// CS0411: The type arguments for method `C.Test<T>(System.Func<T>)' cannot be inferred from the usage. Try specifying the type arguments explicitly
-// Line: 14
-
-using System;
-
-interface IB
-{
-}
-
-class C
-{
- public static void Main ()
- {
- Test (() => { if (true) return (C) null; return (IB) null; });
- }
-
- static void Test<T> (Func<T> f)
- {
- }
-}
+++ /dev/null
-// CS0411: The type arguments for method `Test<float>.Foo<V,W>(V, V)' cannot be inferred from the usage. Try specifying the type arguments explicitly
-// Line: 15
-
-class Test<A>
-{
- public void Foo<V,W> (V v, V w)
- { }
-}
-
-class X
-{
- static void Main ()
- {
- Test<float> test = new Test<float> ();
- test.Foo (8, 9);
- }
-}
-
+++ /dev/null
-// CS0411: The type arguments for method `C.Foo<T>(T)' cannot be inferred from the usage. Try specifying the type arguments explicitly
-// Line: 12
-
-class C
-{
- static void X ()
- {
- }
-
- static void Foo<T> (T t)
- {
- Foo(X ());
- }
-}
+++ /dev/null
-// CS0411: The type arguments for method `Hello.World<U>(IFoo<U>)' cannot be inferred from the usage. Try specifying the type arguments explicitly
-// Line: 16
-public interface IFoo<T>
-{ }
-
-public class Foo : IFoo<int>, IFoo<string>
-{ }
-
-public class Hello
-{
- public void World<U> (IFoo<U> foo)
- { }
-
- public void Test (Foo foo)
- {
- World (foo);
- }
-}
-
-class X
-{
- static void Main ()
- {
- }
-}
+++ /dev/null
-// CS0411: The type arguments for method `Hello.World<U>(U, IFoo<U>)' cannot be inferred from the usage. Try specifying the type arguments explicitly
-// Line: 16
-public interface IFoo<T>
-{ }
-
-public class Foo : IFoo<int>, IFoo<string>
-{ }
-
-public class Hello
-{
- public void World<U> (U u, IFoo<U> foo)
- { }
-
- public void Test (Foo foo)
- {
- World ("Canada", foo);
- }
-}
-
-class X
-{
- static void Main ()
- {
- }
-}
+++ /dev/null
-// CS0411: The type arguments for method `C.Foo<T>(T, System.Collections.Generic.Comparer<T>)' cannot be inferred from the usage. Try specifying the type arguments explicitly
-// Line: 20
-
-using System;
-using System.Collections.Generic;
-
-public class C
-{
- static void Foo<T>(T t, Comparer<T> tc)
- {
- }
-
- static int Compare (int a, int b)
- {
- return -1;
- }
-
- public static void Main ()
- {
- Foo (1, Compare);
- }
-}
+++ /dev/null
-// CS0411: The type arguments for method `C.Test<TR,TA>(C.Func<TR,TA>, C.Func<TR,TA>)' cannot be inferred from the usage. Try specifying the type arguments explicitly
-// Line: 16
-
-
-public class C
-{
- public delegate T1 Func<T1, T2> (T2 t);
-
- public static TR Test<TR, TA> (Func<TR, TA> f, Func<TR, TA> f2)
- {
- return default (TR);
- }
-
- public static void Main()
- {
- int s = Test (delegate (int i) { return 0; }, delegate (int i) { return "a"; });
- }
-}
\ No newline at end of file
+++ /dev/null
-// CS0411: The type arguments for method `Test.Foo<A>(D<A>)' cannot be inferred from the usage. Try specifying the type arguments explicitly
-// Line: 15
-
-delegate void D<T> (T t);
-
-class Test
-{
- public static D<A> Foo<A> (D<A> a)
- {
- return null;
- }
-
- public static void Main ()
- {
- Foo (delegate {});
- }
-}
-
+++ /dev/null
-// CS0411: The type arguments for method `Test<float>.Foo<V>(V, V)' cannot be inferred from the usage. Try specifying the type arguments explicitly
-// Line: 15
-
-class Test<A>
-{
- public void Foo<V> (V v, V w)
- { }
-}
-
-class X
-{
- static void Main ()
- {
- Test<float> test = new Test<float> ();
- test.Foo (8, "Hello World");
- }
-}
-
+++ /dev/null
-// CS0412: The type parameter name `T' is the same as local variable or parameter name
-// Line: 8
-
-using System;
-
-interface I
-{
- T Foo<T>(IComparable T);
-}
+++ /dev/null
-// CS0412: The type parameter name `T' is the same as local variable or parameter name
-// Line: 8
-
-class C
-{
- public void Foo<T> (int value)
- {
- int T;
- }
-}
+++ /dev/null
-// CS0412: The type parameter name `T' is the same as local variable or parameter name
-// Line: 6
-
-class C
-{
- public void Foo<T> (string T)
- {
- }
-}
+++ /dev/null
-// CS0413: The `as' operator cannot be used with a non-reference type parameter `T'. Consider adding `class' or a reference type constraint
-// Line: 8
-
-public class SomeClass {
-}
-
-public class Foo<T> where T : struct {
- public T Do (object o) { return o as T; }
-}
-
-class Driver {
- static void Main ()
- {
- Foo<SomeClass> f = new Foo<SomeClass> ();
- f.Do ("something");
- }
-}
-
+++ /dev/null
-// CS0413: The `as' operator cannot be used with a non-reference type parameter `T'. Consider adding `class' or a reference type constraint
-// Line: 7
-
-public class SomeClass {}
-
-public class Foo<T> {
- public T Do (object o) { return o as T; }
-}
-
-class Driver {
- static void Main ()
- {
- Foo<SomeClass> f = new Foo<SomeClass> ();
- f.Do ("something");
- }
-}
-
+++ /dev/null
-// cs0414.cs: The private field `X.i' is assigned but its value is never used
-// Line: 6
-// Compiler options: -warnaserror -warn:3
-
-class X {
- int i = 3;
-
- public void Y ()
- {
- }
-}
+++ /dev/null
-// CS0416: `N.C<T>': an attribute argument cannot use type parameters
-// Line: 15
-
-using System;
-
-public class TestAttribute : Attribute
-{
- object type;
-
- public object Type
- {
- get
- {
- return type;
- }
- set
- {
- type = value;
- }
- }
-}
-
-namespace N
-{
- class C<T>
- {
- [Test(Type=typeof(C<T>))]
- public void Foo()
- {
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-// CS0416: `C<T>.N': an attribute argument cannot use type parameters
-// Line: 17
-
-using System;
-
-public class TestAttribute : Attribute
-{
- public TestAttribute(Type type)
- {
- }
-}
-
-class C<T>
-{
- class N
- {
- [Test(typeof(N))]
- public static void Foo()
- {
- }
- }
-}
+++ /dev/null
-// CS0416: `C<T>': an attribute argument cannot use type parameters
-// Line: 15
-
-using System;
-
-public class TestAttribute : Attribute
-{
- public TestAttribute(Type type)
- {
- }
-}
-
-class C<T>
-{
- [Test(typeof(C<T>))]
- public static void Foo()
- {
- }
-}
\ No newline at end of file
+++ /dev/null
-// CS0417.cs: `T': cannot provide arguments when creating an instance of a variable type
-// Line: 9
-
-public class Foo<T>
- where T : new ()
-{
- public T Create ()
- {
- return new T (8);
- }
-}
-
-class X
-{
- static void Main ()
- {
- }
-}
+++ /dev/null
-// CS0425: The constraints for type parameter `V' of method `Foo<T>.Test<V>()' must match the constraints for type parameter `U' of interface method `IFoo<T>.Test<U>()'. Consider using an explicit interface implementation instead
-// Line: 13
-interface IFoo<T>
-{
- void Test<U> ()
- where U : T;
-}
-
-class Foo<T> : IFoo<T>
-{
- public void Test<V> ()
- where V :X
- { }
-}
-
-class X
-{
- static void Main ()
- { }
-}
+++ /dev/null
-// CS0425: The constraints for type parameter `T' of method `C.Foo<T>()' must match the constraints for type parameter `T' of interface method `I.Foo<T>()'. Consider using an explicit interface implementation instead
-// Line: 11
-
-interface I
-{
- void Foo<T> ();
-}
-
-class C : I
-{
- public void Foo<T> () where T : struct
- {
- }
-}
+++ /dev/null
-// CS0425: The constraints for type parameter `T' of method `Test.Baz.Method<T,V>()' must match the constraints for type parameter `T' of interface method `Test.IBar.Method<T,V>()'. Consider using an explicit interface implementation instead
-// Line: 18
-namespace Test
-{
- using System;
-
- public interface IFoo
- {
- }
-
- public interface IBar
- {
- void Method<T, V>() where T : IFoo where V : T;
- }
-
- public class Baz : IBar
- {
- public void Method<T, V>() where T : IBar where V : T
- {
- }
- }
-}
+++ /dev/null
-// CS0425: The constraints for type parameter `V' of method `Foo<T,X>.Test<V>()' must match the constraints for type parameter `U' of interface method `IFoo<T>.Test<U>()'. Consider using an explicit interface implementation instead
-// Line: 11
-
-interface IFoo<T>
-{
- void Test<U> () where U : T;
-}
-
-class Foo<T, X> : IFoo<T>
-{
- public void Test<V> () where V : X
- {
- }
-}
+++ /dev/null
-// CS0425: The constraints for type parameter `V' of method `Foo<T>.Test<V>()' must match the constraints for type parameter `U' of interface method `IFoo<T>.Test<U>()'. Consider using an explicit interface implementation instead
-// Line: 12
-interface IFoo<T>
-{
- void Test<U> ()
- where U : T;
-}
-
-class Foo<T> : IFoo<T>
-{
- public void Test<V> ()
- { }
-}
-
-class X
-{
- static void Main ()
- { }
-}
+++ /dev/null
-// CS0428: Cannot convert method group `Count' to non-delegate type `int'. Consider using parentheses to invoke the method
-// Line: 11
-
-using System.Linq;
-
-public class A
-{
- public A ()
- {
- string [] test = new string [5];
- A [] array = new A [test.Count];
- }
-}
+++ /dev/null
-// CS0449: The `class' or `struct' constraint must be the first constraint specified
-// Line: 8
-
-public interface I
-{
-}
-
-public class C<T> where T : I, class
-{
-}
\ No newline at end of file
+++ /dev/null
-// CS0449: The `class' or `struct' constraint must be the first constraint specified
-// Line: 6
-
-public class C<T>
-{
- public void Foo<T>() where T : class, struct
- {
- }
-}
\ No newline at end of file
+++ /dev/null
-// CS0449: The `class' or `struct' constraint must be the first constraint specified
-// Line: 6
-
-interface I
-{
- void Foo<T> () where T : class, struct;
-}
+++ /dev/null
-// CS0450: `A<bool,int>': cannot specify both a constraint class and the `class' or `struct' constraint
-// Line: 8
-
-class A<T, U>
-{
-}
-
-delegate void Test<T>() where T : struct, A<bool, int>;
+++ /dev/null
-// CS0450: `A': cannot specify both a constraint class and the `class' or `struct' constraint
-// Line: 8
-
-class A
-{
-}
-
-class B<T> where T : class, A
-{
-}
+++ /dev/null
-// CS0451: The `new()' constraint cannot be used with the `struct' constraint
-// Line: 6
-
-class C
-{
- public static void Foo<T>() where T : struct, new ()
- {
- }
-}
+++ /dev/null
-// CS0452: The type `int' must be a reference type in order to use it as type parameter `T' in the generic type or method `Foo.Test<T>(ref T)'
-// Line: 14
-public class Foo
-{
- public static void Test<T> (ref T t)
- where T : class
- { }
-}
-
-public class C {
- public static void Main ()
- {
- int i = 0;
- Foo.Test<int> (ref i);
- }
-}
+++ /dev/null
-// CS0452: The type `int' must be a reference type in order to use it as type parameter `T' in the generic type or method `TestClass<T>'
-// Line: 23
-using System;
-
-public class TestClass<T> where T : class
-{
- static public T meth()
- {
- return null;
- }
-
- static public T Value;
-}
-
-public class Test
-{
- public Test()
- {
- }
-
- static public void Main()
- {
- int i = TestClass<int>.meth();
- Console.WriteLine (i);
- }
-}
+++ /dev/null
-// CS0452: The type `int' must be a reference type in order to use it as type parameter `T' in the generic type or method `TestClass<T>'
-// Line: 23
-using System;
-
-public class TestClass<T> where T : class
-{
- static public T meth()
- {
- return null;
- }
-
- static public T Value;
-}
-
-public class Test
-{
- public Test()
- {
- }
-
- static public void Main()
- {
- int j = TestClass<int>.Value;
- Console.WriteLine (j);
- }
-}
+++ /dev/null
-// CS0452: The type `Foo' must be a reference type in order to use it as type parameter `T' in the generic type or method `MyObject<T>'
-// Line: 13
-public class MyObject<T>
- where T : class
-{ }
-
-struct Foo
-{ }
-
-class X
-{
- MyObject<Foo> foo;
-
- static void Main ()
- { }
-}
+++ /dev/null
-// CS0453: The type `Foo' must be a non-nullable value type in order to use it as type parameter `T' in the generic type or method `System.Nullable<T>'
-// Line: 10
-public class Foo
-{ }
-
-class X
-{
- static void Main ()
- {
- Foo? foo = new Foo ();
- }
-}
+++ /dev/null
-// CS0453: The type `Bar?' must be a non-nullable value type in order to use it as type parameter `T' in the generic type or method `Foo<T>'
-// Line: 14
-public class Foo<T>
- where T : struct
-{ }
-
-public struct Bar
-{ }
-
-class X
-{
- static void Main ()
- {
- Foo<Bar?> foo;
- }
-}
+++ /dev/null
-// CS0453: The type `T' must be a non-nullable value type in order to use it as type parameter `T' in the generic type or method `System.Nullable<T>'
-// Line: 14
-
-using System;
-
-public static class Nullable_Test {
- public static int Compare<T> (Nullable<T> left)
- {
- return 0;
- }
-}
\ No newline at end of file
+++ /dev/null
-// CS0453: The type `B.M' must be a non-nullable value type in order to use it as type parameter `T' in the generic type or method `Foo.Test_2<T>(this T)'
-// Line: 20
-
-
-using System;
-
-public static class Foo
-{
- public static string Test_2<T> (this T s) where T : struct
- {
- return null;
- }
-}
-
-namespace B
-{
- public class M
- {
- public static void Main ()
- {
- new M().Test_2();
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-// CS0453: The type `X' must be a non-nullable value type in order to use it as type parameter `T' in the generic type or method `MyValue<T>'
-// Line: 10
-public class MyValue<T>
- where T : struct
-{ }
-
-class X
-{
- MyValue<X> x;
-
- static void Main ()
- { }
-}
+++ /dev/null
-// CS0454: Circular constraint dependency involving `T' and `U'
-// Line: 7
-using System;
-
-class Foo<T,U>
- where T : U
- where U : T
-{ }
-
-class X
-{
- static void Main ()
- { }
-}
+++ /dev/null
-// CS0455: Type parameter `V' inherits conflicting constraints `B' and `A'
-// Line: 13
-
-class A
-{ }
-
-class B
-{ }
-
-class Foo<T,U, V>
- where T : A
- where U : B
- where V : U, T
-{
-}
+++ /dev/null
-// CS0455: Type parameter `T' inherits conflicting constraints `System.ValueType' and `Test'
-// Line: 8
-
-class Test
-{ }
-
-class Foo<T,U>
- where T : struct, U
- where U : Test
-{ }
+++ /dev/null
-// CS0455: Type parameter `Y' inherits conflicting constraints `long' and `long?'
-// Line: 11
-
-abstract class A<T1, T2>
-{
- public abstract void Foo<U> () where U : T1, T2;
-}
-
-class B : A<long, long?>
-{
- public override void Foo<Y> ()
- {
- }
-}
+++ /dev/null
-// CS0455: Type parameter `Y' inherits conflicting constraints `class' and `long'
-// Line: 11
-
-abstract class A<T>
-{
- public abstract void Foo<U> () where U : class, T;
-}
-
-class B : A<long>
-{
- public override void Foo<Y> ()
- {
- }
-}
+++ /dev/null
-// CS0455: Type parameter `T' inherits conflicting constraints `Test' and `World'
-// Line: 11
-
-class Test
-{ }
-
-class World
-{ }
-
-class Foo<T,U>
- where T : Test, U
- where U : World
-{ }
+++ /dev/null
-// CS0456: Type parameter `U' has the `struct' constraint, so it cannot be used as a constraint for `T'
-// Line: 7
-using System;
-
-class Foo<T,U>
- where T : U
- where U : struct
-{ }
-
-class X
-{
- static void Main ()
- { }
-}
+++ /dev/null
-// CS0458: The result of the expression is always `null' of type `bool?'
-// Line: 8
-// Compiler options: -warnaserror -warn:2
-
-class C
-{
- static void Foo()
- {
- bool? b = false | null;
- }
-}
+++ /dev/null
-// CS0458: The result of the expression is always `null' of type `ulong?'
-// Line: 10
-// Compiler options: -warnaserror -warn:2
-
-class C
-{
- static void Foo()
- {
- ulong a = 100;
- var res = a << null;
- }
-}
+++ /dev/null
-// CS0458: The result of the expression is always `null' of type `int?'
-// Line: 9
-// Compiler options: -warnaserror -warn:2
-
-class C
-{
- static void Foo()
- {
- var res = null >> 2;
- }
-}
+++ /dev/null
-// CS0458: The result of the expression is always `null' of type `int?'
-// Line: 9
-// Compiler options: -warnaserror -warn:2
-
-class C
-{
- static void Foo()
- {
- var res = null << 2;
- }
-}
+++ /dev/null
-// CS0458: The result of the expression is always `null' of type `int?'
-// Line: 8
-// Compiler options: -warnaserror -warn:2
-
-public class MainClass
-{
- public static void Main()
- {
- object d = (int?)null as int?;
- }
-}
-
+++ /dev/null
-// CS0458: The result of the expression is always `null' of type `int?'
-// Line: 8
-// Compiler options: -warnaserror -warn:2
-
-class C
-{
- static void Main ()
- {
- int? i = 2;
- i *= null;
- }
-}
+++ /dev/null
-// CS0458: The result of the expression is always `null' of type `int?'
-// Line: 8
-// Compiler options: -warnaserror -warn:2
-
-class C
-{
- static void Main ()
- {
- ushort us = 22;
- int? r = us << null;
- }
-}
+++ /dev/null
-// CS0458: The result of the expression is always `null' of type `E?'
-// Line: 15
-// Compiler options: -warnaserror -warn:2
-
-enum E
-{
- V
-}
-
-public class C
-{
- public static void Main ()
- {
- E e = E.V;
- object o = e + null;
- }
-}
+++ /dev/null
-// CS0458: The result of the expression is always `null' of type `int?'
-// Line: 15
-// Compiler options: -warnaserror -warn:2
-
-enum E
-{
- V
-}
-
-public class C
-{
- public static void Main ()
- {
- E e = E.V;
- object o = null - e;
- }
-}
+++ /dev/null
-// CS0472: The result of the expression is always `null' of type `MyEnum?'
-// Line: 17
-// Compiler options: -warnaserror -warn:2
-
-using System;
-
-enum MyEnum
-{
- Value_1
-}
-
-class C
-{
- public static void Main ()
- {
- var d = MyEnum.Value_1;
- var x = d & null;
- }
-}
+++ /dev/null
-// CS0458: The result of the expression is always `null' of type `E?'
-// Line: 15
-// Compiler options: -warnaserror -warn:2
-
-enum E
-{
- V
-}
-
-public class C
-{
- public static void Main ()
- {
- E e = E.V;
- object o = null + e;
- }
-}
+++ /dev/null
-// CS0458: The result of the expression is always `null' of type `int?'
-// Line: 9
-// Compiler options: -warnaserror -warn:2
-
-public class C
-{
- public static void Main ()
- {
- b = (null & 0) != null;
- }
-}
+++ /dev/null
-// CS0458: The result of the expression is always `null' of type `bool?'
-// Line: 8
-// Compiler options: -warnaserror -warn:2
-
-class C
-{
- static void Foo()
- {
- bool? b = null as bool?;
- }
-}
+++ /dev/null
-// CS0460: `C.Test<T>()': Cannot specify constraints for overrides and explicit interface implementation methods
-// Line: 11
-
-abstract class A
-{
- protected abstract int Test<T>() where T : class;
-}
-
-class C : A
-{
- protected override int Test<T>() where T : new()
- {
- }
-}
+++ /dev/null
-// CS0460: `C.I.Test<C>()': Cannot specify constraints for overrides and explicit interface implementation methods
-// Line: 11
-
-interface I
-{
- void Test<T>() where T : new ();
-}
-
-class C : I
-{
- void I.Test<C>() where C : class
- {
- }
-}
+++ /dev/null
-// CS0464: The result of comparing type `int?' with null is always `false'
-// Line: 9
-// Compiler options: -warnaserror -warn:2
-
-public class X
-{
- public static bool Compute (int? x)
- {
- return x >= null;
- }
-}
+++ /dev/null
-// CS0464: The result of comparing type `int?' with null is always `false'
-// Line: 9
-// Compiler options: -warnaserror -warn:2
-
-public class X
-{
- public static bool Compute ()
- {
- return null >= null;
- }
-}
+++ /dev/null
-// CS0464: The result of comparing type `int' with null is always `false'
-// Line: 9
-// Compiler options: -warnaserror -warn:2
-
-public class X
-{
- public static bool Compute (int x)
- {
- return x < null;
- }
-}
+++ /dev/null
-// CS0472: The result of comparing value type `int' with null is `false'
-// Line: 8
-// Compiler options: -warnaserror -warn:2
-
-public class X {
- public static bool Compute (int x)
- {
- return x == null;
- }
-}
+++ /dev/null
-// CS0472: The result of comparing value type `int' with null is `true'
-// Line: 9
-// Compiler options: -warnaserror -warn:2
-
-public class X
-{
- public static void Compute (int x)
- {
- if (true && x != null)
- return;
- }
-}
+++ /dev/null
-// CS0472: The result of comparing value type `int' with null is `false'
-// Line: 9
-// Compiler options: -warnaserror -warn:2
-
-class C
-{
- public static void Main ()
- {
- System.Console.WriteLine(5 == (long?)null);
- }
-}
+++ /dev/null
-// CS0472: The result of comparing value type `int' with null is `true'
-// Line: 8
-// Compiler options: -warnaserror -warn:2
-
-public class X {
- public static bool Compute (int x)
- {
- return x != null;
- }
-}
+++ /dev/null
-// CS0501: `X.Mine.get' must have a body because it is not marked abstract, extern, or partial
-// Line: 6
-
-class X
-{
- public int Mine { get; set {} }
-}
+++ /dev/null
-// CS0508: `A<T>.B.getT()': return type must be `A<T>.B' to match overridden member `A<A<T>.B>.getT()'
-// Line: 10
-
-abstract class A<T>
-{
- public abstract T getT ();
-
- public class B : A<B>
- {
- public override B getT ()
- {
- throw new System.Exception ("The method or operation is not implemented.");
- }
- }
-}
+++ /dev/null
-// CS0508: `A<T>.B<H>.Test()': return type must be `A<T>.B<H>' to match overridden member `A<A<T>.B<H>>.Test()'
-// Line: 10
-
-abstract class A<T>
-{
- public abstract T Test ();
-
- public class B<H> : A<B<H>>
- {
- public override B<H> Test ()
- {
- return this;
- }
- }
-}
+++ /dev/null
-// CS0508: `A<T>.B.getT()': return type must be `A<T>.B' to match overridden member `A<A<T>.B>.getT()'
-// Line: 10
-
-abstract class A<T>
-{
- public abstract T getT ();
-
- public class B : A<B>
- {
- public override B getT ()
- {
- return default (B);
- }
- }
-}
+++ /dev/null
-// CS0515: `N.G<T>.G()': static constructor cannot have an access modifier
-// Line: 7
-
-namespace N
-{
- class G<T> {
- public static G ()
- {
- }
- }
-}
+++ /dev/null
-// CS0523: Struct member `A.a' of type `A?' causes a cycle in the struct layout
-// Line: 6
-
-struct A
-{
- static A? a;
-}
+++ /dev/null
-// CS0523: Struct member `S<T>.s' of type `S<T[]>' causes a cycle in the struct layout
-// Line: 6
-
-struct S<T>
-{
- static S<T[]> s;
-}
+++ /dev/null
-// CS0523: Struct member `S<T>.s' of type `S<int>' causes a cycle in the struct layout
-// Line: 6
-
-struct S<T>
-{
- S<int> s;
-}
+++ /dev/null
-// CS0523: Struct member `Foo.Handle' of type `Handle<Foo>' causes a cycle in the struct layout
-// Line: 13
-// NOTE: Not detected by csc only by runtime loader
-
-using System;
-
-struct Handle<T>
-{
- public IntPtr Value;
-}
-
-struct Foo
-{
- public readonly Handle<Foo> Handle;
-}
+++ /dev/null
-// CS0523: Struct member `A<T>.a' of type `A<T>' causes a cycle in the struct layout
-// Line: 6
-
-struct A<T>
-{
- A<T> a;
-}
+++ /dev/null
-// CS0555: User-defined operator cannot take an object of the enclosing type and convert to an object of the enclosing type
-// Line: 6
-
-struct S
-{
- public static implicit operator S (S? s)
- {
- return new S ();
- }
-}
+++ /dev/null
-// CS0612: `O2' is obsolete
-// Line: 23
-// Compiler options: -warnaserror
-
-using System;
-
-[Obsolete]
-interface O2
-{
-}
-
-#pragma warning disable 612
-class A
-{
- public virtual void Foo<T> () where T : O2
- {
- }
-}
-#pragma warning restore 612
-
-class B : A
-{
- public override void Foo<U> ()
- {
- }
-}
+++ /dev/null
-// CS0612: `O1' is obsolete
-// Line: 23
-// Compiler options: -warnaserror
-
-using System;
-
-[Obsolete]
-class O1
-{
-}
-
-#pragma warning disable 612
-class A
-{
- public virtual void Foo<T> () where T : O1
- {
- }
-}
-#pragma warning restore 612
-
-class B : A
-{
- public override void Foo<U> ()
- {
- }
-}
+++ /dev/null
-// CS0619: `ObsoleteInterface<T>' is obsolete: `'
-// Line: 15
-
-using System;
-
-[Obsolete("", true)]
-interface ObsoleteInterface<T>
-{
-}
-
-class C
-{
- public static void Main ()
- {
- var v = typeof (ObsoleteInterface<>);
- }
-}
+++ /dev/null
-// gcs0633-4.cs: The argument to the `System.Diagnostics.ConditionalAttribute' attribute must be a valid identifier
-// Line: 6
-
-using System.Diagnostics;
-
-[Conditional("DEBUG+2")]
-public class Test: System.Attribute {}
+++ /dev/null
-// CS0633: Overloaded method `C.Foo(string)' cannot differ on use of parameter modifiers only
-// Line: 11
-
-
-public static class C
-{
- static void Foo (this string eType)
- {
- }
-
- static void Foo (string value)
- {
- }
-}
+++ /dev/null
-// CS0677: `C<T>.t': A volatile field cannot be of the type `T'
-// Line: 8
-
-public class C<T>
-{
- volatile T t;
-}
+++ /dev/null
-// CS0677: `C<T>.t': A volatile field cannot be of the type `T'
-// Line: 8
-
-public class C<T> where T : struct
-{
- volatile T t;
-}
+++ /dev/null
-// CS0689: `Stack<T>': Cannot derive from type parameter `T'
-// Line: 4
-
-class Stack<T> : T { }
+++ /dev/null
-// gcs0692.cs: Duplicate type parameter `A'
-// Line: 4
-
-class X <A,A> {
-}
+++ /dev/null
-// CS0693: Type parameter `T' has the same name as the type parameter from outer type `R<U>.A<T>'
-// Line: 9
-// Compiler options: -warnaserror -warn:3
-
-class R<U>
-{
- class A<T>
- {
- struct I<T>
- {
- }
- }
-}
+++ /dev/null
-// CS0693: Type parameter `T' has the same name as the type parameter from outer type `C<T>'
-// Line: 7
-// Compiler options: -warnaserror -warn:3
-
-class C<T>
-{
- void Foo<T> (T t)
- {
- }
-}
+++ /dev/null
-// CS0693: Type parameter `T' has the same name as the type parameter from outer type `A<T>'
-// Line: 7
-// Compiler options: -warnaserror -warn:3
-
-class A<T>
-{
- interface I<T>
- {
- }
-}
\ No newline at end of file
+++ /dev/null
-// gcs0694.cs: Type parameter `Y' has same name as containing type, or method
-// Line: 4
-
-class Y <Y> {
-}
-
-class Test
-{
- static void Main ()
- { }
-}
-
+++ /dev/null
-// CS0695: `A<X,Y,Z>' cannot implement both `I<X>' and `I<A<Y,Y,Z>>' because they may unify for some type parameter substitutions
-// Line: 7
-
-interface I<X>
-{ }
-
-class A<X,Y,Z> : I<X>, I<A<Y,Y,Z>>
-{ }
+++ /dev/null
-// CS0695: `C<X,Y>' cannot implement both `I<X>' and `I<K<Y>>' because they may unify for some type parameter substitutions
-// Line: 10
-
-interface I<X>
-{ }
-
-interface K<X>
-{ }
-
-class C<X,Y> : I<X>, I<K<Y>>
-{ }
+++ /dev/null
-// CS0695: `C<X,Y>' cannot implement both `I<K<Y>>' and `I<X>' because they may unify for some type parameter substitutions
-// Line: 10
-
-interface I<X>
-{ }
-
-interface K<X>
-{ }
-
-class C<X,Y> : I<K<Y>>, I<X>
-{ }
+++ /dev/null
-// CS0695: `A<X,Y>' cannot implement both `I<X>' and `I<Y>' because they may unify for some type parameter substitutions
-// Line: 7
-
-interface I<X>
-{ }
-
-class A<X,Y> : I<X>, I<Y>
-{ }
+++ /dev/null
-// cs0698.cs: A generic type cannot derive from `System.Attribute' because it is an attribute class
-// Line: 6
-
-using System;
-
-class Stack<T> : Attribute
-{ }
-
-class X
-{
- static void Main ()
- { }
-}
+++ /dev/null
-// CS0699: `I<T>': A constraint references nonexistent type parameter `U'
-// Line: 8
-
-partial interface I<T>
-{
-}
-
-partial interface I<T> where U : class
-{
-}
+++ /dev/null
-// CS0699: `Test<T>()': A constraint references nonexistent type parameter `U'
-// Line: 6
-
-interface I
-{
- void Test<T>() where U : class;
-}
+++ /dev/null
-// gcs0701.cs: `S' is not a valid constraint. A constraint must be an interface, a non-sealed class or a type parameter
-// Line: 8
-
-struct S
-{
-}
-
-class Foo<T> where T : S
-{
-}
+++ /dev/null
-// CS0701: `A' is not a valid constraint. A constraint must be an interface, a non-sealed class or a type parameter
-// Line: 6
-
-sealed class A { }
-
-class Foo<T> where T : A
-{
-}
+++ /dev/null
-// CS0702: A constraint cannot be special class `object'
-// Line: 8
-
-using System;
-
-class Foo<T>
- where T : object
-{
-}
+++ /dev/null
-// CS0702: A constraint cannot be special class `System.MulticastDelegate'
-// Line: 6
-
-using System;
-
-class C<T> where T : MulticastDelegate
-{
-}
+++ /dev/null
-// CS0702: A constraint cannot be special class `System.Array'
-// Line: 8
-
-using System;
-
-class Foo<T>
- where T : Array
-{
-}
+++ /dev/null
-// CS0703: Inconsistent accessibility: constraint type `A.B<T>.C' is less accessible than `A.B<T>'
-// Line: 6
-
-public class A
-{
- protected internal class B<T> where T : B<T>.C
- {
- internal class C
- {
- }
- }
-}
+++ /dev/null
-// CS0703: Inconsistent accessibility: constraint type `C.I' is less accessible than `C.Foo<T>()'
-// Line: 10
-
-public class C
-{
- interface I
- {
- }
-
- public void Foo<T>() where T : I
- {
- }
-}
+++ /dev/null
-// CS0703: Inconsistent accessibility: constraint type `I' is less accessible than `C<T>'
-// Line: 8
-
-interface I
-{
-}
-
-public class C<T> where T : I
-{
-}
\ No newline at end of file
+++ /dev/null
-// CS0704: A nested type cannot be specified through a type parameter `T'
-// Line: 6
-
-class G<T>
-{
- T.A x;
-}
+++ /dev/null
-// CS0706: Invalid constraint type `string[]'
-// Line: 4
-
-public class C<T> where T : string[]
-{
-}
+++ /dev/null
-// CS0717: `S' is not a valid constraint. Static classes cannot be used as constraints
-// Line: 8
-
-static class S
-{
-}
-
-class Foo<T> where T : S
-{
-}
+++ /dev/null
-// CS0718: `S': static classes cannot be used as generic arguments
-// Line: 14
-
-static class S
-{
-}
-
-class C<T>
-{
-}
-
-class Test
-{
- C<S> foo;
-}
\ No newline at end of file
+++ /dev/null
-// CS0721: `C': static types cannot be used as parameters
-// Line: 6
-
-
-static class C
-{
- static void Foo (this C c)
- {
- }
-}
+++ /dev/null
-// CS0723: `C<T>.t': cannot declare variables of static types
-// Line: 10
-
-static class S<T>
-{
-}
-
-public class C<T>
-{
- S<T> t;
-}
\ No newline at end of file
+++ /dev/null
-// gcs0729.cs: Cannot forward type `C' because it is defined in this assembly
-// Line: 7
-
-using System;
-using System.Runtime.CompilerServices;
-
-[assembly: TypeForwardedTo(typeof (C))]
-
-class C
-{
-}
\ No newline at end of file
+++ /dev/null
-// CS0730: Cannot forward type `C.CC' because it is a nested type
-// Line: 8
-// Compiler options: -r:GCS0730-lib.dll
-
-using System;
-using System.Runtime.CompilerServices;
-
-[assembly: TypeForwardedTo(typeof (C.CC))]
+++ /dev/null
-// gcs0735-2.cs: Invalid type specified as an argument for TypeForwardedTo attribute
-// Line: 7
-
-using System;
-using System.Runtime.CompilerServices;
-
-[assembly: TypeForwardedTo(typeof (int[]))]
\ No newline at end of file
+++ /dev/null
-// gcs0735.cs: Invalid type specified as an argument for TypeForwardedTo attribute
-// Line: 7
-
-using System;
-using System.Runtime.CompilerServices;
-
-[assembly: TypeForwardedTo((Type)null)]
\ No newline at end of file
+++ /dev/null
-// CS0739: A duplicate type forward of type `int'
-// Line: 8
-
-using System;
-using System.Runtime.CompilerServices;
-
-[assembly: TypeForwardedTo(typeof (int))]
-[assembly: TypeForwardedTo(typeof (int))]
+++ /dev/null
-// CS0746: Invalid anonymous type member declarator. Anonymous type members must be a member assignment, simple name or member access expression
-// Line: 16
-
-
-using System;
-
-public class Test
-{
- static void Main ()
- {
- var c = new { new Test () };
- }
-}
+++ /dev/null
-// CS0747: Inconsistent `object initializer' member declaration
-// Line: 16
-
-
-using System;
-using System.Collections;
-
-class Data
-{
-}
-
-public class Test
-{
- static void Main ()
- {
- var c = new ArrayList { Count = 1, 1 };
- }
-}
+++ /dev/null
-// CS0747: Inconsistent `collection initializer' member declaration
-// Line: 16
-
-
-using System;
-using System.Collections;
-
-class Data
-{
-}
-
-public class Test
-{
- static void Main ()
- {
- var c = new ArrayList { 1, Count = 1 };
- }
-}
+++ /dev/null
-// CS0748: All lambda parameters must be typed either explicitly or implicitly
-// Line: 11
-
-
-public class C
-{
- delegate void E ();
-
- public static void Main ()
- {
- e = (ref int E, v) => {};
- }
-}
+++ /dev/null
-// CS0755: A partial method declaration and partial method implementation must be both an extension method or neither
-// Line: 11
-
-
-public static partial class C
-{
- static partial void Foo (this string eType)
- {
- }
-
- static partial void Foo (string value);
-}
+++ /dev/null
-// CS0818: An implicitly typed local variable declarator must include an initializer
-// Line: 9
-
-
-public class Test
-{
- static void Main ()
- {
- var v;
- }
-}
-
+++ /dev/null
-// CS0820: An implicitly typed local variable declarator cannot use an array initializer
-// Line: 9
-
-
-public class Test
-{
- static void Main ()
- {
- var v = { 0 };
- }
-}
-
+++ /dev/null
-// CS0821: A fixed statement cannot use an implicitly typed local variable
-// Line: 9
-// Compiler options: -unsafe
-
-public class Point
-{
- public int X;
- public int Y;
-}
-
-public class Test
-{
- unsafe static void Main ()
- {
- Point p = new Point ();
- p.X = 42;
- p.Y = 16;
-
- fixed (var x = &p.X)
- {
- }
- }
-}
-
+++ /dev/null
-// CS0822: An implicitly typed local variable cannot be a constant
-// Line: 9
-
-
-public class Test
-{
- static void Main ()
- {
- const var v = 0;
- }
-}
-
+++ /dev/null
-// CS0825: The contextual keyword `var' may only appear within a local variable declaration
-// Line: 9
-
-
-public class Test
-{
- event var v;
-}
-
+++ /dev/null
-// CS0825: The contextual keyword `var' may only appear within a local variable declaration
-// Line: 9
-
-
-public class Test
-{
- const var v = 9;
-}
-
+++ /dev/null
-// CS0825: The contextual keyword `var' may only appear within a local variable declaration
-// Line: 9
-
-
-public class Test
-{
- var v = "a";
-}
-
+++ /dev/null
-// CS0826: The type of an implicitly typed array cannot be inferred from the initializer. Try specifying array type explicitly
-// Line: 9
-
-
-public class Test
-{
- static void Main ()
- {
- var e = new[] { null };
- }
-}
-
+++ /dev/null
-// CS0826: The type of an implicitly typed array cannot be inferred from the initializer. Try specifying array type explicitly
-// Line: 13
-
-
-public class Test
-{
- static void TestMethod ()
- {
- }
-
- static void Main ()
- {
- var e = new[] { TestMethod () };
- }
-}
-
+++ /dev/null
-// CS0826: The type of an implicitly typed array cannot be inferred from the initializer. Try specifying array type explicitly
-// Line: 9
-
-
-public class Test
-{
- static void Main ()
- {
- var e = new[,,,] { 1, 2 };
- }
-}
-
+++ /dev/null
-// CS0826: The type of an implicitly typed array cannot be inferred from the initializer. Try specifying array type explicitly
-// Line: 9
-
-
-public class Test
-{
- static void Main ()
- {
- var e = new[] { delegate {} };
- }
-}
-
+++ /dev/null
-// CS0826: The type of an implicitly typed array cannot be inferred from the initializer. Try specifying array type explicitly
-// Line: 8
-
-public class Test
-{
- static void Main ()
- {
- var e = new[] { 1, "a" };
- }
-}
-
+++ /dev/null
-// CS0826: The type of an implicitly typed array cannot be inferred from the initializer. Try specifying array type explicitly
-// Line: 8
-
-public class Test
-{
- static void Main ()
- {
- var e = new[] { 1, null };
- }
-}
-
+++ /dev/null
-// CS0826: The type of an implicitly typed array cannot be inferred from the initializer. Try specifying array type explicitly
-// Line: 8
-
-public class Test
-{
- static void Main ()
- {
- var e = new[] { Main };
- }
-}
-
+++ /dev/null
-// CS0826: The type of an implicitly typed array cannot be inferred from the initializer. Try specifying array type explicitly
-// Line: 9
-
-
-public class Test
-{
- static void Main ()
- {
- var e = new[] { };
- }
-}
-
+++ /dev/null
-// CS0828: An anonymous type property `Value' cannot be initialized with `int*'
-// Line: 9
-// Compiler options: -unsafe
-
-public unsafe class Test
-{
- static int* Error ()
- {
- return (int*)0;
- }
-
- static void Main ()
- {
- var v = new { Value = Error () };
- }
-}
+++ /dev/null
-// CS0828: An anonymous type property `Value' cannot be initialized with `anonymous method'
-// Line: 9
-
-
-public class Test
-{
- static void Main ()
- {
- var v = new { Value = delegate () { return 1; } };
- }
-}
+++ /dev/null
-// CS0828: An anonymous type property `Value' cannot be initialized with `lambda expression'
-// Line: 9
-
-
-public class Test
-{
- static void Main ()
- {
- var v = new { Value = i => 1 };
- }
-}
+++ /dev/null
-// CS0828: An anonymous type property `Value' cannot be initialized with `void'
-// Line: 13
-
-
-public class Test
-{
- static void Error ()
- {
- }
-
- static void Main ()
- {
- var v = new { Value = Error () };
- }
-}
+++ /dev/null
-// CS0828: An anonymous type property `Value' cannot be initialized with `method group'
-// Line: 12
-
-public class Test
-{
- static void Error ()
- {
- }
-
- static void Main ()
- {
- var v = new { Value = Error };
- }
-}
+++ /dev/null
-// CS0828: An anonymous type property `Value' cannot be initialized with `null'
-// Line: 9
-
-
-public class Test
-{
- static void Main ()
- {
- int A = 9;
- var v1 = new { A, Value = null };
- }
-}
+++ /dev/null
-// CS0831: An expression tree may not contain a base access
-// Line: 14
-
-using System;
-using System.Linq.Expressions;
-
-class B
-{
- protected bool Core {
- get {
- return true;
- }
- }
-}
-
-class C : B
-{
- public void Test ()
- {
- Expression<Func<bool>> e = () => base.Core;
- }
-}
+++ /dev/null
-// CS0831: An expression tree may not contain a base access
-// Line: 20
-
-using System;
-using System.Linq.Expressions;
-
-class B
-{
- protected B this [int i] {
- get {
- return null;
- }
- }
-}
-
-class C : B
-{
- public void Test ()
- {
- Expression<Func<B>> e = () => base [8];
- }
-}
+++ /dev/null
-// CS0831: An expression tree may not contain a base access
-// Line: 14
-
-using System;
-using System.Linq.Expressions;
-
-class B
-{
- protected int Core ()
- {
- return 4;
- }
-}
-
-class C : B
-{
- public void Test ()
- {
- Expression<Func<int>> e = () => base.Core ();
- }
-}
+++ /dev/null
-// CS0832: An expression tree cannot contain an assignment operator
-// Line: 13
-
-using System;
-using System.Linq.Expressions;
-
-class C
-{
- delegate void D (string s);
-
- public static void Main ()
- {
- Expression<D> e = (a) => a = "a";
- }
-}
+++ /dev/null
-// CS0832: An expression tree cannot contain an assignment operator
-// Line: 11
-
-using System;
-using System.Linq.Expressions;
-
-class C
-{
- public static void Main ()
- {
- Expression<Func<int, int>> e = (a) => --a;
- }
-}
+++ /dev/null
-// CS0832: An expression tree cannot contain an assignment operator
-// Line: 19
-
-using System;
-using System.Linq.Expressions;
-
-public delegate void EventHandler (int i, int j);
-
-public class Button
-{
- public event EventHandler Click;
-}
-
-public class Blah
-{
- public static void Main ()
- {
- Button b = new Button ();
- Expression<Action> e = () => b.Click += new EventHandler (Button1_Click);
- }
-
- public static void Button1_Click (int i, int j)
- {
- }
-}
+++ /dev/null
-// CS0832: An expression tree cannot contain an assignment operator
-// Line: 13
-
-using System;
-using System.Linq.Expressions;
-
-class C
-{
- delegate void D (string s);
-
- public static void Main ()
- {
- Expression<D> e = (a) => a = "a";
- }
-}
+++ /dev/null
-// CS0833: `Value': An anonymous type cannot have multiple properties with the same name
-// Line: 9
-
-
-public class Test
-{
- static void Main ()
- {
- var v1 = new { Value = 1, Value = 0 };
- }
-}
+++ /dev/null
-// CS0834: A lambda expression with statement body cannot be converted to an expresion tree
-// Line: 12
-
-using System.Linq.Expressions;
-
-class C
-{
- delegate void D ();
-
- public void Foo ()
- {
- Expression<D> e = () => { };
- }
-}
+++ /dev/null
-// CS0834: A lambda expression with statement body cannot be converted to an expresion tree
-// Line: 12
-
-using System.Linq.Expressions;
-
-class C
-{
- delegate bool D ();
-
- public void Foo ()
- {
- Expression<D> e = () => { return true; };
- }
-}
+++ /dev/null
-// CS0835: Cannot convert `lambda expression' to an expression tree of non-delegate type `string'
-// Line: 10
-
-using System.Linq.Expressions;
-
-class C
-{
- public void Foo ()
- {
- Expression<string> e = () => "a";
- }
-}
+++ /dev/null
-// CS0836: Anonymous types cannot be used in this expression
-// Line: 6
-
-public class C
-{
- const object o = new { };
-}
+++ /dev/null
-// CS0837: The `as' operator cannot be applied to a lambda expression or anonymous method
-// Line: 15
-
-
-class X
-{
- delegate void D ();
-
- static void Test (D d)
- {
- }
-
- static void Main ()
- {
- Test ((() => { }) as D);
- }
-}
+++ /dev/null
-// CS0838: An expression tree cannot contain a multidimensional array initializer
-// Line: 11
-
-using System;
-using System.Linq.Expressions;
-
-class C
-{
- void Foo ()
- {
- Expression<Func<char [,]>> e = () => new char [,] { { 'x', 'y' }, { 'a', 'b' }};
- }
-}
+++ /dev/null
-// CS0840: `Test.Property.get' must have a body because it is not marked abstract or extern. The property can be automatically implemented when you define both accessors
-// Line: 7
-
-
-public abstract class Test
-{
- public string Property { get; }
-}
+++ /dev/null
-// CS0841: A local variable `v' cannot be used before it is declared
-// Line: 9
-
-
-public class Test
-{
- static void Main ()
- {
- var v = ++v;
- }
-}
-
+++ /dev/null
-// CS0842: Automatically implemented property `S.Value' cannot be used inside a type with an explicit StructLayout attribute
-// Line: 10
-
-using System.Runtime.InteropServices;
-
-[StructLayout(LayoutKind.Explicit)]
-class S
-{
- public int Value {
- get; set;
- }
-}
+++ /dev/null
-// CS0845: An expression tree cannot contain a coalescing operator with null left side
-// Line: 11
-
-using System;
-using System.Linq.Expressions;
-
-class C
-{
- public static void Main ()
- {
- Expression<Func<bool?, bool?>> e = (a) => null ?? a;
- }
-}
\ No newline at end of file
+++ /dev/null
-// CS0853: An expression tree cannot contain named argument
-// Line: 15
-// Compiler options: -langversion:future
-
-using System;
-using System.Linq.Expressions;
-
-class M
-{
- static void Named (int i)
- {
- }
-
- public static void Main ()
- {
- Expression<Action> e = () => Named (i : 1);
- }
-}
+++ /dev/null
-// CS0854: An expression tree cannot contain an invocation which uses optional parameter
-// Line: 15
-
-using System;
-using System.Linq.Expressions;
-
-class M
-{
- public M (string s = "value")
- {
- }
-
- public static void Main ()
- {
- Expression<Action> e = () => new M ();
- }
-}
+++ /dev/null
-// CS0854: An expression tree cannot contain an invocation which uses optional parameter
-// Line: 15
-// Compiler options: -langversion:future
-
-using System;
-using System.Linq.Expressions;
-
-class M
-{
- static void Optional (int i, string s = "value")
- {
- }
-
- public static void Main ()
- {
- Expression<Action> e = () => Optional (1);
- }
-}
+++ /dev/null
-// cs1058.cs: A previous catch clause already catches all exceptions. All non-exceptions thrown will be wrapped in a `System.Runtime.CompilerServices.RuntimeWrappedException'
-// Line: 11
-// Compiler options: -warnaserror -warn:4
-
-class C
-{
- static void Main()
- {
- try {}
- catch (System.Exception) { }
- catch {}
- }
-}
-
+++ /dev/null
-// gcs1058.cs: A previous catch clause already catches all exceptions. All non-exceptions thrown will be wrapped in a `System.Runtime.CompilerServices.RuntimeWrappedException'
-// Line: 15
-// Compiler options: -warnaserror -warn:4
-
-using System.Runtime.CompilerServices;
-
-[assembly: RuntimeCompatibility (WrapNonExceptionThrows=true)]
-
-class C
-{
- static void Main()
- {
- try {}
- catch (System.Exception) { }
- catch {}
- }
-}
+++ /dev/null
-// CS1061: Type `string' does not contain a definition for `Length2' and no extension method `Length2' of type `string' could be found (are you missing a using directive or an assembly reference?)
-// Line: 12
-
-
-using System.Linq;
-
-public class M
-{
- public static void Main ()
- {
- var e = from values in new [] { "value" }
- let length = values.Length2
- select length;
- }
-}
+++ /dev/null
-// CS1061: Type `int' does not contain a definition for `E' and no extension method `E' of type `int' could be found (are you missing a using directive or an assembly reference?)
-// Line: 7
-
-class T {
- public static int Main (string [] args )
- {
- int x = 1.E;
- return 0;
- }
-}
+++ /dev/null
-// CS1061: Type `X' does not contain a definition for `Test' and no extension method `Test' of type `X' could be found (are you missing a using directive or an assembly reference?)
-// Line: 12
-
-class A<X>
-{
- //
- // This is to test the lookup rules for SimpleNames:
- // `X' is the type parameter, not the class.
- //
- public void Test (X x)
- {
- x.Test ();
- }
-}
-
-class X
-{
- public void Test ()
- { }
-
- public static void Main ()
- { }
-}
+++ /dev/null
-// CS1061: Type `int' does not contain a definition for `Value' and no extension method `Value' of type `int' could be found (are you missing a using directive or an assembly reference?)
-// Line: 24
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-
-namespace Test
-{
- static class Ex
- {
- public static IEnumerable<TR> Foo<T, TR> (this IEnumerable<T> t, Func<T, TR> f)
- {
- return null;
- }
- }
-
- public class C
- {
- public static void Main ()
- {
- int[] i = null;
- int p;
- var prods = from pe in i.Foo (p9 => p.Value) select pe;
- }
- }
-}
+++ /dev/null
-// CS1061: Type `T' does not contain a definition for `Name' and no extension method `Name' of type `T' could be found (are you missing a using directive or an assembly reference?)
-// Line: 11
-
-using System;
-using System.Collections.Generic;
-
-public class C<T, U>
-{
- public C (IEnumerable<T> t)
- {
- new List<T>(t).ConvertAll(p => p.Name);
- }
-}
+++ /dev/null
-// CS1061: Type `int' does not contain a definition for `Foo' and no extension method `Foo' of type `int' could be found (are you missing a using directive or an assembly reference?)
-// Line: 9
-
-
-public class M
-{
- public static void Main ()
- {
- 1.Foo ("foo");
- }
-}
\ No newline at end of file
+++ /dev/null
-// CS1067: Partial declarations of `I<T>' must have the same type parameter variance modifiers
-// Line: 8
-
-partial interface I<in T>
-{
-}
-
-partial interface I<out T>
-{
-}
+++ /dev/null
-// CS1100: The parameter modifier `this' can only be used on the first parameter
-// Line: 6
-
-static class S
-{
- static void Foo (bool b, this string s)
- {
- }
-}
\ No newline at end of file
+++ /dev/null
-// CS1101: The parameter modifiers `this' and `ref' cannot be used altogether
-// Line: 6
-
-static class S
-{
- static void Foo (ref this string s)
- {
- }
-}
\ No newline at end of file
+++ /dev/null
-// CS1102: The parameter modifiers `this' and `out' cannot be used altogether
-// Line: 6
-
-static class S
-{
- static void Foo (this out string s)
- {
- }
-}
\ No newline at end of file
+++ /dev/null
-// CS1103: The extension method cannot be of type `int*'
-// Line: 7
-// Compiler options: -unsafe
-
-static class S
-{
- unsafe static void Foo (this int* iptr)
- {
- }
-}
+++ /dev/null
-// CS1104: The parameter modifiers `this' and `params' cannot be used altogether
-// Line: 6
-
-static class S
-{
- static void Foo (params this int[] o)
- {
- }
-}
\ No newline at end of file
+++ /dev/null
-// CS1105: `S.Foo(this int?)': Extension methods must be declared static
-// Line: 6
-
-
-static class S
-{
- void Foo (this int? s)
- {
- }
-}
+++ /dev/null
-// CS1106: `S<T>.Foo(this string)': Extension methods must be defined in a non-generic static class
-// Line: 6
-
-
-static class S<T>
-{
- static void Foo (this string s)
- {
- }
-}
+++ /dev/null
-// CS1106: `S.Foo(this string)': Extension methods must be defined in a non-generic static class
-// Line: 6
-
-
-class S
-{
- static void Foo (this string s)
- {
- }
-}
+++ /dev/null
-// CS1109: `C.S.Foo(this string)': Extension methods cannot be defined in a nested class
-// Line: 8
-
-
-class C
-{
- static class S
- {
- static void Foo (this string s)
- {
- }
- }
-}
+++ /dev/null
-// CS1110: `C.Foo(this string)': Extension methods cannot be declared without a reference to System.Core.dll assembly. Add the assembly reference or remove `this' modifer from the first parameter
-// Line: 7
-// Compiler options: -noconfig
-
-static class C
-{
- static void Foo (this string s)
- {
- }
-}
+++ /dev/null
-// CS1112: Do not use `System.Runtime.CompilerServices.ExtensionAttribute' directly. Use parameter modifier `this' instead
-// Line: 16
-
-
-using System;
-using System.Runtime.CompilerServices;
-
-namespace System.Runtime.CompilerServices
-{
- public class ExtensionAttribute : Attribute
- {
- }
-}
-
-static class C
-{
- [Extension]
- static void Foo (this string s)
- {
- }
-}
\ No newline at end of file
+++ /dev/null
-// CS1112: Do not use `System.Runtime.CompilerServices.ExtensionAttribute' directly. Use parameter modifier `this' instead
-// Line: 7
-
-
-using System.Runtime.CompilerServices;
-
-[assembly: ExtensionAttribute]
+++ /dev/null
-// CS1112: Do not use `System.Runtime.CompilerServices.ExtensionAttribute' directly. Use parameter modifier `this' instead
-// Line: 8
-
-
-using System.Runtime.CompilerServices;
-
-static class C
-{
- [Extension]
- static void Foo (this string s)
- {
- }
-}
\ No newline at end of file
+++ /dev/null
-// CS1113: Extension method `Extension.Foo(this S)' of value type `S' cannot be used to create delegates
-// Line: 11
-
-delegate void D ();
-
-public class C
-{
- static void Main ()
- {
- S s = new S ();
- D d = s.Foo;
- }
-}
-
-public struct S
-{
- public void Foo (int i)
- {
- }
-}
-
-public static class Extension
-{
- public static void Foo (this S s) { }
-}
+++ /dev/null
-// CS1113: Extension method `Extension.Foo(this S)' of value type `S' cannot be used to create delegates
-// Line: 12
-
-
-delegate void D ();
-
-public class C
-{
- static void Main ()
- {
- S s = new S ();
- D d = s.Foo;
- }
-}
-
-public struct S
-{
-}
-
-public static class Extension
-{
- public static void Foo (this S s) { }
-}
+++ /dev/null
-// CS1501: No overload for method `Select' takes `1' arguments
-// Line: 17
-
-
-using System;
-
-class TestA
-{
- public string value;
-
- public TestA (string value)
- {
- this.value = value;
- }
-
- public string Select (int i, Func<TestA, TestA> f)
- {
- return value;
- }
-}
-
-public class M
-{
- static void Main ()
- {
- var v = new TestA ("Oh yes");
- string foo = from a in v select a;
- }
-}
+++ /dev/null
-// CS1501: No overload for method `Foo' takes `0' arguments
-// Line: 15
-
-class Base<T>
-{
- protected virtual void Foo<U> (U u)
- {
- }
-}
-
-class Derived<T> : Base<int>
-{
- protected override void Foo<U> (U u)
- {
- base.Foo ();
- }
-}
+++ /dev/null
-// CS1501: No overload for method `Test' takes `2' arguments
-// Line: 16
-// Compiler options: -langversion:future
-
-static class S
-{
- public static int Test (this int value)
- {
- return value;
- }
-}
-
-class M
-{
- public static void Main ()
- {
- 1.Test (value: 1);
- }
-}
+++ /dev/null
-// CS1501: No overload for method `Foo' takes `2' arguments
-// Line: 17
-
-
-static class Extensions
-{
- public static string Foo (this string s)
- {
- return s;
- }
-}
-
-public class M
-{
- public static void Main ()
- {
- 1.Foo ("foo");
- }
-}
+++ /dev/null
-// CS1502: The best overloaded method match for `A.A(System.Collections.Generic.IList<int>[])' has some invalid arguments
-// Line: 40
-using System;
-using System.Collections;
-using System.Collections.Generic;
-
-public struct MyStruct : IList<int>
-{
- public int this [int x] { get { return 0; } set { return; } }
- public int IndexOf (int x) { return 0; }
- public void Insert (int x, int y) { return; }
- public void RemoveAt (int x) { return; }
- public int Count { get { return 0; } }
- public bool IsReadOnly { get { return false; } }
- public void Add (int x) { return; }
- public void Clear () { return; }
- public bool Contains (int x) { return false; }
- public void CopyTo (int[] x, int y) { return; }
- public bool Remove (int x) { return false; }
- public IEnumerator<int> GetEnumerator() { yield return 0; }
- IEnumerator IEnumerable.GetEnumerator() { yield return 0; }
-}
-
-public class A
-{
- // This version does not compile:
- public A(IList<int>[] x) { }
-
- // This version compiles fine, but results in an exception:
- public A(IList<IList<int>> x) { }
-}
-
-public class Test
-{
- static void Main ()
- {
- MyStruct[] myStructArray = new MyStruct[1];
-
- Console.WriteLine ("Trying to construct an A...");
- A a = new A (myStructArray);
- Console.WriteLine ("success!");
- }
-}
+++ /dev/null
-// cs1502-3.cs: The best overloaded method match for `T.Blah(out int)' has some invalid arguments
-// Line: 11
-
-using System;
-
-class T {
- static void Blah (out int g) { g = 0; }
-
- static int Main (string [] args) {
- IntPtr g;
- Blah (out g);
- return (int) g;
- }
-}
+++ /dev/null
-// CS1502: The best overloaded method match for `Global.Test1(int?)' has some invalid arguments
-// Line: 8
-
-using System;
-
-class Global {
- static void Main() {
- Console.Write(Test1((decimal?)2));
- }
- static string Test1(int? value) {
- return "ok";
- }
-}
+++ /dev/null
-// CS1503: Argument `#1' cannot convert `bool' expression to type `int'
-// Line: 12
-
-public class C
-{
- static void Foo<T>(T t)
- {
- }
-
- public static void Main ()
- {
- Foo<int> (true);
- }
-}
+++ /dev/null
-// CS1503: Argument `#1' cannot convert `bool' expression to type `int[]'
-// Line: 13
-
-public class X
-{
- public static void Test (params int[] a)
- {
- }
-
- public static void Main()
- {
- int i;
- Test (true);
- }
-}
+++ /dev/null
-// CS1521: Invalid base type `C?'
-// Line: 8
-
-struct C
-{
-}
-
-class C2: C?
-{
-}
-
+++ /dev/null
-// CS1525: Unexpected symbol `<', expecting `,' or `>'
-// Line: 9
-
-interface IFoo<T>
-{
-}
-
-public class Bar {
- public void GetItemCommand<IFoo<int>>()
- {
- }
-}
+++ /dev/null
-// CS1525: Unexpected symbol `='
-// Line: 10
-
-public class Test
-{
- private string name;
-
- public string Name
- {
- get { return name ?? name = string.Empty; }
- }
-}
+++ /dev/null
-// CS1525: Unexpected symbol `>', expecting `[', `identifier', `in', or `out'
-// Line: 4
-
-public class C<>
-{
-}
+++ /dev/null
-// CS1547: Keyword `void' cannot be used in this context
-// Line: 8
-
-class X
-{
- static void Main ()
- {
- object o = default(void);
- }
-}
+++ /dev/null
-// CS1547: Keyword `void' cannot be used in this context
-// Line: 8
-
-
-class X
-{
- static void Main ()
- {
- var e = from void v in new int [] { 0 } select i;
- }
-}
+++ /dev/null
-// CS1547: Keyword `void' cannot be used in this context
-// Line: 10
-class Foo<T>
-{ }
-
-class X
-{
- static void Main ()
- {
- Foo<void> foo;
- }
-}
+++ /dev/null
-// CS1579: foreach statement cannot operate on variables of type `Foo' because it does not contain a definition for `GetEnumerator' or is inaccessible
-// Line: 12
-
-using System;
-using System.Collections;
-
-public class Test
-{
- public static void Main ()
- {
- Foo f = new Foo ();
- foreach (object o in f)
- Console.WriteLine (o);
- }
-}
-
-public class Foo
-{
- public Func<IEnumerator> GetEnumerator;
-}
+++ /dev/null
-// CS1593: Delegate `System.Func<int,int>' does not take `2' arguments
-// Line: 11
-
-
-using System;
-
-class C
-{
- static void Main (string [] args)
- {
- M ((x, y) => 2);
- }
-
- static void M (Func<int, int> a)
- {
- }
-}
+++ /dev/null
-// CS1624: The body of `C.Test<TSource>(System.Collections.Generic.IEnumerable<TSource>)' cannot be an iterator block because `TSource' is not an iterator interface type
-// Line: 8
-
-using System.Collections.Generic;
-
-public class C
-{
- public static TSource Test<TSource>(IEnumerable<TSource> source)
- {
- foreach (TSource element in source)
- yield return element;
- }
-}
+++ /dev/null
-// CS1640: foreach statement cannot operate on variables of type `T' because it contains multiple implementation of `System.Collections.Generic.IEnumerable<T>'. Try casting to a specific implementation
-// Line: 11
-
-using System.Collections.Generic;
-
-public class C
-{
- public static void Test<T>(T t)
- where T: IEnumerable<string>, IEnumerable<int>
- {
- foreach (int i in t)
- {
- }
- }
-}
+++ /dev/null
-// cs1642.cs: `C.test_1': Fixed size buffer fields may only be members of structs
-// Line: 7
-// Compiler options: -unsafe
-
-public unsafe class C
-{
- private fixed char test_1 [128];
-}
+++ /dev/null
-// CS1644: Feature `nullable types' cannot be used because it is not part of the C# 1.0 language specification
-// Line: 7
-// Compiler options: -langversion:ISO-1
-
-class Test
-{
- int? i;
- static void Main () {}
-}
+++ /dev/null
-// CS1644: Feature `default value expression' cannot be used because it is not part of the C# 1.0 language specification
-// Line: 7
-// Compiler options: -langversion:ISO-1
-
-class Test
-{
- int i = default (int);
-}
+++ /dev/null
-// CS1644: Feature `generics' cannot be used because it is not part of the C# 1.0 language specification
-// Line: 5
-// Compiler options: -langversion:ISO-1
-
-class Stack < type >
-{
-}
-
+++ /dev/null
-// CS1644: Feature `lambda expressions' cannot be used because it is not part of the C# 2.0 language specification
-// Line: 11
-// Compiler options: -langversion:ISO-2
-
-class C
-{
- delegate void D ();
-
- public void Foo ()
- {
- D e = () => { };
- }
-}
-
+++ /dev/null
-// CS1644: Feature `nullable types' cannot be used because it is not part of the C# 1.0 language specification
-// Line: 9
-// Compiler options: -langversion:ISO-1
-
-struct C
-{
- void G ()
- {
- object o = (C?[]) this;
- }
-}
+++ /dev/null
-// CS1644: Feature `generic type variance' cannot be used because it is not part of the C# 2.0 language specification
-// Line: 5
-// Compiler options: -langversion:iso-2
-
- public interface IFoo<out T> {
- }
+++ /dev/null
-// CS1644: Feature `generic type variance' cannot be used because it is not part of the C# 2.0 language specification
-// Line: 5
-// Compiler options: -langversion:iso-2
-
- public interface IFoo<in T> {
- }
+++ /dev/null
-// CS1644: Feature `generic type variance' cannot be used because it is not part of the C# 3.0 language specification
-// Line: 5
-// Compiler options: -langversion:3
-
-public interface IFoo<in T>
-{
-}
+++ /dev/null
-// cs1644.cs: Feature `generics' cannot be used because it is not part of the C# 1.0 language specification
-// Line: 5
-// Compiler options: -langversion:ISO-1
-
-class X<V>
-{
-}
-
-class X
-{
- static void Main ()
- { }
-}
+++ /dev/null
-// CS1644: Feature `anonymous types' cannot be used because it is not part of the C# 1.0 language specification
-// Line: 9
-// Compiler options: -langversion:ISO-1
-
-class A
-{
- void Foo ()
- {
- var v = new { X = "Bar" };
- }
-}
+++ /dev/null
-// CS1644: Feature `collection initializers' cannot be used because it is not part of the C# 2.0 language specification
-// Line: 9
-// Compiler options: -langversion:ISO-2
-
-using System.Collections.Generic;
-
-class A
-{
- void Foo ()
- {
- object o = new List<int> { 1, 2, 3 };
- }
-}
+++ /dev/null
-// CS1644: Feature `object initializers' cannot be used because it is not part of the C# 2.0 language specification
-// Line: 14
-// Compiler options: -langversion:ISO-2
-
-class Data
-{
- public int Value;
-}
-
-class A
-{
- void Foo ()
- {
- new Data () { Value = 3 };
- }
-}
+++ /dev/null
-// CS1644: Feature `implicitly typed arrays' cannot be used because it is not part of the C# 1.0 language specification
-// Line: 7
-// Compiler options: -langversion:ISO-1
-
-class A
-{
- string[] array = new [] { "Foo", "Bar", "Baz" };
-}
+++ /dev/null
-// CS1644: Feature `partial methods' cannot be used because it is not part of the C# 2.0 language specification
-// Line: 7
-// Compiler options: -langversion:ISO-2
-
-partial class P
-{
- partial void Foo ();
-}
+++ /dev/null
-// CS1644: Feature `query expressions' cannot be used because it is not part of the C# 2.0 language specification
-// Line: 11
-// Compiler options: -langversion:ISO-2
-
-using System.Linq;
-
-public class C
-{
- public static void Main ()
- {
- var e = from a in "aaa" select a;
- }
-}
+++ /dev/null
-// CS1644: Feature `automatically implemented properties' cannot be used because it is not part of the C# 2.0 language specification
-// Line: 7
-// Compiler options: -langversion:ISO-2
-
-class P
-{
- public string Name { get; set; }
-}
+++ /dev/null
-// CS1644: Feature `extension methods' cannot be used because it is not part of the C# 2.0 language specification
-// Line: 17
-// Compiler options: -langversion:ISO-2
-
-static class Extensions
-{
- static string Foo (string s, this bool b, int i)
- {
- return s;
- }
-}
+++ /dev/null
-// CS1660: Cannot convert `lambda expression' to non-delegate type `object'
-// Line: 9
-
-using System;
-
-class X {
- static void Main ()
- {
- object o = () => true;
- }
-}
+++ /dev/null
-// CS1661: Cannot convert `lambda expression' to delegate type `C.WithOutParam' since there is a parameter mismatch
-// Line: 10
-
-
-class C
-{
- delegate void WithOutParam (out string value);
-
- static void Main()
- {
- WithOutParam o = (string l) => { return; };
- }
-}
+++ /dev/null
-// CS1662: Cannot convert `lambda expression' to delegate type `D' because some of the return types in the block are not implicitly convertible to the delegate return type
-// Line: 13
-
-
-using System;
-
-delegate int D (int i);
-
-class X
-{
- static void Main ()
- {
- D d = (int l) => Main ();
- }
-}
+++ /dev/null
-// cs1663.cs: `S.test': Fixed size buffers type must be one of the following: bool, byte, short, int, long, char, sbyte, ushort, uint, ulong, float or double
-// Line: 6
-
-public struct S
-{
- public fixed decimal test [4];
-}
+++ /dev/null
-// cs1664.cs: Fixed size buffer `C.test_1' of length `1073741825' and type `long' exceeded 2^31 limit
-// Line: 7
-// Compiler options: -unsafe
-
-public unsafe struct C
-{
- private fixed long test_1 [1073741825];
-}
+++ /dev/null
-// cs1665.cs: `S.test20': Fixed size buffers must have a length greater than zero
-// Line: 7
-// Compiler options: -unsafe
-
-public unsafe struct S
-{
- public fixed bool test20 [-4];
-}
+++ /dev/null
-// cs1666.cs: You cannot use fixed size buffers contained in unfixed expressions. Try using the fixed statement
-// Line: 11
-// Compiler options: -unsafe
-
-public unsafe struct S
-{
- fixed char test_1 [128];
-
- public void Test ()
- {
- test_1 [55] = 'g';
- }
-}
+++ /dev/null
-// CS1675: Enums cannot have type parameters
-// Line: 4
-
-enum E<T>
-{
-}
+++ /dev/null
-// CS1676: Parameter `1' must be declared with the `out' keyword
-// Line: 10
-
-class C
-{
- delegate int D (out int i);
-
- public static void Main ()
- {
- D d = a => 1;
- }
-}
+++ /dev/null
-// CS1677: Parameter `1' should not be declared with the `ref' keyword
-// Line: 9
-
-
-delegate void D (int x);
-
-class X
-{
- static void Main ()
- {
- D d2 = (ref int x) => {};
- }
-}
+++ /dev/null
-// CS1685: The predefined type `System.Runtime.CompilerServices.ExtensionAttribute' is defined in multiple assemblies. Using definition from `System.Core'
-// Line: 0
-// Compiler options: -warn:1 -warnaserror -r:System.Core.dll -r:GCS1685-lib.dll
-
+++ /dev/null
-// CS1686: Local variable or parameter `str' cannot have their address taken and be used inside an anonymous method or lambda expression
-// Line: 11
-// Compiler options: -unsafe
-
-using System;
-
-unsafe struct S
-{
- public fixed int i [10];
-}
-
-class C
-{
- static void Main ()
- {
- unsafe {
- S str;
- Func<int> e = () => str.i [3];
- }
- }
-}
+++ /dev/null
-// cs1689.cs: Attribute `System.Diagnostics.ConditionalAttribute' is only valid on methods or attribute classes
-// Line: 6
-
-using System.Diagnostics;
-
-[Conditional("DEBUG")]
-public class Test {}
-
\ No newline at end of file
+++ /dev/null
-// gcs1700.cs: Assembly reference `MyAssemblyName, Version=' is invalid and cannot be resolved
-// Line: 8
-// Compiler options: -warnaserror -warn:3
-
-using System;
-using System.Runtime.CompilerServices;
-
-[assembly: InternalsVisibleTo ("MyAssemblyName, Version=")]
-
-public class InternalsVisibleToTest
-{
- static void Main ()
- {
- }
-
-}
-
+++ /dev/null
-// CS1708: `S.array': Fixed size buffers can only be accessed through locals or fields
-// Line: 27
-// Compiler options: -unsafe
-
-using System;
-
-unsafe struct S
-{
- public fixed int array [2];
-}
-
-class C
-{
- unsafe public S Get ()
- {
- return new S ();
- }
-}
-
-public class Tester
-{
- public static void Main() { }
-
- unsafe void setName()
- {
- C c = new C();
- c.Get ().array [1] = 44;
- }
-}
-
+++ /dev/null
-// cs1716.cs: Do not use 'System.Runtime.CompilerServices.FixedBuffer' attribute. Use the 'fixed' field modifier instead
-// Line: 6
-
-public class C
-{
- [System.Runtime.CompilerServices.FixedBuffer (typeof (int), 1)]
- public int i;
-}
\ No newline at end of file
+++ /dev/null
-// CS1718: A comparison made to same variable. Did you mean to compare something else?
-// Line: 10
-// Compiler options: -warnaserror -warn:3
-
-class C
-{
- public static void Main ()
- {
- int? a = 20;
- if (a > a) {
- return;
- }
- }
-}
-
+++ /dev/null
-// CS1720: Expression will always cause a `System.NullReferenceException'
-// Line: 9
-// Compiler options: -warnaserror -warn:1
-
-public class Tester
-{
- public static void GenericClass<T>(T t) where T : class
- {
- string s = default(T).ToString();
- }
-}
\ No newline at end of file
+++ /dev/null
-// CS1720: Expression will always cause a `System.NullReferenceException'
-// Line: 11
-// Compiler options: -warnaserror -warn:1
-
-using System;
-
-public class Tester
-{
- public static void Foo ()
- {
- Console.WriteLine(default(Tester).ToString());
- }
-}
\ No newline at end of file
+++ /dev/null
-// CS1724: Value specified for the argument to `System.Runtime.InteropServices.DefaultCharSetAttribute' is not valid
-// Line: 7
-
-using System;
-using System.Runtime.InteropServices;
-
-[module: DefaultCharSet ((CharSet)30)]
+++ /dev/null
-// gcs1726-2.cs: Friend assembly reference `MyAssemblyName, PublicKeyToken=43b5d2e9a794bdcb' is invalid. Strong named assemblies must specify a public key in their InternalsVisibleTo declarations
-// Line: 8
-// Compiler options: -keyfile:InternalsVisibleTest.snk
-
-using System;
-using System.Runtime.CompilerServices;
-
-[assembly: InternalsVisibleTo ("MyAssemblyName, PublicKeyToken=43b5d2e9a794bdcb")]
-
-public class Test
-{
- static void Main ()
- {
- }
-}
-
+++ /dev/null
-// gcs1726.cs: Friend assembly reference `MyAssemblyName' is invalid. Strong named assemblies must specify a public key in their InternalsVisibleTo declarations
-// Line: 8
-// Compiler options: -keyfile:InternalsVisibleTest.snk
-
-using System;
-using System.Runtime.CompilerServices;
-
-[assembly: InternalsVisibleTo ("MyAssemblyName")]
-
-public class Test
-{
- static void Main ()
- {
- }
-}
-
+++ /dev/null
-// CS1728: Cannot create delegate from method `long?.GetValueOrDefault()' because it is a member of System.Nullable<T> type
-// Line: 10
-
-using System;
-
-class C
-{
- public static void Main ()
- {
- Func<long> a = new long?().GetValueOrDefault;
- }
-}
+++ /dev/null
-// CS1728: Cannot create delegate from method `int?.GetValueOrDefault()' because it is a member of System.Nullable<T> type
-// Line: 14
-
-using System;
-
-class C
-{
- delegate int Test ();
- event Test MyEvent;
-
- void Error ()
- {
- int? i = 0;
- MyEvent += new Test (i.GetValueOrDefault);
- }
-}
+++ /dev/null
-// CS1744: Named argument `a' cannot be used for a parameter which has positional argument specified
-// Line: 13
-// Compiler options: -langversion:future
-
-static class C
-{
- public static int Test (this int a, int b)
- {
- return a * 3 + b;
- }
-
- public static void Main ()
- {
- 1.Test (a : 2);
- }
-}
+++ /dev/null
-// CS1745: Cannot specify `System.Runtime.InteropServices.DefaultParameterValue' attribute on optional parameter `u'
-// Line: 8
-// Compiler options: -langversion:future
-
-using System.Runtime.InteropServices;
-
-public class C
-{
- public static void Test ([DefaultParameterValue (1)] int u = 2)
- {
- }
-}
+++ /dev/null
-// CS1750: Optional parameter expression of type `decimal' cannot be converted to parameter type `int?'
-// Line: 6
-
-public class TS
-{
- public static void Test (int? i = 1m)
- {
- }
-}
+++ /dev/null
-// CS1770: The expression being assigned to nullable optional parameter `d' must be default value
-// Line: 8
-
-using System;
-
-class C
-{
- public static void Foo (DateTime? d = new DateTime ())
- {
- }
-}
+++ /dev/null
-// gcs1908.cs: The type of the default value should match the type of the parameter
-// Line:
-
-class Test {
- internal void f ([System.Runtime.InteropServices.DefaultParameterValue (null)] short x)
- {
- }
-}
+++ /dev/null
-// gcs1908.cs: The type of the default value should match the type of the parameter
-// Line:
-
-class Test<T> where T : class {
- internal void f ([System.Runtime.InteropServices.DefaultParameterValue (null)] T x)
- {
- }
-}
+++ /dev/null
-// gcs1908.cs: The type of the default value should match the type of the parameter
-// Line:
-
-class Test {
- internal void f ([System.Runtime.InteropServices.DefaultParameterValue ((short) 1)] int x)
- {
- }
-}
+++ /dev/null
-// gcs1908.cs: The type of the default value should match the type of the parameter
-// Line: 5
-
-class Test {
- internal void f ([System.Runtime.InteropServices.DefaultParameterValue (1)] short x)
- {
- }
-}
+++ /dev/null
-// CS1909: The DefaultParameterValue attribute is not applicable on parameters of type `System.Type'
-// Line: 7
-
-using System.Runtime.InteropServices;
-
-interface ITest {
- void f ([DefaultParameterValue (typeof (ITest))] System.Type x);
-}
+++ /dev/null
-// CS1909: The DefaultParameterValue attribute is not applicable on parameters of type `int[]'
-// Line: 7
-
-using System.Runtime.InteropServices;
-
-class Test {
- void f ([DefaultParameterValue (new int[0])] int[] x)
- {
- }
-}
+++ /dev/null
-// CS1910: Argument of type `int[]' is not applicable for the DefaultParameterValue attribute
-// Line: 7
-
-using System.Runtime.InteropServices;
-using System;
-
-class Test {
- void f ([DefaultParameterValue (new int[0])] object x)
- {
- }
-}
+++ /dev/null
-// CS1910: Argument of type `System.Type' is not applicable for the DefaultParameterValue attribute
-// Line: 7
-
-using System.Runtime.InteropServices;
-
-class Test {
- void f ([DefaultParameterValue (typeof (object))] object x)
- {
- }
-}
+++ /dev/null
-// CS1912: An object initializer includes more than one member `Count' initialization
-// Line: 17
-
-
-using System;
-using System.Collections.Generic;
-
-public class Test
-{
- class Container
- {
- public int Count;
- }
-
- static void Main ()
- {
- var c = new Container { Count = 1, Count = 10 };
- }
-}
+++ /dev/null
-// CS1913: Member `Data.Count()' cannot be initialized. An object initializer may only be used for fields, or properties
-// Line: 17
-
-
-using System;
-using System.Collections.Generic;
-
-class Data
-{
- public int Count ()
- {
- return 1;
- }
-}
-
-public class Test
-{
- static void Main ()
- {
- var c = new Data { Count = 10 };
- }
-}
+++ /dev/null
-// CS1913: Member `Data.Count' cannot be initialized. An object initializer may only be used for fields, or properties
-// Line: 17
-
-
-using System;
-using System.Collections.Generic;
-
-class Data
-{
- public delegate int Count ();
-}
-
-public class Test
-{
- delegate void S ();
-
- static void Main ()
- {
- //S s = new S ();
- //string drawBackLabel = string.Length("absDrawBack");
- var c = new Data { Count = 10 };
- }
-}
+++ /dev/null
-// CS1914: Static field or property `Data.Count' cannot be assigned in an object initializer
-// Line: 17
-
-
-using System;
-using System.Collections.Generic;
-
-class Data
-{
- public static int Count;
-}
-
-public class Test
-{
- static void Main ()
- {
- var c = new Data { Count = 10 };
- }
-}
+++ /dev/null
-// CS1918: Members of value type `S' cannot be assigned using a property `C.Value' object initializer
-// Line: 18
-
-
-struct S
-{
- public int X;
-}
-
-class C
-{
- public S Value {
- set { }
- }
-
- static void Main ()
- {
- C c = new C { Value = { X = 2 } };
- }
-}
+++ /dev/null
-// CS1920: An element initializer cannot be empty
-// Line: 11
-
-
-using System.Collections.Generic;
-
-public class Test
-{
- static void Main ()
- {
- var d = new Dictionary <string, int> { { } };
- }
-}
+++ /dev/null
-// CS1922: A field or property `System.Type' cannot be initialized with a collection object initializer because type `System.Type' does not implement `System.Collections.IEnumerable' interface
-// Line: 13
-
-using System;
-using System.Xml.Serialization;
-
-namespace test
-{
- public class Test
- {
- static void Main ()
- {
- XmlSerializer xs = new XmlSerializer (typeof (string), new Type () { typeof (bool) });
- }
- }
-}
-
+++ /dev/null
-// CS1922: A field or property `Data.Value' cannot be initialized with a collection object initializer because type `int' does not implement `System.Collections.IEnumerable' interface
-// Line: 16
-
-
-using System;
-
-class Data
-{
- public int Value;
-}
-
-public class Test
-{
- static void Main ()
- {
- var c = new Data { Value = { 0, 1, 2 } };
- }
-}
+++ /dev/null
-// CS1925: Cannot initialize object of type `string[]' with a collection initializer
-// Line: 10
-
-class C
-{
- string[] values;
-
- static void Main ()
- {
- var v = new C { values = { "a" } };
- }
-}
+++ /dev/null
-// CS1928: Type `System.Collections.IList' does not contain a member `Frobnicate' and the best extension method overload `Extensions.Frobnicate<Test>(this Test)' has some invalid arguments
-// Line: 20
-
-using System;
-using System.Collections;
-
-static class Extensions
-{
- public static void Frobnicate<T> (this T foo) where T : IList
- {
- }
-}
-
-public class Test
-{
- IList mFoo;
-
- void Frobnicate ()
- {
- mFoo.Frobnicate<Test> ();
- }
-}
+++ /dev/null
-// CS1928: Type `int' does not contain a member `Foo' and the best extension method overload `S.Foo(this uint)' has some invalid arguments
-// Line: 15
-
-static class S
-{
- public static void Foo (this uint i)
- {
- }
-}
-
-class B
-{
- static void Main ()
- {
- 55.Foo ();
- }
-}
+++ /dev/null
-// CS1928: Type `string' does not contain a member `Check' and the best extension method overload `C.Check(this string, int)' has some invalid arguments
-// Line: 12
-
-static class C
-{
- public static void Check (this string s, int i)
- {
- }
-
- static void Main ()
- {
- "alo".Check ("o");
- }
-}
+++ /dev/null
-// CS1929: Extension method instance type `int' cannot be converted to `string'
-// Line: 12
-
-static class C
-{
- public static void Check (this string s)
- {
- }
-
- static void Main ()
- {
- 1.Check ();
- }
-}
+++ /dev/null
-// CS1930: A range variable `i' has already been declared in this scope
-// Line: 14
-
-
-using System;
-using System.Linq;
-
-class C
-{
- public static void Main ()
- {
- var e = from v in "a"
- let i = 1
- let i = 2
- select v;
- }
-}
+++ /dev/null
-// CS1930: A range variable `v' has already been declared in this scope
-// Line: 13
-
-
-using System;
-using System.Linq;
-
-class C
-{
- public static void Main ()
- {
- var e = from v in "a"
- let v = 1
- select v;
- }
-}
+++ /dev/null
-// CS1931: A range variable `i' conflicts with a previous declaration of `i'
-// Line: 13
-
-
-using System;
-using System.Linq;
-
-class C
-{
- public void Foo (int i)
- {
- var e = from v in "a"
- let i = 2
- select v;
- }
-}
+++ /dev/null
-// CS1931: A range variable `ii' conflicts with a previous declaration of `ii'
-// Line: 14
-
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-
-class Test
-{
- public static void Main ()
- {
- int[] int_array = null;
- int ii = 0;
- IEnumerable<int> e = from int ii in int_array select "1";
- }
-}
+++ /dev/null
-// CS1931: A range variable `i' conflicts with a previous declaration of `i'
-// Line: 12
-
-using System;
-using System.Linq;
-
-class C
-{
- public static void Main ()
- {
- int i = 9;
- var e = from i in "a"
- select 1;
- }
-}
+++ /dev/null
-// CS1931: A range variable `i' conflicts with a previous declaration of `i'
-// Line: 14
-
-
-using System;
-using System.Linq;
-
-class C
-{
- public static void Main ()
- {
- int i = 9;
- var e = from v in "a"
- let i = 2
- select v;
- }
-}
+++ /dev/null
-// CS1932: A range variable `ii' cannot be initialized with `method group'
-// Line: 12
-
-using System;
-using System.Linq;
-
-class C
-{
- public void Foo (int i)
- {
- var e = from v in "a"
- let ii = Foo
- select v;
- }
-}
+++ /dev/null
-// CS1932: A range variable `ii' cannot be initialized with `void'
-// Line: 13
-
-
-using System;
-using System.Linq;
-
-class C
-{
- public void Foo (int i)
- {
- var e = from v in "a"
- let ii = Foo (2)
- select v;
- }
-}
+++ /dev/null
-// CS1935: An implementation of `Cast' query expression pattern could not be found. Are you missing `System.Linq' using directive or `System.Core.dll' assembly reference?
-// Line: 12
-
-
-public class Test
-{
- class Enumerable {}
-
- static void Main ()
- {
- var v = new int[0];
- var foo = from int a in v where a > 0 select a;
- }
-}
+++ /dev/null
-// CS1935: An implementation of `Select' query expression pattern could not be found. Are you missing `System.Linq' using directive or `System.Core.dll' assembly reference?
-// Line: 10
-
-
-public class Test
-{
- static void Main ()
- {
- var v = new int[0];
- var foo = from a in v select a;
- }
-}
+++ /dev/null
-// CS1936: An implementation of `Select' query expression pattern for source type `Item' could not be found
-// Line: 16
-
-
-using System.Linq;
-
-class Item
-{
-}
-
-public static class Test
-{
- static void Main ()
- {
- var v = new Item ();
- var foo = from a in v select a;
- }
-}
+++ /dev/null
-// CS1930: A range variable `v' may not be passes as `ref' or `out' parameter
-// Line: 19
-
-
-using System;
-using System.Linq;
-
-class C
-{
- static int Foo (ref int value)
- {
- return 1;
- }
-
- public static void Main ()
- {
- var e = from v in "a"
- let r = 1
- select Foo (ref v);
- }
-}
+++ /dev/null
-// CS1940: Ambiguous implementation of the query pattern `Select' for source type `Multiple'
-// Line: 10
-
-class Multiple
-{
- delegate int D1 (int x);
- delegate int D2 (int x);
-
- int Select (D1 d)
- {
- return 0;
- }
-
- int Select (D2 d)
- {
- return 1;
- }
-
- public static void Main ()
- {
- var q = from x in new Multiple () select x;
- }
-}
+++ /dev/null
-// CS1942: An expression type in `select' clause is incorrect. Type inference failed in the call to `Select'
-// Line: 18
-
-using System;
-
-class TestA
-{
- public string Select<U> (Func<TestA, U> f)
- {
- return "";
- }
-}
-
-public class C
-{
- static void Main ()
- {
- string foo = from a in new TestA () select null;
- }
-}
+++ /dev/null
-// CS1942: An expression type in `select' clause is incorrect. Type inference failed in the call to `Select'
-// Line: 12
-
-using System;
-using System.Linq;
-
-class C
-{
- public static void Main ()
- {
- var e = from values in "abcd"
- select null;
- }
-}
+++ /dev/null
-// CS1943: An expression type is incorrect in a subsequent `from' clause in a query expression with source type `string'
-// Line: 11
-
-using System.Linq;
-
-class Test
-{
- static void Main ()
- {
- var e = from a in "abcd"
- from b in new Test ()
- select b;
- }
-}
+++ /dev/null
-// CS1944: An expression tree cannot contain an unsafe pointer operation
-// Line: 15
-// Compiler options: -unsafe
-
-using System;
-using System.Linq.Expressions;
-
-class C
-{
- unsafe delegate int* D (int i);
-
- public static void Main ()
- {
- unsafe {
- Expression<D> e = (int p) => &p;
- }
- }
-}
+++ /dev/null
-// CS1944: An expression tree cannot contain an unsafe pointer operation
-// Line: 15
-// Compiler options: -unsafe
-
-using System;
-using System.Linq.Expressions;
-
-class C
-{
- unsafe delegate int D (int* i);
-
- public static void Main ()
- {
- unsafe {
- Expression<D> e = p => *p;
- }
- }
-}
+++ /dev/null
-// CS1944: An expression tree cannot contain an unsafe pointer operation
-// Line: 15
-// Compiler options: -unsafe
-
-using System;
-using System.Linq.Expressions;
-
-class C
-{
- unsafe delegate int* D (int* i);
-
- public static void Main ()
- {
- unsafe {
- Expression<D> e = p => p + 1;
- }
- }
-}
+++ /dev/null
-// CS1944: An expression tree cannot contain an unsafe pointer operation
-// Line: 13
-// Compiler options: -unsafe
-
-using System;
-using System.Linq.Expressions;
-
-class C
-{
- public static void Main ()
- {
- unsafe {
- Expression<Func<int>> e = () => sizeof (long*);
- }
- }
-}
+++ /dev/null
-// CS1944: An expression tree cannot contain an unsafe pointer operation
-// Line: 14
-// Compiler options: -unsafe
-
-using System;
-using System.Linq.Expressions;
-
-class C
-{
- unsafe delegate byte* D (int*[] d);
- public static void Main ()
- {
- unsafe {
- Expression<D> e6 = (p) => (byte*)p [10];
- }
- }
-}
+++ /dev/null
-// CS1944: An expression tree cannot contain an unsafe pointer operation
-// Line: 15
-// Compiler options: -unsafe
-
-using System;
-using System.Linq.Expressions;
-
-class C
-{
- unsafe delegate int* D ();
-
- public static void Main ()
- {
- unsafe {
- Expression<D> e = () => default (int*);
- }
- }
-}
+++ /dev/null
-// CS1944: An expression tree cannot contain an unsafe pointer operation
-// Line: 14
-// Compiler options: -unsafe
-
-using System;
-using System.Linq.Expressions;
-
-class C
-{
- public static void Main ()
- {
- unsafe {
- int*[] p = null;
- Expression<Func<int>> e6 = () => (int)p [10];
- }
- }
-}
+++ /dev/null
-// CS1945: An expression tree cannot contain an anonymous method expression
-// Line: 11
-
-using System;
-using System.Linq.Expressions;
-
-class C
-{
- public static void Main ()
- {
- Expression<Func<Func<int>>> e = () => delegate () { return 1; };
- }
-}
+++ /dev/null
-// CS1946: An anonymous method cannot be converted to an expression tree
-// Line: 11
-
-using System;
-using System.Linq.Expressions;
-
-class C
-{
- delegate string D ();
-
- public static void Main ()
- {
- Expression<D> e = delegate () { return "a"; };
- }
-}
+++ /dev/null
-// CS1947: A range variable `v' cannot be assigned to. Consider using `let' clause to store the value
-// Line: 15
-
-using System;
-using System.Linq;
-
-class Test
-{
- public static int Main ()
- {
- int[] int_array = new int [] { 0, 1 };
-
- var e = from int i in int_array
- let v = true
- where v = false
- select v;
- }
-}
+++ /dev/null
-// CS1948: A range variable `T' conflicts with a method type parameter
-// Line: 13
-
-using System;
-using System.Linq;
-
-class C
-{
- public static void Foo <T> ()
- {
- var s = "0";
- var e = from T in "a"
- select T + s;
- }
-}
+++ /dev/null
-// CS1948: A range variable `T' conflicts with a method type parameter
-// Line: 12
-
-
-using System;
-using System.Linq;
-
-class C
-{
- public static void Foo <T> ()
- {
- var e = from T in "a"
- select T;
- }
-}
+++ /dev/null
-// CS1954: The best overloaded collection initalizer method `Data.Add(__arglist)' has some invalid arguments
-// Line: 16
-
-
-using System;
-using System.Collections;
-
-class Data : IEnumerable
-{
- public IEnumerator GetEnumerator () { return null; }
-
- public void Add (__arglist)
- {
- }
-}
-
-public class Test
-{
- static void Main ()
- {
- var c = new Data { 1 };
- }
-}
+++ /dev/null
-// CS1951: An expression tree parameter cannot use `ref' or `out' modifier
-// Line: 13
-
-using System;
-using System.Linq.Expressions;
-
-class C
-{
- delegate int D (out int a);
-
- public static void Main ()
- {
- Expression<D> e = (out int a) => a = 0;
- }
-}
+++ /dev/null
-// CS1951: An expression tree parameter cannot use `ref' or `out' modifier
-// Line: 13
-
-using System;
-using System.Linq.Expressions;
-
-class C
-{
- delegate int D (ref int a);
-
- public static void Main ()
- {
- Expression<D> e = (ref int a) => a;
- }
-}
+++ /dev/null
-// CS1952: An expression tree cannot contain a method with variable arguments
-// Line: 11
-
-using System;
-using System.Linq.Expressions;
-
-class C
-{
- void Foo ()
- {
- Expression<Func<int>> e = () => InstanceArgList (__arglist (0));
- }
-
- int InstanceArgList (__arglist)
- {
- return 54;
- }
-}
+++ /dev/null
-// CS1953: An expression tree cannot contain an expression with method group
-// Line: 11
-
-using System;
-using System.Linq.Expressions;
-
-class C
-{
- public static void Main ()
- {
- Expression<Func<bool>> e = () => "1".ToString is string;
- }
-}
\ No newline at end of file
+++ /dev/null
-// CS1954: The best overloaded collection initalizer method `Data.Add(ref int)' cannot have 'ref', or `out' modifier
-// Line: 16
-
-
-using System;
-using System.Collections;
-
-class Data : IEnumerable
-{
- public IEnumerator GetEnumerator () { return null; }
-
- public void Add (ref int b)
- {
- }
-}
-
-public class Test
-{
- static void Main ()
- {
- var c = new Data { 1 };
- }
-}
+++ /dev/null
-// CS1959: Type parameter `T' cannot be declared const
-// Line: 8
-
-struct S
-{
- public void Foo<T> () where T : struct
- {
- const T t = null;
- }
-}
+++ /dev/null
-// CS1959: Type parameter `T' cannot be declared const
-// Line: 10
-
-class C
-{
-}
-
-class C<T> where T : C
-{
- const T t = null;
-}
+++ /dev/null
-// CS1960: Variant type parameters can only be used with interfaces and delegates
-// Line: 5
-// Compiler options: -langversion:future
-
-class A<in T>
-{
-}
+++ /dev/null
-// CS1960: Variant type parameters can only be used with interfaces and delegates
-// Line: 5
-// Compiler options: -langversion:future
-
-class A<out T>
-{
-}
+++ /dev/null
-// CS1961: The contravariant type parameter `T' must be invariantly valid on `B<T>()'
-// Line: 9
-// Compiler options: -langversion:future
-
-interface A<T>
-{
-}
-
-delegate A<A<T>> B<in T> ();
+++ /dev/null
-// CS1961: The contravariant type parameter `T' must be invariantly valid on `B<T>(A<T>)'
-// Line: 9
-// Compiler options: -langversion:future
-
-interface A<T>
-{
-}
-
-delegate void B<in T> (A<T> a);
+++ /dev/null
-// CS1961: The contravariant type parameter `T' must be invariantly valid on `B<T>(A<A<T>>)'
-// Line: 9
-// Compiler options: -langversion:future
-
-interface A<T>
-{
-}
-
-delegate void B<in T> (A<A<T>> a);
+++ /dev/null
-// CS1961: The contravariant type parameter `T' must be covariantly valid on `B<T>.A'
-// Line: 9
-// Compiler options: -langversion:future
-
-interface A<out T>
-{
-}
-
-interface B<in T>
-{
- A<T> A { get; }
-}
+++ /dev/null
-// CS1961: The contravariant type parameter `T' must be invariantly valid on `B<T>.C(A<T>)'
-// Line: 9
-// Compiler options: -langversion:future
-
-interface A<T>
-{
-}
-
-interface B<in T>
-{
- void C(A<T> a);
-}
+++ /dev/null
-// CS1961: The covariant type parameter `U' must be contravariantly valid on `D<U>()'
-// Line: 9
-// Compiler options: -langversion:future
-
-interface I<in T>
-{
-}
-
-delegate I<U[]> D<out U> ();
+++ /dev/null
-// CS1961: The contravariant type parameter `T' must be invariantly valid on `B<T>'
-// Line: 9
-// Compiler options: -langversion:future
-
-interface A<T>
-{
-}
-
-interface B<in T> : A<T>
-{
-}
+++ /dev/null
-// CS1961: The contravariant type parameter `T' must be covariantly valid on `B<T>'
-// Line: 9
-// Compiler options: -langversion:future
-
-interface A<out T>
-{
-}
-
-interface B<in T> : A<T>
-{
-}
+++ /dev/null
-// CS1961: The covariant type parameter `T' must be invariantly valid on `B<T>.A'
-// Line: 9
-// Compiler options: -langversion:future
-
-interface A<T>
-{
-}
-
-interface B<out T>
-{
- A<T> A { get; }
-}
+++ /dev/null
-// CS1961: The covariant type parameter `T' must be invariantly valid on `B<T>.A'
-// Line: 9
-// Compiler options: -langversion:future
-
-interface A<T>
-{
-}
-
-interface B<out T>
-{
- A<A<T>> A { get; }
-}
+++ /dev/null
-// CS1961: The contravariant type parameter `T' must be covariantly valid on `D<T>()'
-// Line: 5
-// Compiler options: -langversion:future
-
-delegate T D<in T> ();
+++ /dev/null
-// CS1961: The covariant type parameter `T' must be invariantly valid on `B<T>.C()'
-// Line: 9
-// Compiler options: -langversion:future
-
-interface A<T>
-{
-}
-
-interface B<out T>
-{
- A<T> C();
-}
+++ /dev/null
-// CS1961: The covariant type parameter `T' must be invariantly valid on `B<T>.C()'
-// Line: 9
-// Compiler options: -langversion:future
-
-interface A<T>
-{
-}
-
-interface B<out T>
-{
- A<A<T>> C();
-}
+++ /dev/null
-// CS1961: The covariant type parameter `T' must be invariantly valid on `B<T>.C(A<T>)'
-// Line: 9
-// Compiler options: -langversion:future
-
-interface A<T>
-{
-}
-
-interface B<out T>
-{
- void C(A<T> a);
-}
+++ /dev/null
-// CS1923: The covariant type parameter `T' must be invariantly valid on `B<T>.C(A<A<T>>)'
-// Line: 9
-// Compiler options: -langversion:future
-
-interface A<T>
-{
-}
-
-interface B<out T>
-{
- void C(A<A<T>> a);
-}
+++ /dev/null
-// CS1961: The covariant type parameter `T' must be invariantly valid on `B<T>()'
-// Line: 9
-// Compiler options: -langversion:future
-
-interface A<T>
-{
-}
-
-delegate A<T> B<out T> ();
+++ /dev/null
-// CS1961: The covariant type parameter `T' must be invariantly valid on `B<T>()'
-// Line: 9
-// Compiler options: -langversion:future
-
-interface A<T>
-{
-}
-
-delegate A<A<T>> B<out T> ();
+++ /dev/null
-// CS1961: The covariant type parameter `T' must be invariantly valid on `B<T>(A<T>)'
-// Line: 9
-// Compiler options: -langversion:future
-
-interface A<T>
-{
-}
-
-delegate void B<out T> (A<T> a);
+++ /dev/null
-// CS1961: The covariant type parameter `T' must be invariantly valid on `B<T>(A<A<T>>)'
-// Line: 9
-// Compiler options: -langversion:future
-
-interface A<T>
-{
-}
-
-delegate void B<out T> (A<A<T>> a);
+++ /dev/null
-// CS1961: The covariant type parameter `T' must be contravariantly valid on `B<T>.A'
-// Line: 9
-// Compiler options: -langversion:future
-
-interface A<in T>
-{
-}
-
-interface B<out T>
-{
- A<T> A { get; }
-}
+++ /dev/null
-// CS1961: The covariant type parameter `T' must be invariantly valid on `B<T>.C(A<T>)'
-// Line: 9
-// Compiler options: -langversion:future
-
-interface A<T>
-{
-}
-
-interface B<out T>
-{
- void C(A<T> a);
-}
+++ /dev/null
-// CS1961: The contravariant type parameter `T' must be invariantly valid on `B<T>.A'
-// Line: 9
-// Compiler options: -langversion:future
-
-interface A<T>
-{
-}
-
-interface B<in T>
-{
- A<T> A { get; }
-}
+++ /dev/null
-// CS1961: The covariant type parameter `U' must be contravariantly valid on `D<U>()'
-// Line: 7
-// Compiler options: -langversion:future
-
-interface IContravariant<in T> { }
-
-delegate IContravariant<U[]> D<out U> ();
+++ /dev/null
-// CS1961: The covariant type parameter `T' must be invariantly valid on `B<T>'
-// Line: 9
-// Compiler options: -langversion:future
-
-interface A<T>
-{
-}
-
-interface B<out T> : A<T>
-{
-}
+++ /dev/null
-// CS1961: The covariant type parameter `T' must be contravariantly valid on `B<T>'
-// Line: 9
-// Compiler options: -langversion:future
-
-interface A<in T>
-{
-}
-
-interface B<out T> : A<T>
-{
-}
+++ /dev/null
-// CS1961: The contravariant type parameter `T' must be invariantly valid on `A<T>.B(out T)'
-// Line: 5
-// Compiler options: -langversion:future
-
-interface A<in T>
-{
- void B(out T t);
-}
+++ /dev/null
-// CS1961: The contravariant type parameter `T' must be invariantly valid on `A<T>.B(ref T)'
-// Line: 5
-// Compiler options: -langversion:future
-
-interface A<in T>
-{
- void B(ref T t);
-}
+++ /dev/null
-// CS1961: The covariant type parameter `T' must be contravariantly valid on `A<T>.B(T)'
-// Line: 7
-// Compiler options: -langversion:future
-
-interface A<out T>
-{
- void B(T t);
-}
+++ /dev/null
-// CS1961: The covariant type parameter `T' must be invariantly valid on `A<T>.B(out T)'
-// Line: 7
-// Compiler options: -langversion:future
-
-interface A<out T>
-{
- void B(out T t);
-}
+++ /dev/null
-// CS1961: The covariant type parameter `T' must be invariantly valid on `A<T>.B(ref T)'
-// Line: 5
-// Compiler options: -langversion:future
-
-interface A<out T>
-{
- void B(ref T t);
-}
+++ /dev/null
-// CS1961: The covariant type parameter `V' must be invariantly valid on `Both<U,V>(Covariant<None<Contra<V>>>)'
-// Line: 9
-// Compiler options: -langversion:future
-
-delegate T Covariant<out T> ();
-delegate void Contra<in T> (T t);
-delegate void None<T> (T t);
-
-delegate void Both<in U, out V> (Covariant<None<Contra<V>>> b);
+++ /dev/null
-// CS1961: The covariant type parameter `V' must be contravariantly valid on `I<V>.Foo<T>(T)'
-// Line: 6
-
-interface I<out V>
-{
- void Foo<T> (T t) where T : V;
-}
+++ /dev/null
-// CS1961: The contravariant type parameter `T' must be invariantly valid on `B<T>.A'
-// Line: 9
-// Compiler options: -langversion:future
-
-interface A<T>
-{
-}
-
-interface B<in T>
-{
- A<A<T>> A { get; }
-}
+++ /dev/null
-// CS1961: The contravariant type parameter `T' must be invariantly valid on `B<T>.C()'
-// Line: 9
-// Compiler options: -langversion:future
-
-interface A<T>
-{
-}
-
-interface B<in T>
-{
- A<T> C();
-}
+++ /dev/null
-// CS1961: The contravariant type parameter `T' must be invariantly valid on `B<T>.C()'
-// Line: 9
-// Compiler options: -langversion:future
-
-interface A<T>
-{
-}
-
-interface B<in T>
-{
- A<A<T>> C();
-}
+++ /dev/null
-// CS1961: The contravariant type parameter `T' must be invariantly valid on `B<T>.C(A<T>)'
-// Line: 9
-// Compiler options: -langversion:future
-
-interface A<T>
-{
-}
-
-interface B<in T>
-{
- void C(A<T> a);
-}
+++ /dev/null
-// CS1961: The contravariant type parameter `T' must be invariantly valid on `B<T>.C(A<A<T>>)'
-// Line: 9
-// Compiler options: -langversion:future
-
-interface A<T>
-{
-}
-
-interface B<in T>
-{
- void C(A<A<T>> a);
-}
+++ /dev/null
-// CS1961: The contravariant type parameter `T' must be invariantly valid on `B<T>()'
-// Line: 9
-// Compiler options: -langversion:future
-
-interface A<T>
-{
-}
-
-delegate A<T> B<in T> ();
+++ /dev/null
-// CS1961: The contravariant type parameter `T' must be covariantly valid on `A<T>.B()'
-// Line: 7
-// Compiler options: -langversion:future
-
-interface A<in T>
-{
- T B();
-}
+++ /dev/null
-// CS3001: Argument type `sbyte' is not CLS-compliant
-// Line: 9
-// Compiler options: -warnaserror -warn:1
-
-using System;
-[assembly:CLSCompliant (true)]
-
-public static class CLSClass
-{
- public static void Foo (this sbyte value) { }
-}
+++ /dev/null
-// CS3002: Return type of `CLSClass.Foo()' is not CLS-compliant
-// Line: 10
-// Compiler options: -warnaserror -warn:1
-
-using System;
-[assembly:CLSCompliant(true)]
-
-public class CLSClass
-{
- protected ulong? Foo()
- {
- return 5;
- }
-}
+++ /dev/null
-// CS3003: Type of `S.test2' is not CLS-compliant
-// Line: 11
-// Compiler options: -unsafe -warnaserror -warn:1
-
-using System;
-
-[assembly: CLSCompliant (true)]
-
-public unsafe struct S
-{
- public fixed bool test2 [4];
-}
+++ /dev/null
-// CS3005: Identifier `CLSClass.Method<T>(int)' differing only in case is not CLS-compliant
-// Line: 12
-// Compiler options: -warnaserror
-
-[assembly:System.CLSCompliant (true)]
-
-public class BaseClass {
- public int method;
-}
-
-public class CLSClass : BaseClass {
- public static void Method<T>(int arg) {}
-}
+++ /dev/null
-// CS3009: `C': base type `C<ulong>' is not CLS-compliant
-// Line: 14
-// Compiler options: -warnaserror -warn:1
-
-using System;
-[assembly:CLSCompliant(true)]
-
-public class C<T>
-{
-}
-
-public class C : C<ulong>
-{
-}
+++ /dev/null
-// CS3019: CLS compliance checking will not be performed on `T' because it is not visible from outside this assembly
-// Line: 8
-// Compiler options: -warnaserror -warn:2
-
-using System;
-[assembly:CLSCompliant(true)]
-
-public class CLSClass<[CLSCompliant (false)] T>
-{
-}
\ No newline at end of file
+++ /dev/null
-// CS3024: Constraint type `A' is not CLS-compliant
-// Line: 15
-// Compiler options: -warn:1 -warnaserror
-
-using System;
-[assembly:CLSCompliant (true)]
-
-[CLSCompliant (false)]
-public abstract class A
-{
-}
-
-public class C
-{
- public static void Foo<T>() where T : A
- {
- }
-}
-
+++ /dev/null
-// CS3024: Constraint type `I' is not CLS-compliant
-// Line: 13
-// Compiler options: -warn:1 -warnaserror
-
-using System;
-[assembly:CLSCompliant (true)]
-
-[CLSCompliant (false)]
-public interface I
-{
-}
-
-public class C<T> where T : I
-{
-}
-
dcs0165.cs NO ERROR # Bug 593369
# all the following are from bug #628673
+cs0122-35.cs
+cs0012.cs
+cs0012-2.cs
+cs0012-3.cs NO ERROR
+cs0012-4.cs NO ERROR
+cs0012-5.cs NO ERROR
+cs0012-6.cs
+cs0012-7.cs
+cs0012-8.cs
+cs0012-9.cs
+cs0012-10.cs
dcs1979.cs
-gcs0122-2.cs
-gcs0307-6.cs
-gcs0308-7.cs
cs0023-11.cs
cs0111-3.cs
cs0122-19.cs
cs0122-8.cs
cs0168-2.cs
cs0177-8.cs NO ERROR
+cs0307-6.cs
+cs0308-7.cs
+cs0315.cs NO ERROR
cs0520.cs
cs1501-2.cs NO ERROR # Needs clarification
cs1509.cs
cs1540-6.cs NO ERROR Is it real error
# all the following are from bug #628673
-gcs0122-2.cs
-gcs0307-6.cs
-gcs0308-7.cs
+cs0122-35.cs
cs0012.cs
cs0012-2.cs
cs0012-3.cs NO ERROR
cs0122-8.cs
cs0168-2.cs
cs0177-8.cs NO ERROR
+cs0307-6.cs
+cs0308-7.cs
+cs0315.cs NO ERROR
cs0520.cs
cs1501-2.cs NO ERROR # Needs clarification
cs1509.cs