Narrow 'No matching overload' error range to method name only#19505
Draft
Narrow 'No matching overload' error range to method name only#19505
Conversation
Member
|
@copilot : Try again |
Copilot stopped work on behalf of
T-Gro due to an error
March 27, 2026 08:33
Member
|
@copilot : Try again. |
Copilot stopped work on behalf of
T-Gro due to an error
March 27, 2026 11:44
Member
|
@copilot Try again |
…only In TcMethodApplication, remap UnresolvedOverloading error range from the whole expression (mMethExpr) to just the method name identifier. This prevents the error from covering the entire expression including object access chains and arguments. Add regression tests for instance calls, static calls, chained expressions, and lambda arguments. Agent-Logs-Url: https://github.com/dotnet/fsharp/sessions/d3913698-2bf7-4b33-8c76-1079e067156b Co-authored-by: abonie <20281641+abonie@users.noreply.github.com>
Contributor
Author
Implemented the fix in commit aa4c1a9. The For |
Copilot
AI
changed the title
[WIP] Copilot Request
Narrow 'No matching overload' error range to method name only
Mar 31, 2026
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.
The "No overloads match for method" error (Error 41) previously covered the entire expression including object access chains and arguments. For example,
T.Instance.Method("")would underline everything fromTto"). This is especially problematic on larger expressions where the wide error range hides other errors and warnings.Changes Made
src/Compiler/Checking/Expressions/CheckExpressions.fs: AfterResolveOverloadingForCallreturns, interceptUnresolvedOverloadingerrors and narrow the range from the whole expression (mMethExpr) to just the method name identifier. The method-name-only range is computed frommItem.EndandmethodName.Length.tests/FSharp.Compiler.ComponentTests/ErrorMessages/OverloadResolutionErrorRangeTests.fs: Added 4 regression tests verifying the error range covers only the method name for:T.Instance.Method(""))T.Method(""))T.Instance.Next.Next.Method(""))T.Instance.Method(fun () -> ""))Before
Error underlines the entire
T.Instance.Method("")expression.After
Error underlines only
Method, leaving the rest of the expression clean for other diagnostics.📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.