Imported Upstream version 3.12.0

Former-commit-id: cf92446697332992ec36726e78eb8703e1f259d7
This commit is contained in:
Jo Shields
2015-01-13 10:44:36 +00:00
parent 8b9b85e7f5
commit 181b81b4a4
659 changed files with 12743 additions and 16300 deletions

10
mcs/errors/cs0023-25.cs Normal file
View File

@@ -0,0 +1,10 @@
// CS0023: The `?' operator cannot be applied to operand of type `T'
// Line: 8
class C
{
static void Foo<T> (T t) where T : struct
{
var r = t?.ToString ();
}
}

15
mcs/errors/cs0111-12.cs Normal file
View File

@@ -0,0 +1,15 @@
// CS0111: A member `S3.S3(string)' is already defined. Rename this member or use different parameter types
// Line: 6
struct S3 (string s)
{
public S3 (string s)
: this (1)
{
}
public S3 (int i)
: this ("")
{
}
}

15
mcs/errors/cs0411-24.cs Normal file
View File

@@ -0,0 +1,15 @@
// CS0411: The type arguments for method `C.Foo<T>(out T)' cannot be inferred from the usage. Try specifying the type arguments explicitly
// Line: 8
public class C
{
public static void Main ()
{
Foo (out var y);
}
static void Foo<T> (out T t)
{
t = default (T);
}
}

View File

@@ -1,26 +0,0 @@
// CS0429: Unreachable expression code detected
// Line: 24
// Compiler options: -warnaserror
using System;
struct S
{
}
class C
{
public static implicit operator S (C c)
{
return new S ();
}
}
class Program
{
static void Main ()
{
C c = new C ();
Console.WriteLine (c ?? new S ());
}
}

9
mcs/errors/cs0516-3.cs Normal file
View File

@@ -0,0 +1,9 @@
// CS0516: Constructor `Sample.Sample()' cannot call itself
// Line: 6
struct Sample {
public Sample ()
: this ()
{
}
}

View File

@@ -1,9 +1,9 @@
// CS0516: Constructor `Sample.Sample()' cannot call itself
// Line: 5
// Line: 6
class Sample {
public Sample (): this () {}
public Sample ()
: this ()
{
}
}

View File

@@ -1,14 +0,0 @@
// CS0568: Structs cannot contain explicit parameterless constructors
// Line: 5
struct A {
int a;
A () { a = 1; }
}
class D {
static void Main ()
{
A [] a = new A [10];
}
}

7
mcs/errors/cs0573-2.cs Normal file
View File

@@ -0,0 +1,7 @@
// CS0573: 'S': Structs cannot have instance property or field initializers
// Line: 6
struct S
{
public int Prop { get; set; } = 3;
}

7
mcs/errors/cs0573.cs Normal file
View File

@@ -0,0 +1,7 @@
// CS0573: 'S': Structs cannot have instance property or field initializers
// Line: 6
struct S
{
int v = 0;
}

20
mcs/errors/cs0619-58.cs Normal file
View File

@@ -0,0 +1,20 @@
// CS0619: `S.S()' is obsolete: `ctor'
// Line: 18
using System;
struct S
{
[Obsolete ("ctor", true)]
public S ()
{
}
}
class C
{
public static void Main ()
{
new S ();
}
}

11
mcs/errors/cs0677-5.cs Normal file
View File

@@ -0,0 +1,11 @@
// CS0677: `X.e': A volatile field cannot be of the type `E'
// Line: 10
enum E : long
{
}
class X
{
volatile E e;
}

15
mcs/errors/cs0815-7.cs Normal file
View File

@@ -0,0 +1,15 @@
// CS0815: An implicitly typed local variable declaration cannot be initialized with `void'
// Line: 8
class X
{
public static void Main ()
{
Foo (out var x = Main ());
}
static void Foo (out int i)
{
i = 0;
}
}

15
mcs/errors/cs0841-5.cs Normal file
View File

@@ -0,0 +1,15 @@
// CS0841: A local variable `x' cannot be used before it is declared
// Line: 8
class X
{
public static void Main ()
{
Foo (x, out var x);
}
static void Foo (int arg, out int value)
{
value = 3;
}
}

22
mcs/errors/cs1501-18.cs Normal file
View File

@@ -0,0 +1,22 @@
// CS1501: No overload for method `Bar' takes `2' arguments
// Line: 19
using System;
class T
{
void Foo (int arg, Action a)
{
}
void Foo (string title, Action a)
{
}
void Bar ()
{
Foo (arg: 1, a: () => {
Bar ("a", "b");
});
}
}

14
mcs/errors/cs1503-17.cs Normal file
View File

@@ -0,0 +1,14 @@
// CS1501: Argument `#1' cannot convert `ref string' expression to type `ref int'
// Line: 8
class C
{
public static void Main ()
{
Foo (ref var x = "");
}
static void Foo (ref int i)
{
}
}

View File

@@ -1,4 +1,4 @@
// CS1525: Unexpected symbol `ref', expecting `.', `?', `[', `<operator>', or `identifier'
// CS1525: Unexpected symbol `ref'
// Line: 8
public class Test

18
mcs/errors/cs1615-3.cs Normal file
View File

@@ -0,0 +1,18 @@
// CS1615: Argument `#1' does not require `out' modifier. Consider removing `out' modifier
// Line: 8
public class C
{
public static void Main ()
{
Foo (out var y);
}
static void Foo (int x)
{
}
static void Foo (string x)
{
}
}

10
mcs/errors/cs1644-45.cs Normal file
View File

@@ -0,0 +1,10 @@
// CS1644: Feature `struct parameterless instance constructor' cannot be used because it is not part of the C# 5.0 language specification
// Line: 12
// Compiler options: -langversion:5
struct S
{
public S ()
{
}
}

11
mcs/errors/cs1644-47.cs Normal file
View File

@@ -0,0 +1,11 @@
// CS1644: Feature `declaration expression' cannot be used because it is not part of the C# 5.0 language specification
// Line: 12
// Compiler options: -langversion:5
class C
{
public static void Main ()
{
int.TryParse ("0", out var v);
}
}

16
mcs/errors/cs1736-2.cs Normal file
View File

@@ -0,0 +1,16 @@
// CS1736: The expression being assigned to optional parameter `s' must be a constant or default value
// Line: 11
struct S
{
public S ()
{
}
}
class X
{
public void Foo (S s = new S ())
{
}
}

Some files were not shown because too many files have changed in this diff Show More