Browse Source

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<char> 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
pull/3970/head
Siegfried Pammer 1 month ago
parent
commit
0d0e88a61b
  1. 3
      ICSharpCode.Decompiler/DecompilerSettings.cs

3
ICSharpCode.Decompiler/DecompilerSettings.cs

@ -483,9 +483,8 @@ namespace ICSharpCode.Decompiler
/// <summary> /// <summary>
/// Gets/Sets whether to use C# 11.0 switch on (ReadOnly)Span&lt;char&gt; /// Gets/Sets whether to use C# 11.0 switch on (ReadOnly)Span&lt;char&gt;
/// </summary> /// </summary>
[Category("C# 11.0 / VS 2022.4")]
[Description("DecompilerSettings.SwitchOnReadOnlySpanChar")] [Description("DecompilerSettings.SwitchOnReadOnlySpanChar")]
[DecompilerSetting] [DecompilerSetting(CSharp.LanguageVersion.CSharp11_0)]
public partial bool SwitchOnReadOnlySpanChar { get; set; } public partial bool SwitchOnReadOnlySpanChar { get; set; }
/// <summary> /// <summary>

Loading…
Cancel
Save