Render declaring type for C#-style extensions in overload errors#19925
Open
T-Gro wants to merge 5 commits into
Open
Render declaring type for C#-style extensions in overload errors#19925T-Gro wants to merge 5 commits into
T-Gro wants to merge 5 commits into
Conversation
…type Failing tests (4) drive the fix where C#-style extension method overload errors should attribute extension overloads to their declaring type (e.g. MemoryExtensions) rather than the receiver type (e.g. Foo). Gate tests (2) protect F#-style extension and regular instance method renderings from regressing. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… comment On net48 the test sandbox does not reference System.Memory, so Span<T> resolves to FS0039 rather than producing the bug-bearing FS0041 overload-resolution diagnostic. Use [<FactForNETCOREAPP>] for the four RED tests so they exercise the real bug on net10.0 and are skipped on net472 instead of failing for the wrong reason. The GATE tests (F#-style extension, regular instance method) keep [<Fact>] and run on both frameworks. Also append a multi-line (* ... *) comment block at the bottom of the file capturing the current vs expected diagnostic text, so the implementation sprint has the exact strings to compare against. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
C#-style extension method overload-error messages now show the type that declares the extension (e.g. MemoryExtensions) instead of the receiver type (e.g. Foo). Tooltip/hover rendering and F#-style extension rendering are unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Document the fix for C#-style extension method overload error rendering in the FSharp.Compiler.Service 11.0.100 release notes. Sprint 3 verification: - dotnet fantomas on touched files: no changes - SurfaceAreaTest (Release): passed, stringOfMethInfoForOverloadError not in public surface - Issue9838 component tests (Debug): 6/6 passed - ErrorMessages component tests (Debug): 576/576 succeeded, 2 skipped (pre-existing) - Overload component tests (Debug): 101/101 succeeded, 23 skipped (pre-existing) - Full ComponentTests (Release): 7207 passed, 2 unrelated pre-existing failures verified on main (d0e593f) without the fix applied: * Language.InterpolatedStringsTests.'Explicit %P does not cause exception when culture set to Thai[th]' (FSharp.Core printf runtime IndexOutOfRange under Thai culture; independent of NicePrint) * Language.SequenceExpression.'Handler body executes once when source throws immediately and handler yields nothing' (seq codegen counter mismatch; independent of NicePrint) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
❗ Release notes requiredYou can open this PR in browser to add release notes: open in github.dev
|
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.
Fixes #9838
Overload-resolution error messages for C#-style extension methods now
attribute candidates to their declaring type (e.g.
MemoryExtensions)instead of the receiver type.