Files
ILSpy/ICSharpCode.Decompiler.Tests
Siegfried Pammer 5e0cb39989 Add xfailed pretty test for C# 9 pattern matching improvements
The fixture is the desired output for the C# 9 pattern forms the
decompiler does not reconstruct yet: relational subpatterns printed
with conventional spacing (currently emitted as 'I: >5', which the
repo's own formatter rejects), 'and'/'or' combinators (type + value
tests, constant alternatives, range checks in subpatterns), top-level
'is not' with designator, negated recursive patterns, 'null or ""',
and switch statements/expressions with relational or combined arms
(currently leaked as balanced-comparison if trees).

It also pins two real bugs: a 'not' subpattern with a string constant
decompiles to 'Text: 0' (uncompilable, CS0029 on recompile) and with a
decimal constant to 'Dec: 0' (compiles but silently inverts and
changes the matched value); the negation and the operand of the
logic.not(call op_Equality) form are both dropped in
ExpressionBuilder.TranslatePattern.

The test is Assert.Ignore'd (#829); all six Roslyn 3.11/4.14/latest
debug/opt configs compile the fixture and fail only at the output
comparison.

Assisted-by: Claude:claude-fable-5:Claude Code
2026-07-29 07:19:30 +02:00
..