From 0d0e88a61bb2ec7ce76e8990dd3833b9870f7d96 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sat, 8 Aug 2026 14:53:46 +0200 Subject: [PATCH] Gate SwitchOnReadOnlySpanChar on C# 11.0 The setting carried the C# 11.0 display category but was missing from both SetLanguageVersion and GetMinimumRequiredVersion, so decompiling for an older target language version could still produce switches over ReadOnlySpan that the requested compiler cannot compile. Gating it like the other C# 11.0 settings closes that gap; the category string is now derived from the version like everywhere else. Assisted-by: Claude:claude-fable-5:Claude Code --- ICSharpCode.Decompiler/DecompilerSettings.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ICSharpCode.Decompiler/DecompilerSettings.cs b/ICSharpCode.Decompiler/DecompilerSettings.cs index a8f6322ca..79112cb98 100644 --- a/ICSharpCode.Decompiler/DecompilerSettings.cs +++ b/ICSharpCode.Decompiler/DecompilerSettings.cs @@ -483,9 +483,8 @@ namespace ICSharpCode.Decompiler /// /// Gets/Sets whether to use C# 11.0 switch on (ReadOnly)Span<char> /// - [Category("C# 11.0 / VS 2022.4")] [Description("DecompilerSettings.SwitchOnReadOnlySpanChar")] - [DecompilerSetting] + [DecompilerSetting(CSharp.LanguageVersion.CSharp11_0)] public partial bool SwitchOnReadOnlySpanChar { get; set; } ///