Skip to content

Add pretty tests for C# 14 first-class span types - #3930

Open
siegfriedpammer wants to merge 1 commit into
masterfrom
tests/829-first-class-span
Open

Add pretty tests for C# 14 first-class span types#3930
siegfriedpammer wants to merge 1 commit into
masterfrom
tests/829-first-class-span

Conversation

@siegfriedpammer

Copy link
Copy Markdown
Member

Part of the #829 coverage campaign (does not close it).

Two fixtures, rebased onto current master as a single commit:

  • FirstClassSpanTypes (green): pins overload-resolution behavior the decompiler already gets right under the C# 14 implicit span conversions — calls picking the new betterness winners (ReadOnlySpan over Span/object/IEnumerable, ReadOnlySpan<string> over object[] and ReadOnlySpan<object>, MemoryExtensions.Contains over Enumerable.Contains) round-trip as plain calls.
  • FirstClassSpanConversions (xfail via Assert.Ignore, pointing at C# language support status #829): the desired-output spec for implicit span conversions the decompiler does not fold yet; lands as skipped until the folding is implemented, at which point the ignore comes off and the fixture is the acceptance test.

Full decompiler suite green on Linux (3080 passed / 0 failed / 46 skipped, the skips being the pre-existing set plus the new xfail configurations).

This PR was prepared by an AI agent (Claude) on behalf of @siegfriedpammer.

🤖 Generated with Claude Code

The green FirstClassSpanTypes fixture pins overload-resolution behavior
the decompiler already gets right under the C# 14 implicit span
conversions: calls picking the new betterness winners (ReadOnlySpan
over Span/object/IEnumerable, ReadOnlySpan<string> over object[] and
ReadOnlySpan<object>, MemoryExtensions.Contains over
Enumerable.Contains) round-trip as plain calls, while calls picking the
losing overload keep their disambiguating casts and Enumerable.Contains
stays in static call form. Extension methods on span-convertible
receivers, generic inference through span conversions, params
betterness, and array-to-span returns are covered too. All winners were
verified by executing probes compiled at LangVersion 13 vs 14.

The FirstClassSpanConversions fixture is Assert.Ignore'd (#829): it
specs the desired folding of compiler-emitted span-conversion helpers
back into implicit conversions - MemoryExtensions.AsSpan(string),
ReadOnlySpan<T>.CastUp for span variance, and covariant-array/in-arg
conversions - which the decompiler currently renders as explicit helper
calls or casts (recompilable and semantics-preserving, just not
minimal). Both roslyn-latest configs compile the fixture and fail only
at the output comparison.

Assisted-by: Claude:claude-fable-5:Claude Code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant