Add pretty tests for C# 14 first-class span types - #3930
Open
siegfriedpammer wants to merge 1 commit into
Open
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 (ReadOnlySpanoverSpan/object/IEnumerable,ReadOnlySpan<string>overobject[]andReadOnlySpan<object>,MemoryExtensions.ContainsoverEnumerable.Contains) round-trip as plain calls.FirstClassSpanConversions(xfail viaAssert.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