Skip to content

Commit

Permalink
Fix test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
jkoritzinsky committed Mar 18, 2022
1 parent 0cc8679 commit e1cd121
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ private class CustomFixAllProvider : DocumentBasedFixAllProvider

protected override async Task<SyntaxNode> FixAllInDocumentAsync(FixAllContext fixAllContext, Document document, ImmutableArray<Diagnostic> diagnostics)
{
RoslynDebug.Assert(document.Project.CompilationOptions is CSharpCompilationOptions { AllowUnsafe: false });
if (document.Project.CompilationOptions is CSharpCompilationOptions { AllowUnsafe: false })
{
// We can't code fix if unsafe code isn't allowed.
return await document.GetSyntaxRootAsync(fixAllContext.CancellationToken);
}
var editor = await DocumentEditor.CreateAsync(document, fixAllContext.CancellationToken).ConfigureAwait(false);
SyntaxNode root = await document.GetSyntaxRootAsync(fixAllContext.CancellationToken).ConfigureAwait(false);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1432,7 +1432,7 @@ Dim bar As S
size = {|CA1421:Marshal.SizeOf(Of S)()|}
bar = {|CA1421:Marshal.PtrToStructure(Of S)(ptr)|}
{|CA1421:Marshal.StructureToPtr(bar, ptr, False)|}
size = {|CA1421:Marshal.OffsetOf(GetType(bar), NameOf(bar.Baz))|}
size = {|CA1421:Marshal.OffsetOf(GetType(S), NameOf(bar.Baz))|}
size = {|CA1421:Marshal.OffsetOf(Of S)(NameOf(bar.Baz))|}
End Sub
End Class
Expand Down

0 comments on commit e1cd121

Please sign in to comment.