From 32058da4eb7696233db2a8ae7e9a01cfeac9f9f9 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sat, 4 Jul 2026 13:17:16 +0200 Subject: [PATCH] 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 --- .../TestCases/Pretty/RefFields.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/RefFields.cs b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/RefFields.cs index aff38438b..7bbb377a6 100644 --- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/RefFields.cs +++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/RefFields.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics.CodeAnalysis; namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty { @@ -84,4 +85,18 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty 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; + } + } }