From 474b01a4175f906577d5d36fa14283e134196633 Mon Sep 17 00:00:00 2001 From: Julien Couvreur Date: Tue, 19 Mar 2024 10:46:26 -0700 Subject: [PATCH] tweaks --- .../IOperation/IOperationTests_IUsingStatement.cs | 8 ++++---- .../Test/Semantic/Semantics/UsingDeclarationTests.cs | 5 ++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Compilers/CSharp/Test/IOperation/IOperation/IOperationTests_IUsingStatement.cs b/src/Compilers/CSharp/Test/IOperation/IOperation/IOperationTests_IUsingStatement.cs index 87bc0c5214ef4..9e9db28ab3a2c 100644 --- a/src/Compilers/CSharp/Test/IOperation/IOperation/IOperationTests_IUsingStatement.cs +++ b/src/Compilers/CSharp/Test/IOperation/IOperation/IOperationTests_IUsingStatement.cs @@ -145,8 +145,8 @@ public async Task M1() }/**/ } - public async System.Threading.Tasks.ValueTask DisposeAsync() - { + public async System.Threading.Tasks.ValueTask DisposeAsync() + { await Task.Yield(); } } @@ -204,8 +204,8 @@ public async Task M1() }/**/ } - async ValueTask IAsyncDisposable.DisposeAsync() - { + async ValueTask IAsyncDisposable.DisposeAsync() + { await Task.Yield(); } } diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/UsingDeclarationTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/UsingDeclarationTests.cs index 7646942ebd539..da09f7cdd28d2 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/UsingDeclarationTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/UsingDeclarationTests.cs @@ -867,7 +867,10 @@ static async Task Main() "; var expected = new[] { - // (8,15): error CS8652: The feature 'using declarations' is not available in C# 7.3. Please use language version 8.0 or greater. + // 0.cs(8,9): error CS8370: Feature 'pattern-based disposal' is not available in C# 7.3. Please use language version 8.0 or greater. + // await using IAsyncDisposable x = null; + Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion7_3, "await using IAsyncDisposable x = null;").WithArguments("pattern-based disposal", "8.0").WithLocation(8, 9), + // 0.cs(8,15): error CS8370: Feature 'using declarations' is not available in C# 7.3. Please use language version 8.0 or greater. // await using IAsyncDisposable x = null; Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion7_3, "using").WithArguments("using declarations", "8.0").WithLocation(8, 15) };