Closed AlekseyTs closed 4 months ago
CC @jcouv
Keeping this in 17.11 for now as we don't have any user reports of this breaking them. If there are reports though we may need to go back and service 17.10 .
Probably same issue with different error
public class Class1 : IAsyncDisposable
{
ValueTask IAsyncDisposable.DisposeAsync() => default;
protected virtual ValueTask DisposeAsync(bool disposing) => default;
}
public class Class2
{
public static async void Test()
{
// error CS0122: 'Class1.DisposeAsync(bool)' is inaccessible due to its protection level
await using var x = new Class1();
}
}
Quite puzzling, as I wouldn't expect reference to DisposeAsync(bool)
method here
The tests below reflects the current behavior:
The code used to compile successfully and was printing "123D". This is likely a regression from https://github.com/dotnet/roslyn/pull/72598.
Note, similar scenario in
await foreach
works the same way theawait using
used to work (i.e. it falls back to usingIAsyncDisposable
implementation).