Skip to content

Commit

Permalink
Remove VB test
Browse files Browse the repository at this point in the history
  • Loading branch information
MartyIX committed Nov 7, 2023
1 parent e3c71e4 commit a907d86
Showing 1 changed file with 0 additions and 82 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3737,88 +3737,6 @@ public async ValueTask DisposeAsync()
}
"
}.RunAsync();

// How to fix: "error BC36945: The 'Async' modifier can only be used on Subs, or on Functions that return Task or Task(Of T)."?
/*
await new VerifyVB.Test
{
ReferenceAssemblies = AdditionalMetadataReferences.DefaultWithAsyncInterfaces,
TestCode = @"
Imports System
Imports System.Threading.Tasks
Class A
Implements IAsyncDisposable
Public Function DisposeAsync() As ValueTask Implements IAsyncDisposable.DisposeAsync
Return Nothing
End Function
End Class
' No diagnostic for DisposeCoreAsync.
Class B
Implements IAsyncDisposable
Private ReadOnly disposedValueLock As Object = New Object()
Private disposedValue As Boolean
Private ReadOnly a As A
Public Sub New()
a = New A()
End Sub
Protected Overridable Async Function DisposeCoreAsync() As ValueTask
SyncLock disposedValueLock
If disposedValue Then
Return
End If
disposedValue = True
End SyncLock
Await a.DisposeAsync().ConfigureAwait(False)
End Function
Public Async Function DisposeAsync() As ValueTask Implements IAsyncDisposable.DisposeAsync
Await DisposeCoreAsync.ConfigureAwait(false)
GC.SuppressFinalize(Me)
End Function
End Class
' No diagnostic for DisposeAsyncCore.
Class C
Implements IAsyncDisposable
Private ReadOnly disposedValueLock As Object = New Object()
Private disposedValue As Boolean
Private ReadOnly a As A
Public Sub New()
a = New A()
End Sub
Protected Overridable Async Function DisposeAsyncCore() As ValueTask
SyncLock disposedValueLock
If disposedValue Then
Return
End If
disposedValue = True
End SyncLock
Await a.DisposeAsync().ConfigureAwait(False)
End Function
Public Function DisposeAsync() As ValueTask Implements IAsyncDisposable.DisposeAsync
Await DisposeAsyncCore.ConfigureAwait(false)
GC.SuppressFinalize(Me)
End Function
End Class"
}.RunAsync();
*/
}

[Fact, WorkItem(5099, "https://github.com/dotnet/roslyn-analyzers/issues/5099")]
Expand Down

0 comments on commit a907d86

Please sign in to comment.