Browse Source

Colour the 'allows ref struct' anti-constraint

The C# 13 'allows ref struct' anti-constraint is emitted as a single
PrimitiveType token (TypeSystemAstBuilder), so it reached WritePrimitiveType
rather than WriteKeyword and fell through uncoloured. Add it to the
value-type keyword group alongside the other constraint, 'unmanaged'.

Assisted-by: Claude:claude-opus-4-8:Claude Code
pull/3755/head
Siegfried Pammer 4 weeks ago
parent
commit
1520213d32
  1. 3
      ILSpy/Languages/CSharpHighlightingTokenWriter.cs

3
ILSpy/Languages/CSharpHighlightingTokenWriter.cs

@ -322,6 +322,9 @@ namespace ILSpy.Languages @@ -322,6 +322,9 @@ namespace ILSpy.Languages
case "ushort":
case "ulong":
case "unmanaged":
// The C# 13 'allows ref struct' anti-constraint is emitted as a single PrimitiveType
// token (TypeSystemAstBuilder), so it is coloured here as one unit rather than per word.
case "allows ref struct":
case "nint":
case "nuint":
color = valueTypeKeywordsColor;

Loading…
Cancel
Save