Browse Source

Add pretty tests for UnscopedRef members

UnscopedRef only appeared on a params parameter anywhere in the
suite; a ref-returning method and property on a ref struct pin the
attribute round-trip.

Assisted-by: Claude:claude-fable-5:Claude Code
pull/3857/head
Siegfried Pammer 3 days ago committed by Siegfried Pammer
parent
commit
32058da4eb
  1. 15
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/RefFields.cs

15
ICSharpCode.Decompiler.Tests/TestCases/Pretty/RefFields.cs

@ -1,4 +1,5 @@
using System; using System;
using System.Diagnostics.CodeAnalysis;
namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
{ {
@ -84,4 +85,18 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
Field3 = ref v; Field3 = ref v;
} }
} }
internal ref struct UnscopedRefStruct
{
private int val;
[UnscopedRef]
public ref int ByRefProperty => ref val;
[UnscopedRef]
public ref int ByRefAccess()
{
return ref val;
}
}
} }

Loading…
Cancel
Save