Skip to content

Commit 251a0bd

Browse files
committed
more repro attempts
1 parent 9649cf5 commit 251a0bd

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

IDisposableAnalyzers.Test/IDISP004DoNotIgnoreCreatedTests/Valid.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,12 @@ public record struct S : IDisposable
958958
{
959959
public S Append(int value)
960960
{
961-
return this;
961+
if (value > 3)
962+
{
963+
return this;
964+
}
965+
966+
throw new Exception();
962967
}
963968
964969
public void Dispose() { }

ValidCode/ExplictImplementaion.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
public sealed class ExplictImplementaion : IDisposable
66
{
7-
private readonly Disposable disposable = new Disposable();
7+
private readonly Disposable disposable = new();
88

99
void IDisposable.Dispose()
1010
{

0 commit comments

Comments
 (0)