You've already forked linux-packaging-mono
Imported Upstream version 5.4.0.167
Former-commit-id: 5624ac747d633e885131e8349322922b6a59baaa
This commit is contained in:
parent
e49d6f06c0
commit
536cd135cc
10
mcs/errors/cs0019-72.cs
Normal file
10
mcs/errors/cs0019-72.cs
Normal file
@ -0,0 +1,10 @@
|
||||
// CS0019: Operator `??' cannot be applied to operands of type `void' and `throw expression'
|
||||
// Line: 20
|
||||
|
||||
class C
|
||||
{
|
||||
public static void Main ()
|
||||
{
|
||||
var s = Main () ?? throw null;
|
||||
}
|
||||
}
|
16
mcs/errors/cs0128-3.cs
Normal file
16
mcs/errors/cs0128-3.cs
Normal file
@ -0,0 +1,16 @@
|
||||
// CS0128: A local variable named `x' is already defined in this scope
|
||||
// Line: 9
|
||||
|
||||
class X
|
||||
{
|
||||
public static void Main ()
|
||||
{
|
||||
Foo (out int x);
|
||||
Foo (out int x);
|
||||
}
|
||||
|
||||
static void Foo (out int arg)
|
||||
{
|
||||
arg = 2;
|
||||
}
|
||||
}
|
13
mcs/errors/cs0128-4.cs
Normal file
13
mcs/errors/cs0128-4.cs
Normal file
@ -0,0 +1,13 @@
|
||||
// CS0128: A local variable named `s' is already defined in this scope
|
||||
// Line: 12
|
||||
|
||||
class C
|
||||
{
|
||||
public static void Main ()
|
||||
{
|
||||
object o = null;
|
||||
|
||||
var x1 = o is string s;
|
||||
var x2 = o is string s;
|
||||
}
|
||||
}
|
13
mcs/errors/cs0136-20.cs
Normal file
13
mcs/errors/cs0136-20.cs
Normal file
@ -0,0 +1,13 @@
|
||||
// CS0136: A local variable named `s' cannot be declared in this scope because it would give a different meaning to `s', which is already used in a `parent or current' scope to denote something else
|
||||
// Line: 10
|
||||
|
||||
internal class Program
|
||||
{
|
||||
public static void Main ()
|
||||
{
|
||||
object o = null;
|
||||
if (o is string s) {
|
||||
int s = 1;
|
||||
}
|
||||
}
|
||||
}
|
7
mcs/errors/cs0155-5.cs
Normal file
7
mcs/errors/cs0155-5.cs
Normal file
@ -0,0 +1,7 @@
|
||||
// CS0155: The type caught or thrown must be derived from System.Exception
|
||||
// Line: 9
|
||||
|
||||
class X
|
||||
{
|
||||
public int Test () => throw "";
|
||||
}
|
19
mcs/errors/cs0162-21.cs
Normal file
19
mcs/errors/cs0162-21.cs
Normal file
@ -0,0 +1,19 @@
|
||||
// CS0162: Unreachable code detected
|
||||
// Line: 12
|
||||
// Compiler options: -warnaserror -warn:2
|
||||
|
||||
using System;
|
||||
|
||||
class X
|
||||
{
|
||||
void Test ()
|
||||
{
|
||||
var x = true ? throw new NullReferenceException () : 1;
|
||||
x = 2;
|
||||
return;
|
||||
}
|
||||
|
||||
static void Main ()
|
||||
{
|
||||
}
|
||||
}
|
14
mcs/errors/cs0165-56.cs
Normal file
14
mcs/errors/cs0165-56.cs
Normal file
@ -0,0 +1,14 @@
|
||||
// CS0165: Use of unassigned local variable `s'
|
||||
// Line: 12
|
||||
|
||||
class X
|
||||
{
|
||||
static string Foo (object arg)
|
||||
{
|
||||
if (arg is string s) {
|
||||
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
}
|
54
mcs/errors/cs0165-57.cs
Normal file
54
mcs/errors/cs0165-57.cs
Normal file
@ -0,0 +1,54 @@
|
||||
// CS0165: Use of unassigned local variable `v'
|
||||
// Line: 52
|
||||
|
||||
struct Vector3
|
||||
{
|
||||
int field1, field2, field3;
|
||||
}
|
||||
|
||||
public class C
|
||||
{
|
||||
void Update ()
|
||||
{
|
||||
int v1 = 0;
|
||||
int v2 = 0;
|
||||
int v3 = 0;
|
||||
int v4 = 0;
|
||||
int v5 = 0;
|
||||
int v6 = 0;
|
||||
int v7 = 0;
|
||||
int v8 = 0;
|
||||
int v9 = 0;
|
||||
int v10 = 0;
|
||||
int v11 = 0;
|
||||
int v12 = 0;
|
||||
int v13 = 0;
|
||||
int v14 = 0;
|
||||
int v15 = 0;
|
||||
int v16 = 0;
|
||||
int v17 = 0;
|
||||
int v18 = 0;
|
||||
int v19 = 0;
|
||||
int v20 = 0;
|
||||
int v21 = 0;
|
||||
int v22 = 0;
|
||||
int v23 = 0;
|
||||
int v24 = 0;
|
||||
int v25 = 0;
|
||||
int v26 = 0;
|
||||
int v27 = 0;
|
||||
int v29;
|
||||
|
||||
Vector3 v;
|
||||
if (v1 == 0)
|
||||
{
|
||||
v = new Vector3 ();
|
||||
}
|
||||
else if (v2 >= 0.5)
|
||||
{
|
||||
v = new Vector3 ();
|
||||
}
|
||||
|
||||
System.GC.KeepAlive (v);
|
||||
}
|
||||
}
|
49
mcs/errors/cs0165-58.cs
Normal file
49
mcs/errors/cs0165-58.cs
Normal file
@ -0,0 +1,49 @@
|
||||
// CS0165: Use of unassigned local variable `v'
|
||||
// Line: 52
|
||||
|
||||
struct Vector3
|
||||
{
|
||||
int field1, field2, field3;
|
||||
}
|
||||
|
||||
public class C
|
||||
{
|
||||
void Update ()
|
||||
{
|
||||
int v1 = 0;
|
||||
int v2 = 0;
|
||||
int v3 = 0;
|
||||
int v4 = 0;
|
||||
int v5 = 0;
|
||||
int v6 = 0;
|
||||
int v7 = 0;
|
||||
int v8 = 0;
|
||||
int v9 = 0;
|
||||
int v10 = 0;
|
||||
int v11 = 0;
|
||||
int v12 = 0;
|
||||
int v13 = 0;
|
||||
int v14 = 0;
|
||||
int v15 = 0;
|
||||
int v16 = 0;
|
||||
int v17 = 0;
|
||||
int v18 = 0;
|
||||
int v19 = 0;
|
||||
int v20 = 0;
|
||||
int v21 = 0;
|
||||
int v22 = 0;
|
||||
int v23 = 0;
|
||||
int v24 = 0;
|
||||
int v25 = 0;
|
||||
int v26 = 0;
|
||||
int v27 = 0;
|
||||
int v29;
|
||||
|
||||
Vector3 v;
|
||||
while (v8 != 0) {
|
||||
v = new Vector3 ();
|
||||
}
|
||||
|
||||
System.GC.KeepAlive (v);
|
||||
}
|
||||
}
|
10
mcs/errors/cs0173-6.cs
Normal file
10
mcs/errors/cs0173-6.cs
Normal file
@ -0,0 +1,10 @@
|
||||
// CS0173: Type of conditional expression cannot be determined because there is no implicit conversion between `throw expression' and `throw expression'
|
||||
// Line: 8
|
||||
|
||||
class C
|
||||
{
|
||||
public static void Test (bool b)
|
||||
{
|
||||
var s = b ? throw null : throw null;
|
||||
}
|
||||
}
|
20
mcs/errors/cs0208-19.cs
Normal file
20
mcs/errors/cs0208-19.cs
Normal file
@ -0,0 +1,20 @@
|
||||
// CS0208: Cannot take the address of, get the size of, or declare a pointer to a managed type `CS208.Foo'
|
||||
// Line: 17
|
||||
// Compiler options: -unsafe
|
||||
|
||||
namespace CS208
|
||||
{
|
||||
public struct Foo
|
||||
{
|
||||
public string PP { get; set; }
|
||||
}
|
||||
|
||||
public class Bar
|
||||
{
|
||||
unsafe static void Main ()
|
||||
{
|
||||
Foo f = new Foo ();
|
||||
void *s = &f;
|
||||
}
|
||||
}
|
||||
}
|
16
mcs/errors/cs0411-25.cs
Normal file
16
mcs/errors/cs0411-25.cs
Normal file
@ -0,0 +1,16 @@
|
||||
// CS0411: The type arguments for method `C.Foo<T>(System.Func<T>)' cannot be inferred from the usage. Try specifying the type arguments explicitly
|
||||
// Line: 10
|
||||
|
||||
using System;
|
||||
|
||||
public class C
|
||||
{
|
||||
public static void Main ()
|
||||
{
|
||||
Foo (() => throw null);
|
||||
}
|
||||
|
||||
static void Foo<T> (Func<T> arg)
|
||||
{
|
||||
}
|
||||
}
|
40
mcs/errors/cs0535-7.cs
Normal file
40
mcs/errors/cs0535-7.cs
Normal file
@ -0,0 +1,40 @@
|
||||
// CS0535: `CC' does not implement interface member `IA.Coordinate.set'
|
||||
// Line: 33
|
||||
|
||||
using System;
|
||||
|
||||
public interface IA
|
||||
{
|
||||
object Coordinate {
|
||||
get;
|
||||
set;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class CA : IA
|
||||
{
|
||||
public abstract object Coordinate {
|
||||
get;
|
||||
set;
|
||||
}
|
||||
}
|
||||
|
||||
public partial class CB : CA
|
||||
{
|
||||
public override object Coordinate {
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
set {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class CC : CB, IA
|
||||
{
|
||||
public new object Coordinate {
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
}
|
40
mcs/errors/cs0535-8.cs
Normal file
40
mcs/errors/cs0535-8.cs
Normal file
@ -0,0 +1,40 @@
|
||||
// CS0535: `CC' does not implement interface member `IA.this[int].set'
|
||||
// Line: 33
|
||||
|
||||
using System;
|
||||
|
||||
public interface IA
|
||||
{
|
||||
object this[int arg] {
|
||||
get;
|
||||
set;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class CA : IA
|
||||
{
|
||||
public abstract object this[int arg] {
|
||||
get;
|
||||
set;
|
||||
}
|
||||
}
|
||||
|
||||
public partial class CB : CA
|
||||
{
|
||||
public override object this[int arg] {
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
set {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class CC : CB, IA
|
||||
{
|
||||
public new object this[int arg] {
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
// CS0815: An implicitly typed local variable declaration cannot be initialized with `void'
|
||||
// Line: 8
|
||||
// Compiler options: -langversion:experimental
|
||||
|
||||
class X
|
||||
{
|
||||
public static void Main ()
|
||||
{
|
||||
Foo (out var x = Main ());
|
||||
}
|
||||
|
||||
static void Foo (out int i)
|
||||
{
|
||||
i = 0;
|
||||
}
|
||||
}
|
18
mcs/errors/cs1031-3.cs
Normal file
18
mcs/errors/cs1031-3.cs
Normal file
@ -0,0 +1,18 @@
|
||||
// CS1031: Type expected
|
||||
// Line: 16
|
||||
|
||||
public class B<Y> where Y: B<Y>
|
||||
{
|
||||
}
|
||||
|
||||
public class A<X>: B<A<X>>
|
||||
{
|
||||
}
|
||||
|
||||
public class Repro
|
||||
{
|
||||
public static void Main (string[] args)
|
||||
{
|
||||
var h = typeof (B<A<>>);
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
// CS1061: Type `int' does not contain a definition for `GetValueOrDefault' and no extension method `GetValueOrDefault' of type `int' could be found. Are you missing an assembly reference?
|
||||
// CS1061: Type `int' does not contain a definition for `GetValueOrDefault' and no extension method `GetValueOrDefault' of type `int' could be found. Are you missing `System.Collections.Generic' using directive?
|
||||
// Line: 9
|
||||
|
||||
class C
|
||||
|
@ -1,15 +0,0 @@
|
||||
// CS1501: Argument `#1' cannot convert `ref string' expression to type `ref int'
|
||||
// Line: 8
|
||||
// Compiler options: -langversion:experimental
|
||||
|
||||
class C
|
||||
{
|
||||
public static void Main ()
|
||||
{
|
||||
Foo (ref var x = "");
|
||||
}
|
||||
|
||||
static void Foo (ref int i)
|
||||
{
|
||||
}
|
||||
}
|
@ -1,3 +1,3 @@
|
||||
// CS1617: Invalid -langversion option `ISO'. It must be `ISO-1', `ISO-2', Default or value in range 1 to 6
|
||||
// CS1617: Invalid -langversion option `ISO'. It must be `ISO-1', `ISO-2', Default or value in range 1 to 7
|
||||
// Line: 0
|
||||
// Compiler options: -langversion:ISO
|
||||
|
21
mcs/errors/cs1621-2.cs
Normal file
21
mcs/errors/cs1621-2.cs
Normal file
@ -0,0 +1,21 @@
|
||||
// CS1621: The yield statement cannot be used inside anonymous method blocks
|
||||
// Line: 12
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
||||
public class Test
|
||||
{
|
||||
public IEnumerator Foo ()
|
||||
{
|
||||
Call (() => {
|
||||
yield break;
|
||||
});
|
||||
|
||||
yield break;
|
||||
}
|
||||
|
||||
void Call (Action a)
|
||||
{
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user