@@ -26,7 +26,7 @@ private static CSharpCompilation CreateCompilation(string source, IEnumerable<Me
26
26
IEnumerable < MetadataReference > asyncRefs = new [ ] { NetFramework . System , NetFramework . SystemCore , NetFramework . MicrosoftCSharp } ;
27
27
references = ( references != null ) ? references . Concat ( asyncRefs ) : asyncRefs ;
28
28
29
- return CreateCompilationWithMscorlib45 ( source , options : options , references : references ) ;
29
+ return CreateCompilationWithMscorlib461 ( source , options : options , references : references ) ;
30
30
}
31
31
32
32
private CompilationVerifier CompileAndVerify ( string source , string expectedOutput , IEnumerable < MetadataReference > references = null , CSharpCompilationOptions options = null , Verification verify = default )
@@ -54,7 +54,7 @@ public static void Main()
54
54
F(123).Wait();
55
55
}
56
56
}" ;
57
- var c = CreateCompilationWithMscorlib45 ( source ) ;
57
+ var c = CreateCompilationWithMscorlib461 ( source ) ;
58
58
59
59
CompilationOptions options ;
60
60
@@ -3703,7 +3703,7 @@ public void AsyncTasklikeMissingBuilderType()
3703
3703
{
3704
3704
// Builder
3705
3705
var libB = @"public class B { }" ;
3706
- var cB = CreateCompilationWithMscorlib45 ( libB ) ;
3706
+ var cB = CreateCompilationWithMscorlib461 ( libB ) ;
3707
3707
var rB = cB . EmitToImageReference ( ) ;
3708
3708
3709
3709
// Tasklike
@@ -3714,7 +3714,7 @@ public void AsyncTasklikeMissingBuilderType()
3714
3714
3715
3715
namespace System.Runtime.CompilerServices { class AsyncMethodBuilderAttribute : System.Attribute { public AsyncMethodBuilderAttribute(System.Type t) { } } }
3716
3716
" ;
3717
- var cT = CreateCompilationWithMscorlib45 ( libT , references : new [ ] { rB } ) ;
3717
+ var cT = CreateCompilationWithMscorlib461 ( libT , references : new [ ] { rB } ) ;
3718
3718
var rT = cT . EmitToImageReference ( ) ;
3719
3719
3720
3720
// Consumer, fails to reference builder
@@ -3726,7 +3726,7 @@ static void Main() { }
3726
3726
async T f() => await Task.Delay(1);
3727
3727
}
3728
3728
" ;
3729
- var c = CreateCompilationWithMscorlib45 ( source , references : new [ ] { rT } ) ;
3729
+ var c = CreateCompilationWithMscorlib461 ( source , references : new [ ] { rT } ) ;
3730
3730
c . VerifyEmitDiagnostics (
3731
3731
// (6,17): error CS1983: The return type of an async method must be void, Task or Task<T>
3732
3732
// async T f() => await Task.Delay(1);
@@ -4023,7 +4023,7 @@ class Mismatch2MethodBuilder<T>
4023
4023
}
4024
4024
namespace System.Runtime.CompilerServices { class AsyncMethodBuilderAttribute : System.Attribute { public AsyncMethodBuilderAttribute(System.Type t) { } } }
4025
4025
" ;
4026
- var comp = CreateCompilationWithMscorlib45 ( source ) ;
4026
+ var comp = CreateCompilationWithMscorlib461 ( source ) ;
4027
4027
comp . VerifyEmitDiagnostics (
4028
4028
// (5,30): error CS8940: A generic task-like return type was expected, but the type 'Mismatch1MethodBuilder' found in 'AsyncMethodBuilder' attribute was not suitable. It must be an unbound generic type of arity one, and its containing type (if any) must be non-generic.
4029
4029
// async Mismatch1<int> f() { await (Task)null; return 1; }
@@ -4501,7 +4501,7 @@ public void AwaitInScriptExpression()
4501
4501
{
4502
4502
var source =
4503
4503
@"System.Console.WriteLine(await System.Threading.Tasks.Task.FromResult(1));" ;
4504
- var compilation = CreateCompilationWithMscorlib45 ( source , parseOptions : TestOptions . Script , options : TestOptions . DebugExe ) ;
4504
+ var compilation = CreateCompilationWithMscorlib461 ( source , parseOptions : TestOptions . Script , options : TestOptions . DebugExe ) ;
4505
4505
compilation . VerifyDiagnostics ( ) ;
4506
4506
}
4507
4507
@@ -4510,7 +4510,7 @@ public void AwaitInScriptGlobalStatement()
4510
4510
{
4511
4511
var source =
4512
4512
@"await System.Threading.Tasks.Task.FromResult(4);" ;
4513
- var compilation = CreateCompilationWithMscorlib45 ( source , parseOptions : TestOptions . Script , options : TestOptions . DebugExe ) ;
4513
+ var compilation = CreateCompilationWithMscorlib461 ( source , parseOptions : TestOptions . Script , options : TestOptions . DebugExe ) ;
4514
4514
compilation . VerifyDiagnostics ( ) ;
4515
4515
}
4516
4516
@@ -4520,7 +4520,7 @@ public void AwaitInScriptDeclaration()
4520
4520
var source =
4521
4521
@"int x = await System.Threading.Tasks.Task.Run(() => 2);
4522
4522
System.Console.WriteLine(x);" ;
4523
- var compilation = CreateCompilationWithMscorlib45 ( source , parseOptions : TestOptions . Script , options : TestOptions . DebugExe ) ;
4523
+ var compilation = CreateCompilationWithMscorlib461 ( source , parseOptions : TestOptions . Script , options : TestOptions . DebugExe ) ;
4524
4524
compilation . VerifyDiagnostics ( ) ;
4525
4525
}
4526
4526
@@ -4564,7 +4564,7 @@ public void AwaitInScriptStaticInitializer()
4564
4564
await System.Threading.Tasks.Task.FromResult(1);
4565
4565
int y = x +
4566
4566
await System.Threading.Tasks.Task.FromResult(2);" ;
4567
- var compilation = CreateCompilationWithMscorlib45 ( source , parseOptions : TestOptions . Script , options : TestOptions . DebugExe ) ;
4567
+ var compilation = CreateCompilationWithMscorlib461 ( source , parseOptions : TestOptions . Script , options : TestOptions . DebugExe ) ;
4568
4568
compilation . VerifyDiagnostics (
4569
4569
// (2,5): error CS8100: The 'await' operator cannot be used in a static script variable initializer.
4570
4570
// await System.Threading.Tasks.Task.FromResult(1);
0 commit comments