-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ed9fb93
commit 51b93b6
Showing
27 changed files
with
434 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// CS0155: The type caught or thrown must be derived from System.Exception | ||
// Line: 9 | ||
|
||
class X | ||
{ | ||
public int Test () => throw ""; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 () | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// CS1061: No overload for method `Call' takes `0' arguments | ||
// Line: 11 | ||
|
||
using System; | ||
|
||
class Program | ||
{ | ||
static void Main () | ||
{ | ||
Action<dynamic, object> action = delegate { }; | ||
Foo (action).NoDynamicBinding (); | ||
} | ||
|
||
static T Foo<T>(Action<T, T> x) | ||
{ | ||
throw new NotImplementedException (); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// CS1644: Feature `throw expression' cannot be used because it is not part of the C# 6.0 language specification | ||
// Line: 5 | ||
// Compiler options: -langversion:6 | ||
|
||
static class Class | ||
{ | ||
int Prop => throw null; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// CS4001: Cannot await `void' expression | ||
// Line: 10 | ||
|
||
using System; | ||
|
||
class A | ||
{ | ||
static async void Test () | ||
{ | ||
await Console.WriteLine; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// CS8188: An expression tree cannot not contain a throw expression | ||
// Line: 11 | ||
|
||
using System; | ||
using System.Linq.Expressions; | ||
|
||
class C | ||
{ | ||
public static void Main () | ||
{ | ||
Expression<Func<object>> l = () => throw null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.