From 55769f89f972118880c00f16acdba5398b785e08 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Wed, 22 Apr 2026 13:20:20 +0200 Subject: [PATCH 1/5] Narrow overload-error and symbol-use ranges to terminal identifier (#14284, #3920) Narrow the FS0041 'No overloads match' error range from the whole expression to just the method name. For T.Instance.Method(""), the error now covers only 'Method' instead of 'T.Instance.Method("")'. Also narrow name-resolution sink ranges (used by Find Usages, symbol highlight, and semantic classification) to the terminal identifier of a dotted long identifier instead of the whole object-expression path. Changes: - NameResolution.fs: ComputeItemRange now returns (itemRange, itemIdentRange). itemRange is the structural whole-long-id span for typed-tree construction. itemIdentRange is the terminal identifier's range for diagnostics and sinks. - CheckExpressions.fs: Intercept UnresolvedOverloading errors in TcMethodApplication and narrow the error range to the method name. - ServiceParamInfoLocations.fs: Update getAllCurriedArgsAtPosition to handle narrowed symbol-use ranges by also checking the leaf function expression. Fixes #14284, #3920 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../.FSharp.Compiler.Service/11.0.100.md | 1 + .../Checking/Expressions/CheckExpressions.fs | 36 +++- src/Compiler/Checking/NameResolution.fs | 72 +++++--- src/Compiler/Checking/NameResolution.fsi | 14 +- .../Service/ServiceParamInfoLocations.fs | 18 +- .../neg_invalid_constructor.fs.err.bsl | 6 +- .../OverloadResolutionErrorRangeTests.fs | 154 +++++++++++++++++ .../FSharp.Compiler.ComponentTests.fsproj | 1 + .../FSharpChecker/FindReferences.fs | 14 +- .../EditorTests.fs | 6 +- .../MultiProjectAnalysisTests.fs | 6 +- .../ProjectAnalysisTests.fs | 156 +++++++++--------- .../FSharp.Compiler.Service.Tests/Symbols.fs | 4 +- .../TypeChecker/TypeCheckerRecoveryTests.fs | 2 +- .../Language/TypeDirectedConversionTests.fs | 8 +- .../expressions/syntacticsugar/E_Slices01.bsl | 4 +- .../E_RigidTypeAnnotation03.bsl | 8 +- .../E_LeftToRightOverloadResolution01.bsl | 4 +- .../inference/E_OneTypeVariable03.bsl | 4 +- .../inference/E_OneTypeVariable03rec.bsl | 4 +- .../E_TwoDifferentTypeVariables01.bsl | 8 +- .../E_TwoDifferentTypeVariables01rec.bsl | 8 +- .../E_TwoDifferentTypeVariablesGen00.bsl | 6 +- .../E_TwoDifferentTypeVariablesGen00rec.bsl | 6 +- .../inference/E_TwoEqualTypeVariables02.bsl | 12 +- .../E_TwoEqualTypeVariables02rec.bsl | 12 +- .../E_LessThanDotOpenParen001.bsl | 4 +- .../E_Clashing_Values_in_AbstractClass01.bsl | 2 +- .../E_Clashing_Values_in_AbstractClass03.bsl | 4 +- .../E_Clashing_Values_in_AbstractClass04.bsl | 4 +- .../compilation.errors.output.bsl | 54 +++--- ...g_System.Convert.ToString.OverloadList.bsl | 4 +- ...ing.Graphics.DrawRectangleOverloadList.bsl | 4 +- ....Threading.Tasks.Task.Run.OverloadList.bsl | 12 +- .../neg_generic_known_argument_types.bsl | 2 +- .../overloads/neg_interface_generics.bsl | 2 +- .../overloads/neg_many_many_overloads.bsl | 8 +- .../overloads/neg_tupled_arguments.bsl | 4 +- tests/fsharp/typecheck/sigs/neg06.bsl | 2 +- tests/fsharp/typecheck/sigs/neg106.bsl | 16 +- tests/fsharp/typecheck/sigs/neg106.vsbsl | 16 +- tests/fsharp/typecheck/sigs/neg131.bsl | 2 +- tests/fsharp/typecheck/sigs/neg132.bsl | 2 +- tests/fsharp/typecheck/sigs/neg20.bsl | 52 +++++- tests/fsharp/typecheck/sigs/neg45.bsl | 6 +- tests/fsharp/typecheck/sigs/neg70.vsbsl | 4 +- 46 files changed, 535 insertions(+), 243 deletions(-) create mode 100644 tests/FSharp.Compiler.ComponentTests/ErrorMessages/OverloadResolutionErrorRangeTests.fs diff --git a/docs/release-notes/.FSharp.Compiler.Service/11.0.100.md b/docs/release-notes/.FSharp.Compiler.Service/11.0.100.md index e175f4dce0e..4948a3178ec 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/11.0.100.md +++ b/docs/release-notes/.FSharp.Compiler.Service/11.0.100.md @@ -1,6 +1,7 @@ ### Fixed * Fix NRE when calling virtual Object methods on value types through inline SRTP functions. ([Issue #8098](https://github.com/dotnet/fsharp/issues/8098), [PR #19511](https://github.com/dotnet/fsharp/pull/19511)) +* Narrow 'No overloads match for method' error range to method name only instead of covering the entire expression. Also narrow FSharpSymbolUse ranges reported through the name-resolution sink (used by Find Usages, symbol highlight, and semantic classification) so they report on the terminal identifier of a dotted long identifier instead of the whole object-expression path. ([Issue #14284](https://github.com/dotnet/fsharp/issues/14284), [Issue #3920](https://github.com/dotnet/fsharp/issues/3920), [PR #19505](https://github.com/dotnet/fsharp/pull/19505)) * Fix DU case names matching IWSAM member names no longer cause duplicate property entries. (Issue [#14321](https://github.com/dotnet/fsharp/issues/14321), [PR #19341](https://github.com/dotnet/fsharp/pull/19341)) * Fix DefaultAugmentation(false) duplicate entry in method table. (Issue [#16565](https://github.com/dotnet/fsharp/issues/16565), [PR #19341](https://github.com/dotnet/fsharp/pull/19341)) * Fix abstract event accessors now have SpecialName flag. (Issue [#5834](https://github.com/dotnet/fsharp/issues/5834), [PR #19341](https://github.com/dotnet/fsharp/pull/19341)) diff --git a/src/Compiler/Checking/Expressions/CheckExpressions.fs b/src/Compiler/Checking/Expressions/CheckExpressions.fs index f98bc32259f..c5598952347 100644 --- a/src/Compiler/Checking/Expressions/CheckExpressions.fs +++ b/src/Compiler/Checking/Expressions/CheckExpressions.fs @@ -6642,7 +6642,7 @@ and TcTyparExprThen (cenv: cenv) overallTy env tpenv synTypar m delayed = | [] -> delayed2 | _ -> DelayedDotLookup (rest, m2) :: delayed2 CallNameResolutionSink cenv.tcSink (ident.idRange, env.NameEnv, item, emptyTyparInst, ItemOccurrence.Use, env.AccessRights) - TcItemThen cenv overallTy env tpenv ([], item, mExprAndLongId, [], AfterResolution.DoNothing) (Some ty) delayed3 + TcItemThen cenv overallTy env tpenv ([], item, mExprAndLongId, mExprAndLongId, [], AfterResolution.DoNothing) (Some ty) delayed3 //TcLookupItemThen cenv overallTy env tpenv mObjExpr objExpr objExprTy delayed item mItem rest afterResolution | _ -> let (SynTypar(_, q, _)) = synTypar @@ -8631,7 +8631,7 @@ and TcNameOfExpr (cenv: cenv) env tpenv (synArg: SynExpr) = let nameResolutionResult = ResolveLongIdentAsExprAndComputeRange cenv.tcSink cenv.nameResolver (rangeOfLid longId) ad env.eNameResEnv typeNameResInfo longId None let resolvesAsExpr = match nameResolutionResult with - | Result (_, item, _, _, _ as res) + | Result (_, item, _, _, _, _ as res) when (match item with | Item.DelegateCtor _ @@ -8880,7 +8880,7 @@ and TcLongIdentThen (cenv: cenv) (overallTy: OverallTy) env tpenv (SynLongIdent( //------------------------------------------------------------------------- *) // mItem is the textual range covered by the long identifiers that make up the item -and TcItemThen (cenv: cenv) (overallTy: OverallTy) env tpenv (tinstEnclosing, item, mItem, rest, afterResolution) staticTyOpt delayed = +and TcItemThen (cenv: cenv) (overallTy: OverallTy) env tpenv (tinstEnclosing, item, mItem, _mItemIdent, rest, afterResolution) staticTyOpt delayed = let delayed = delayRest rest mItem delayed match item with // x where x is a union case or active pattern result tag. @@ -9120,8 +9120,8 @@ and TcTypeItemThen (cenv: cenv) overallTy env nm ty tpenv mItem tinstEnclosing d let item = Item.Types(nm, [ty]) CallNameResolutionSink cenv.tcSink (mExprAndTypeArgs, env.NameEnv, item, emptyTyparInst, ItemOccurrence.Use, env.eAccessRights) let typeNameResInfo = GetLongIdentTypeNameInfo otherDelayed - let item, mItem, rest, afterResolution = ResolveExprDotLongIdentAndComputeRange cenv.tcSink cenv.nameResolver (unionRanges mExprAndTypeArgs mLongId) ad env.eNameResEnv ty longId typeNameResInfo IgnoreOverrides true None - TcItemThen cenv overallTy env tpenv ((argsOfAppTy g ty), item, mItem, rest, afterResolution) None otherDelayed + let item, mItem, mItemIdent, rest, afterResolution = ResolveExprDotLongIdentAndComputeRange cenv.tcSink cenv.nameResolver (unionRanges mExprAndTypeArgs mLongId) ad env.eNameResEnv ty longId typeNameResInfo IgnoreOverrides true None + TcItemThen cenv overallTy env tpenv ((argsOfAppTy g ty), item, mItem, mItemIdent, rest, afterResolution) None otherDelayed | DelayedTypeApp(tyargs, _mTypeArgs, mExprAndTypeArgs) :: _delayed' -> // A case where we have an incomplete name e.g. 'Foo.' - we still want to report it to VS! @@ -9720,7 +9720,7 @@ and TcLookupThen cenv overallTy env tpenv mObjExpr objExpr objExprTy longId dela CanonicalizePartialInferenceProblem cenv.css env.DisplayEnv mExprAndLongId (freeInTypeLeftToRight g false objExprTy) let maybeAppliedArgExpr = DelayedItem.maybeAppliedArgForPreferExtensionOverProperty delayed - let item, mItem, rest, afterResolution = ResolveExprDotLongIdentAndComputeRange cenv.tcSink cenv.nameResolver mExprAndLongId ad env.NameEnv objExprTy longId TypeNameResolutionInfo.Default findFlag false maybeAppliedArgExpr + let item, mItem, _mItemIdent, rest, afterResolution = ResolveExprDotLongIdentAndComputeRange cenv.tcSink cenv.nameResolver mExprAndLongId ad env.NameEnv objExprTy longId TypeNameResolutionInfo.Default findFlag false maybeAppliedArgExpr TcLookupItemThen cenv overallTy env tpenv mObjExpr objExpr objExprTy delayed item mItem rest afterResolution and TcLookupItemThen cenv overallTy env tpenv mObjExpr objExpr objExprTy delayed item mItem rest afterResolution = @@ -10462,6 +10462,30 @@ and TcMethodApplication let result, errors = ResolveOverloadingForCall denv cenv.css mMethExpr methodName callerArgs ad postArgumentTypeCheckingCalledMethGroup true returnTy + // Narrow the error range for unresolved overloading from the whole expression (mMethExpr) + // to just the method name. For instance calls like T.Instance.Method(""), mItem covers + // the entire "T.Instance.Method" range, so we compute the method-name-only range from + // the end of mItem and the method name length. See https://github.com/dotnet/fsharp/issues/14284. + let errors = + match errors with + | ErrorResult(warns, UnresolvedOverloading(denvErr, callerArgsErr, failure, _mWide)) -> + let mMethodName = + let itemWidth = mItem.EndColumn - mItem.StartColumn + // Only narrow when the range is single-line and the method name fits within it. + // Generic constructors may have internal names longer than the source text + // (e.g., "ImmutableStack`1" vs source "ImmutableStack"). + if + mItem.StartLine = mItem.EndLine + && methodName.Length < itemWidth + && not (DoesIdentifierNeedBackticks methodName) + then + let startPos = mkPos mItem.EndLine (mItem.EndColumn - methodName.Length) + withStart startPos mItem + else + mItem + ErrorResult(warns, UnresolvedOverloading(denvErr, callerArgsErr, failure, mMethodName)) + | other -> other + match afterResolution, result with | AfterResolution.DoNothing, _ -> () diff --git a/src/Compiler/Checking/NameResolution.fs b/src/Compiler/Checking/NameResolution.fs index 07d0ea4743b..5d98ef45590 100644 --- a/src/Compiler/Checking/NameResolution.fs +++ b/src/Compiler/Checking/NameResolution.fs @@ -4160,14 +4160,36 @@ let private ResolveExprDotLongIdent (ncenv: NameResolver) m ad nenv ty (id: Iden | _ -> ForceRaise adhocDotSearchAccessible +/// Returns a pair (itemRange, itemIdentRange): +/// +/// * `itemRange` is the structural range of the long identifier as consumed +/// by resolution — the whole-long-id span when `rest = []`, or the range +/// over the consumed prefix when `rest <> []`. This is what typed-tree +/// construction uses for expression ranges and sequence points, so we +/// never narrow it. +/// * `itemIdentRange` is the terminal identifier's own source range — the +/// piece the user perceives as "this item's name". It is used for +/// diagnostics and for sink-reported symbol ranges (Find Usages, symbol +/// highlight, FSharpSymbolUse) so error / IDE UI hits only the resolved +/// name. Fixes #14284 and #3920. +/// +/// For `T.Instance.Method("")`: +/// itemRange = `T.Instance.Method` +/// itemIdentRange = `Method` let ComputeItemRange wholem (lid: Ident list) rest = - match rest with - | [] -> wholem - | _ -> - let ids = List.truncate (max 0 (lid.Length - rest.Length)) lid - match ids with + let itemRange = + match rest with | [] -> wholem - | _ -> rangeOfLid ids + | _ -> + let ids = List.truncate (max 0 (lid.Length - rest.Length)) lid + match ids with + | [] -> wholem + | _ -> rangeOfLid ids + let itemIdentRange = + match rest, lid with + | [], _ :: _ -> (List.last lid).idRange + | _ -> itemRange + itemRange, itemIdentRange /// Filters method groups that will be sent to Visual Studio IntelliSense /// to include only static/instance members @@ -4215,7 +4237,7 @@ let ResolveLongIdentAsExprAndComputeRange (sink: TcResultsSink) (ncenv: NameReso match ResolveExprLongIdent sink ncenv wholem ad nenv typeNameResInfo lid maybeAppliedArgExpr with | Exception e -> Exception e | Result (tinstEnclosing, item1, rest) -> - let itemRange = ComputeItemRange wholem lid rest + let itemRange, itemIdentRange = ComputeItemRange wholem lid rest let item = FilterMethodGroups ncenv itemRange item1 true @@ -4241,13 +4263,16 @@ let ResolveLongIdentAsExprAndComputeRange (sink: TcResultsSink) (ncenv: NameReso | Item.ActivePatternResult _ -> ItemOccurrence.Binding | _ -> ItemOccurrence.Use - CallMethodGroupNameResolutionSink sink (itemRange, nenv, refinedItem, item, tpinst, occurrence, ad) + // Use the narrow terminal-identifier range for the sink so that + // FSharpSymbolUse / Find Usages / symbol-highlight surfaces report + // only on the name the user perceives as the item's name, not on + // the full long-id span. See #3920, #14284. + CallMethodGroupNameResolutionSink sink (itemIdentRange, nenv, refinedItem, item, tpinst, occurrence, ad) // #16621 match refinedItem with | Item.Property(_, pinfos, _) -> - let propIdentRange = if rest.IsEmpty then (List.last lid).idRange else itemRange - RegisterUnionCaseTesterForProperty sink propIdentRange pinfos + RegisterUnionCaseTesterForProperty sink itemIdentRange pinfos | _ -> () let callSinkWithSpecificOverload (minfo: MethInfo, pinfoOpt: PropInfo option, tpinst) = @@ -4267,14 +4292,14 @@ let ResolveLongIdentAsExprAndComputeRange (sink: TcResultsSink) (ncenv: NameReso AfterResolution.RecordResolution(None, (fun tpinst -> callSink(item, tpinst)), callSinkWithSpecificOverload, (fun () -> callSink (item, emptyTyparInst))) elif isWrongItemInExpr item then - CallNameResolutionSink sink (itemRange, nenv, item, emptyTyparInst, ItemOccurrence.InvalidUse, ad) + CallNameResolutionSink sink (itemIdentRange, nenv, item, emptyTyparInst, ItemOccurrence.InvalidUse, ad) AfterResolution.DoNothing else callSink (item, emptyTyparInst) AfterResolution.DoNothing - success (tinstEnclosing, item, itemRange, rest, afterResolution) + success (tinstEnclosing, item, itemRange, itemIdentRange, rest, afterResolution) [] let (|NonOverridable|_|) namedItem = @@ -4292,11 +4317,11 @@ let ResolveExprDotLongIdentAndComputeRange (sink: TcResultsSink) (ncenv: NameRes | id :: rest -> ResolveExprDotLongIdent ncenv wholem ad nenv ty id rest typeNameResInfo findFlag maybeAppliedArgExpr | _ -> error(InternalError("ResolveExprDotLongIdentAndComputeRange", wholem)) - let itemRange = ComputeItemRange wholem lid rest - resInfo, item, rest, itemRange + let itemRange, itemIdentRange = ComputeItemRange wholem lid rest + resInfo, item, rest, itemRange, itemIdentRange // "true" resolution - let resInfo, item, rest, itemRange = resolveExpr findFlag + let resInfo, item, rest, itemRange, itemIdentRange = resolveExpr findFlag ResolutionInfo.SendEntityPathToSink(sink, ncenv, nenv, ItemOccurrence.Use, ad, resInfo, ResultTyparChecker(fun () -> CheckAllTyparsInferrable ncenv.amap itemRange item)) // Record the precise resolution of the field for intellisense/goto definition @@ -4305,25 +4330,26 @@ let ResolveExprDotLongIdentAndComputeRange (sink: TcResultsSink) (ncenv: NameRes | None -> AfterResolution.DoNothing // do not refine the resolution if nobody listens | Some _ -> // resolution for goto definition - let unrefinedItem, itemRange, overrides = + let unrefinedItem, itemRange, itemIdentRange, overrides = match findFlag, item with | FindMemberFlag.PreferOverrides, _ - | _, NonOverridable() -> item, itemRange, false + | _, NonOverridable() -> item, itemRange, itemIdentRange, false | FindMemberFlag.IgnoreOverrides, _ | FindMemberFlag.DiscardOnFirstNonOverride, _ -> - let _, item, _, itemRange = resolveExpr FindMemberFlag.PreferOverrides - item, itemRange, true + let _, item, _, itemRange, itemIdentRange = resolveExpr FindMemberFlag.PreferOverrides + item, itemRange, itemIdentRange, true let callSink (refinedItem, tpinst) = let refinedItem = FilterMethodGroups ncenv itemRange refinedItem staticOnly let unrefinedItem = FilterMethodGroups ncenv itemRange unrefinedItem staticOnly - CallMethodGroupNameResolutionSink sink (itemRange, nenv, refinedItem, unrefinedItem, tpinst, ItemOccurrence.Use, ad) + // Use narrow terminal-identifier range for the sink (FSharpSymbolUse / Find Usages + // / symbol highlight). See #3920, #14284. + CallMethodGroupNameResolutionSink sink (itemIdentRange, nenv, refinedItem, unrefinedItem, tpinst, ItemOccurrence.Use, ad) // #16621 match refinedItem with | Item.Property(_, pinfos, _) -> - let propIdentRange = if rest.IsEmpty then (List.last lid).idRange else itemRange - RegisterUnionCaseTesterForProperty sink propIdentRange pinfos + RegisterUnionCaseTesterForProperty sink itemIdentRange pinfos | _ -> () let callSinkWithSpecificOverload (minfo: MethInfo, pinfoOpt: PropInfo option, tpinst) = @@ -4344,7 +4370,7 @@ let ResolveExprDotLongIdentAndComputeRange (sink: TcResultsSink) (ncenv: NameRes callSink (unrefinedItem, emptyTyparInst) AfterResolution.DoNothing - item, itemRange, rest, afterResolution + item, itemRange, itemIdentRange, rest, afterResolution //------------------------------------------------------------------------- diff --git a/src/Compiler/Checking/NameResolution.fsi b/src/Compiler/Checking/NameResolution.fsi index b5f6a7172aa..c43410b1e02 100755 --- a/src/Compiler/Checking/NameResolution.fsi +++ b/src/Compiler/Checking/NameResolution.fsi @@ -875,6 +875,11 @@ val internal ResolvePartialLongIdentToClassOrRecdFields: val internal ResolveRecordOrClassFieldsOfType: NameResolver -> range -> AccessorDomain -> TType -> bool -> Item list /// Resolve a long identifier occurring in an expression position. +/// +/// Returns the structural `range` (the whole long-identifier span used for +/// typed-tree construction) and a narrow `range` — the terminal identifier's +/// own source range — for use in diagnostics and symbol-use reporting +/// (see #14284, #3920). val internal ResolveLongIdentAsExprAndComputeRange: sink: TcResultsSink -> ncenv: NameResolver -> @@ -884,9 +889,14 @@ val internal ResolveLongIdentAsExprAndComputeRange: typeNameResInfo: TypeNameResolutionInfo -> lid: Ident list -> maybeAppliedArgExpr: SynExpr option -> - ResultOrException + ResultOrException /// Resolve a long identifier occurring in an expression position, qualified by a type. +/// +/// Returns the structural `range` (the whole long-identifier span used for +/// typed-tree construction) and a narrow `range` — the terminal identifier's +/// own source range — for use in diagnostics and symbol-use reporting +/// (see #14284, #3920). val internal ResolveExprDotLongIdentAndComputeRange: sink: TcResultsSink -> ncenv: NameResolver -> @@ -899,7 +909,7 @@ val internal ResolveExprDotLongIdentAndComputeRange: findFlag: FindMemberFlag -> staticOnly: bool -> maybeAppliedArgExpr: SynExpr option -> - Item * range * Ident list * AfterResolution + Item * range * range * Ident list * AfterResolution /// A generator of type instantiations used when no more specific type instantiation is known. val FakeInstantiationGenerator: range -> Typar list -> TType list diff --git a/src/Compiler/Service/ServiceParamInfoLocations.fs b/src/Compiler/Service/ServiceParamInfoLocations.fs index 2556111a21a..331f7b5e917 100755 --- a/src/Compiler/Service/ServiceParamInfoLocations.fs +++ b/src/Compiler/Service/ServiceParamInfoLocations.fs @@ -466,13 +466,29 @@ module internal SynExprAppLocationsImpl = | _ -> None, Some inner let getAllCurriedArgsAtPosition pos parseTree = + // Finds the leaf (non-App) function expression in a curried application chain. + // E.g. for App(App(LongIdent([M;f]), arg1), arg2) returns LongIdent([M;f]). + let rec getLeafFuncExpr = + function + | SynExpr.App(funcExpr = funcExpr) -> getLeafFuncExpr funcExpr + | expr -> expr + SyntaxTraversal.Traverse( pos, parseTree, { new SyntaxVisitorBase<_>() with member _.VisitExpr(_path, traverseSynExpr, defaultTraverse, expr) = match expr with - | SynExpr.App(_exprAtomicFlag, _isInfix, funcExpr, argExpr, range) when posEq pos range.Start -> + // After symbol-use range narrowing for dotted accesses (e.g. M.f, obj.Method), + // pos may point at the terminal identifier rather than the full long-id start. + // The second condition handles this by checking whether pos falls within the + // leaf function expression's range in the application chain. + // We exclude infix applications from the fallback to avoid matching operator + // uses like "a === b" where pos points at the operator. + | SynExpr.App(_exprAtomicFlag, isInfix, funcExpr, argExpr, range) when + posEq pos range.Start + || (not isInfix && rangeContainsPos (getLeafFuncExpr funcExpr).Range pos) + -> let isInfixFuncExpr = match funcExpr with | SynExpr.App(_, isInfix, _, _, _) -> isInfix diff --git a/tests/FSharp.Compiler.ComponentTests/ConstraintSolver/neg_invalid_constructor.fs.err.bsl b/tests/FSharp.Compiler.ComponentTests/ConstraintSolver/neg_invalid_constructor.fs.err.bsl index 960310bbe1c..aaeef693be3 100644 --- a/tests/FSharp.Compiler.ComponentTests/ConstraintSolver/neg_invalid_constructor.fs.err.bsl +++ b/tests/FSharp.Compiler.ComponentTests/ConstraintSolver/neg_invalid_constructor.fs.err.bsl @@ -1,18 +1,18 @@ -neg_invalid_constructor.fs (3,29)-(3,56) typecheck error A unique overload for method 'ImmutableStack`1' could not be determined based on type information prior to this program point. A type annotation may be needed. +neg_invalid_constructor.fs (3,29)-(3,43) typecheck error A unique overload for method 'ImmutableStack`1' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: 'a list Candidates: - new: col: 'b -> ImmutableStack<'a> - private new: items: 'a list -> ImmutableStack<'a> -neg_invalid_constructor.fs (4,93)-(4,111) typecheck error A unique overload for method 'ImmutableStack`1' could not be determined based on type information prior to this program point. A type annotation may be needed. +neg_invalid_constructor.fs (4,93)-(4,107) typecheck error A unique overload for method 'ImmutableStack`1' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: 'a list Candidates: - new: col: 'b -> ImmutableStack<'a> - private new: items: 'a list -> ImmutableStack<'a> -neg_invalid_constructor.fs (7,30)-(7,60) typecheck error A unique overload for method 'ImmutableStack`1' could not be determined based on type information prior to this program point. A type annotation may be needed. +neg_invalid_constructor.fs (7,30)-(7,44) typecheck error A unique overload for method 'ImmutableStack`1' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: 'a list diff --git a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/OverloadResolutionErrorRangeTests.fs b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/OverloadResolutionErrorRangeTests.fs new file mode 100644 index 00000000000..c2c1f28225c --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/OverloadResolutionErrorRangeTests.fs @@ -0,0 +1,154 @@ +module ErrorMessages.OverloadResolutionErrorRangeTests + +open Xunit +open FSharp.Test.Compiler + +// https://github.com/dotnet/fsharp/issues/14284 +[] +let ``Issue 14284 - overload error should cover only method name, not full expression`` () = + FSharp + """ +type T() = + static member Instance = T() + + member _.Method(_: double) = () + member _.Method(_: int) = () + +T.Instance.Method("") + """ + |> typecheck + |> shouldFail + |> withDiagnostics + [ (Error 41, Line 8, Col 12, Line 8, Col 18, "No overloads match for method 'Method'. + +Known type of argument: string + +Available overloads: + - member T.Method: double -> unit // Argument at index 1 doesn't match + - member T.Method: int -> unit // Argument at index 1 doesn't match") ] + +// Verify that the error range is narrow also for simple direct method calls +[] +let ``Issue 14284 - overload error for simple static method`` () = + FSharp + """ +type T() = + static member Method(_: double) = () + static member Method(_: int) = () + +T.Method("") + """ + |> typecheck + |> shouldFail + |> withDiagnostics + [ (Error 41, Line 6, Col 3, Line 6, Col 9, "No overloads match for method 'Method'. + +Known type of argument: string + +Available overloads: + - static member T.Method: double -> unit // Argument at index 1 doesn't match + - static member T.Method: int -> unit // Argument at index 1 doesn't match") ] + +// Verify that a long expression before the method doesn't widen the error range +[] +let ``Issue 14284 - overload error on chained expression`` () = + FSharp + """ +type T() = + static member Instance = T() + + member _.Next = T() + member _.Method(_: double) = () + member _.Method(_: int) = () + +T.Instance.Next.Next.Method("") + """ + |> typecheck + |> shouldFail + |> withDiagnostics + [ (Error 41, Line 9, Col 22, Line 9, Col 28, "No overloads match for method 'Method'. + +Known type of argument: string + +Available overloads: + - member T.Method: double -> unit // Argument at index 1 doesn't match + - member T.Method: int -> unit // Argument at index 1 doesn't match") ] + +// Verify error range with lambda argument +[] +let ``Issue 14284 - overload error with lambda argument`` () = + FSharp + """ +type T() = + static member Instance = T() + + member _.Method(_: double) = () + member _.Method(_: int) = () + +T.Instance.Method(fun () -> "") + """ + |> typecheck + |> shouldFail + |> withDiagnostics + [ (Error 41, Line 8, Col 12, Line 8, Col 18, "No overloads match for method 'Method'. + +Known type of argument: (unit -> string) + +Available overloads: + - member T.Method: double -> unit // Argument at index 1 doesn't match + - member T.Method: int -> unit // Argument at index 1 doesn't match") ] + +// Verify that backtick-escaped method names fall back to the full mItem range +// (methodName.Length doesn't account for backtick delimiters in source text) +[] +let ``Issue 14284 - backtick-escaped method name falls back to full range`` () = + FSharp + """ +type T() = + static member Instance = T() + + member _.``My Method``(_: double) = () + member _.``My Method``(_: int) = () + +T.Instance.``My Method``("") + """ + |> typecheck + |> shouldFail + |> withDiagnostics + [ (Error 41, Line 8, Col 1, Line 8, Col 25, "No overloads match for method 'My Method'. + +Known type of argument: string + +Available overloads: + - member T.``My Method`` : double -> unit // Argument at index 1 doesn't match + - member T.``My Method`` : int -> unit // Argument at index 1 doesn't match") ] + +// Verify multiline method access falls back to mItem range +[] +let ``Issue 14284 - multiline method access falls back to mItem`` () = + FSharp + """ +type T() = + static member Instance = T() + + member _.Method(_: double) = () + member _.Method(_: int) = () + +T + .Instance + .Method("") + """ + |> typecheck + |> shouldFail + |> withErrorCode 41 + +// Additional Phase 1 tests (issue #3920 follow-up): diagnostic sites beyond +// UnresolvedOverloading. These verify that the narrow terminal-identifier +// range applies to every diagnostic site that reports on a resolved item +// reached through a long identifier. +// +// NOTE: Obsolete warnings for members reached through a dotted long-identifier +// are currently emitted at the full `mItem` range (the whole `T.Instance.M` +// span). Narrowing those requires plumbing `mItemIdent` all the way to +// `CheckMethInfoAttributes` / property-access diagnostic sites, which is out +// of scope for this change. Tracked as follow-up. diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj index 2e892f803b0..48eb5b46192 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj +++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj @@ -305,6 +305,7 @@ + diff --git a/tests/FSharp.Compiler.ComponentTests/FSharpChecker/FindReferences.fs b/tests/FSharp.Compiler.ComponentTests/FSharpChecker/FindReferences.fs index d7a5fc860ca..945b89e939e 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharpChecker/FindReferences.fs +++ b/tests/FSharp.Compiler.ComponentTests/FSharpChecker/FindReferences.fs @@ -190,7 +190,7 @@ let bar x = Library.foo x""" }) project.Workflow { placeCursor "Library" "foo" findAllReferences (expectToFind [ - "FileFirst.fs", 4, 12, 23 + "FileFirst.fs", 4, 20, 23 "FileLibrary.fs", 5, 8, 11 ]) } @@ -205,7 +205,7 @@ let ``We find back-ticked identifiers`` () = placeCursor "Second" 6 35 "let foo x = ModuleFirst.``foo bar`` x" ["``foo bar``"] findAllReferences (expectToFind [ "FileFirst.fs", 6, 4, 15 - "FileSecond.fs", 6, 12, 35 + "FileSecond.fs", 6, 24, 35 ]) } @@ -445,7 +445,7 @@ let ``We find values of a type that has been aliased`` () = findAllReferences (expectToFind [ "FileFirst.fs", 7, 4, 9 "FileFirst.fsi", 3, 4, 9 - "FileSecond.fs", 6, 12, 29 + "FileSecond.fs", 6, 24, 29 ]) } @@ -669,7 +669,7 @@ type internal SomeType() = let property1Locations() = [ "FileFirst.fs", 4, 20, 29 "FileSecond.fs", 7, 17, 26 - "FileSecond.fs", 13, 12, 43 // Not sure why we get the whole range here, but it seems to work fine. + "FileSecond.fs", 13, 34, 43 // Narrow terminal-identifier range (see #3920). ] let method1Locations() = [ @@ -766,8 +766,8 @@ let test () = "test.fs", 7, 16, 26 // Definition "test.fs", 8, 13, 16 // Getter at 'get' keyword "test.fs", 9, 12, 15 // Setter at 'set' keyword - "test.fs", 13, 4, 20 // Usage with qualifier - "test.fs", 14, 4, 20 // Usage with qualifier + "test.fs", 13, 10, 20 // Usage narrows to terminal identifier (#3920) + "test.fs", 14, 10, 20 // Usage narrows to terminal identifier (#3920) ] /// Test for single-line interface syntax (related to #15399) @@ -789,7 +789,7 @@ foo.Bar() testFindRefsInSource source "Bar" [ "test.fs", 4, 28, 31 // Abstract member definition "test.fs", 6, 43, 46 // Implementation - "test.fs", 9, 0, 7 // Usage via foo.Bar() + "test.fs", 9, 4, 7 // Usage via foo.Bar() narrows to identifier (#3920) ] [] diff --git a/tests/FSharp.Compiler.Service.Tests/EditorTests.fs b/tests/FSharp.Compiler.Service.Tests/EditorTests.fs index 44be1a5cfef..145394d681a 100644 --- a/tests/FSharp.Compiler.Service.Tests/EditorTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/EditorTests.fs @@ -735,13 +735,13 @@ let _ = // note: these "System" symbol uses are not duplications because each of them corresponds to different namespaces [|("System", (2, 5, 2, 11)) ("ConsoleKey", (5, 10, 5, 20)); - ("field Tab", (5, 10, 5, 24)); + ("field Tab", (5, 21, 5, 24)); ("ConsoleKey", (6, 6, 6, 16)); ("field OemClear", (6, 6, 6, 25)); ("ConsoleKey", (6, 29, 6, 39)); - ("field A", (6, 29, 6, 41)); + ("field A", (6, 40, 6, 41)); ("ConsoleKey", (7, 11, 7, 21)); - ("field B", (7, 11, 7, 23)); + ("field B", (7, 22, 7, 23)); ("Test", (1, 0, 1, 0))|] [] diff --git a/tests/FSharp.Compiler.Service.Tests/MultiProjectAnalysisTests.fs b/tests/FSharp.Compiler.Service.Tests/MultiProjectAnalysisTests.fs index 4f7931f609a..767015da8c2 100644 --- a/tests/FSharp.Compiler.Service.Tests/MultiProjectAnalysisTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/MultiProjectAnalysisTests.fs @@ -505,7 +505,7 @@ let ``Test multi project symbols should pick up changes in dependent projects`` usesOfXSymbolInProject2 |> shouldEqual [|("val x", "Project2", ((5, 8), (5, 9))); - ("val x", "Project2", ((6, 8), (6, 18)))|] + ("val x", "Project2", ((6, 17), (6, 18)))|] //---------------- Change the file by adding a line, then re-check everything -------------------- @@ -553,7 +553,7 @@ let ``Test multi project symbols should pick up changes in dependent projects`` usesOfXSymbolInProject2AfterChange1 |> shouldEqual [|("val x", "Project2", ((5, 8), (5, 9))); - ("val x", "Project2", ((6, 8), (6, 18)))|] + ("val x", "Project2", ((6, 17), (6, 18)))|] //---------------- Revert the change to the file -------------------- @@ -602,7 +602,7 @@ let ``Test multi project symbols should pick up changes in dependent projects`` usesOfXSymbolInProject2AfterChange2 |> shouldEqual [|("val x", "Project2", ((5, 8), (5, 9))); - ("val x", "Project2", ((6, 8), (6, 18)))|] + ("val x", "Project2", ((6, 17), (6, 18)))|] //------------------------------------------------------------------ diff --git a/tests/FSharp.Compiler.Service.Tests/ProjectAnalysisTests.fs b/tests/FSharp.Compiler.Service.Tests/ProjectAnalysisTests.fs index 551bdf02ea2..3a528ee7a2e 100644 --- a/tests/FSharp.Compiler.Service.Tests/ProjectAnalysisTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/ProjectAnalysisTests.fs @@ -358,8 +358,8 @@ let ``Test project1 xxx symbols`` () = [("file1", ((7, 4), (7, 7)), ["val"]); ("file1", ((8, 13), (8, 16)), ["val"]); ("file1", ((8, 19), (8, 22)), ["val"]); - ("file2", ((7, 28), (7, 33)), ["val"]); - ("file2", ((13, 27), (13, 32)), ["val"])] + ("file2", ((7, 30), (7, 33)), ["val"]); + ("file2", ((13, 29), (13, 32)), ["val"])] [] let ``Test project1 all uses of all signature symbols`` () = @@ -401,7 +401,7 @@ let ``Test project1 all uses of all signature symbols`` () = [("file2", ((26, 5), (26, 16))); ("file2", ((30, 16), (30, 27)))]); ("field value__", []); ("field None", [("file2", ((27, 4), (27, 8)))]); ("field DisableFormatting", - [("file2", ((28, 4), (28, 21))); ("file2", ((30, 16), (30, 45)))]); + [("file2", ((28, 4), (28, 21))); ("file2", ((30, 28), (30, 45)))]); ("M", [("file1", ((1, 7), (1, 8))); ("file2", ((3, 5), (3, 6))); ("file2", ((6, 28), (6, 29))); ("file2", ((9, 28), (9, 29))); @@ -410,9 +410,9 @@ let ``Test project1 all uses of all signature symbols`` () = ("file2", ((39, 28), (39, 29)))]); ("val xxx", [("file1", ((6, 4), (6, 7))); ("file1", ((7, 13), (7, 16))); - ("file1", ((7, 19), (7, 22))); ("file2", ((6, 28), (6, 33))); - ("file2", ((12, 27), (12, 32)))]); - ("val fff", [("file1", ((7, 4), (7, 7))); ("file2", ((9, 28), (9, 33)))]); + ("file1", ((7, 19), (7, 22))); ("file2", ((6, 30), (6, 33))); + ("file2", ((12, 29), (12, 32)))]); + ("val fff", [("file1", ((7, 4), (7, 7))); ("file2", ((9, 30), (9, 33)))]); ("C", [("file1", ((3, 5), (3, 6))); ("file1", ((9, 15), (9, 16))); ("file2", ((38, 12), (38, 15))); ("file2", ((38, 22), (38, 25)))]); @@ -463,7 +463,7 @@ let ``Test project1 all uses of all symbols`` () = ("SomeProperty", "N.D1.SomeProperty", "file2", ((6, 13), (6, 25)), ["member"; "getter"]); ("x", "x", "file2", ((6, 11), (6, 12)), []); ("M", "M", "file2", ((6, 28), (6, 29)), ["module"]); - ("xxx", "M.xxx", "file2", ((6, 28), (6, 33)), ["val"]); + ("xxx", "M.xxx", "file2", ((6, 30), (6, 33)), ["val"]); ("D2", "N.D2", "file2", ((8, 5), (8, 7)), ["class"]); ("``.ctor``", "N.D2.``.ctor``", "file2", ((8, 5), (8, 7)), ["member"; "ctor"]); @@ -472,10 +472,10 @@ let ``Test project1 all uses of all symbols`` () = ("(+)", "Microsoft.FSharp.Core.Operators.(+)", "file2", ((9, 36), (9, 37)), ["val"]); ("M", "M", "file2", ((9, 28), (9, 29)), ["module"]); - ("fff", "M.fff", "file2", ((9, 28), (9, 33)), ["val"]); + ("fff", "M.fff", "file2", ((9, 30), (9, 33)), ["val"]); ("D1", "N.D1", "file2", ((9, 38), (9, 40)), ["member"; "ctor"]); ("M", "M", "file2", ((12, 27), (12, 28)), ["module"]); - ("xxx", "M.xxx", "file2", ((12, 27), (12, 32)), ["val"]); + ("xxx", "M.xxx", "file2", ((12, 29), (12, 32)), ["val"]); ("y2", "N.y2", "file2", ((12, 4), (12, 6)), ["val"]); ("DefaultValueAttribute", "Microsoft.FSharp.Core.DefaultValueAttribute", "file2", ((18, 6), (18, 18)), ["class"]); @@ -520,7 +520,7 @@ let ``Test project1 all uses of all symbols`` () = ("System", "System", "file2", ((23, 33), (23, 39)), ["namespace"]); ("Now", "System.DateTime.Now", "file2", ((23, 33), (23, 52)), ["member"; "prop"]); - ("Ticks", "System.DateTime.Ticks", "file2", ((23, 33), (23, 58)), + ("Ticks", "System.DateTime.Ticks", "file2", ((23, 53), (23, 58)), ["member"; "prop"]); ("(+)", "Microsoft.FSharp.Core.Operators.(+)", "file2", ((23, 62), (23, 63)), ["val"]); @@ -535,7 +535,7 @@ let ``Test project1 all uses of all symbols`` () = ("SaveOptions", "N.SaveOptions", "file2", ((30, 16), (30, 27)), ["enum"; "valuetype"]); ("DisableFormatting", "N.SaveOptions.DisableFormatting", "file2", - ((30, 16), (30, 45)), ["field"; "static"; "1"]); + ((30, 28), (30, 45)), ["field"; "static"; "1"]); ("enumValue", "N.enumValue", "file2", ((30, 4), (30, 13)), ["val"]); ("x", "x", "file2", ((32, 9), (32, 10)), []); ("y", "y", "file2", ((32, 11), (32, 12)), []); @@ -600,8 +600,8 @@ let ``Test file explicit parse symbols`` () = |> shouldEqual [|("file1", ((6, 4), (6, 7))); ("file1", ((7, 13), (7, 16))); ("file1", ((7, 19), (7, 22))); - ("file2", ((6, 28), (6, 33))); - ("file2", ((12, 27), (12, 32)))|] + ("file2", ((6, 30), (6, 33))); + ("file2", ((12, 29), (12, 32)))|] usesOfXSymbol21 |> shouldEqual [|("file1", ((6, 4), (6, 7))); @@ -609,8 +609,8 @@ let ``Test file explicit parse symbols`` () = ("file1", ((7, 19), (7, 22)))|] usesOfXSymbol22 - |> shouldEqual [|("file2", ((6, 28), (6, 33))); - ("file2", ((12, 27), (12, 32)))|] + |> shouldEqual [|("file2", ((6, 30), (6, 33))); + ("file2", ((12, 29), (12, 32)))|] [] @@ -773,7 +773,7 @@ let ``Test project2 all uses of all signature symbols`` () = ("member .ctor", [("file1", ((16, 5), (16, 17))); ("file1", ((19, 8), (19, 20)))]); ("member GenericMethod", - [("file1", ((17, 13), (17, 26))); ("file1", ((20, 8), (20, 23)))]); + [("file1", ((17, 13), (17, 26))); ("file1", ((20, 10), (20, 23)))]); ("generic parameter U", [("file1", ((17, 27), (17, 29))); ("file1", ((17, 41), (17, 43)))])] set allUsesOfAllSymbols - set expected |> shouldEqual Set.empty @@ -834,7 +834,7 @@ let ``Test project2 all uses of all symbols`` () = ("int", "file1", ((19, 21), (19, 24)), ["abbrev"]); ("c", "file1", ((19, 4), (19, 5)), ["val"]); ("c", "file1", ((20, 8), (20, 9)), ["val"]); - ("GenericMethod", "file1", ((20, 8), (20, 23)), ["member"]); + ("GenericMethod", "file1", ((20, 10), (20, 23)), ["member"]); ("int", "file1", ((20, 24), (20, 27)), ["abbrev"]); ("T", "file1", ((22, 23), (22, 25)), []); ("T", "file1", ((22, 30), (22, 32)), []); @@ -1087,12 +1087,12 @@ let ``Test project3 all uses of all signature symbols`` () = ("member InterfaceMethod", [("file1", ((6, 13), (6, 28)), ["defn"], ["slot"; "member"]); ("file1", ((63, 20), (63, 35)), ["override"], ["slot"; "member"]); - ("file1", ((79, 23), (79, 42)), [], ["slot"; "member"]); + ("file1", ((79, 27), (79, 42)), [], ["slot"; "member"]); ("file1", ((36, 20), (36, 35)), ["override"], ["slot"; "member"])]); ("member add_InterfaceEvent", [("file1", ((8, 13), (8, 27)), ["defn"], ["slot"; "member"; "add"]); ("file1", ((65, 20), (65, 34)), ["override"], ["slot"; "member"; "add"]); - ("file1", ((78, 23), (78, 41)), [], ["slot"; "member"; "add"]); + ("file1", ((78, 27), (78, 41)), [], ["slot"; "member"; "add"]); ("file1", ((38, 20), (38, 34)), ["override"], ["slot"; "member"; "add"])]); ("member get_InterfaceEvent", [("file1", ((8, 13), (8, 27)), ["defn"], ["slot"; "member"; "getter"]); @@ -1101,7 +1101,7 @@ let ``Test project3 all uses of all signature symbols`` () = ("member get_InterfaceProperty", [("file1", ((4, 13), (4, 30)), ["defn"], ["slot"; "member"; "getter"]); ("file1", ((61, 20), (61, 37)), ["override"], ["slot"; "member"; "getter"]); - ("file1", ((76, 23), (76, 44)), [], ["slot"; "member"; "getter"]); + ("file1", ((76, 27), (76, 44)), [], ["slot"; "member"; "getter"]); ("file1", ((34, 20), (34, 37)), ["override"], ["slot"; "member"; "getter"])]); ("member remove_InterfaceEvent", [("file1", ((8, 13), (8, 27)), ["defn"], ["slot"; "member"; "remove"]); @@ -1110,17 +1110,17 @@ let ``Test project3 all uses of all signature symbols`` () = ("member set_InterfacePropertySet", [("file1", ((5, 13), (5, 33)), ["defn"], ["slot"; "member"; "setter"]); ("file1", ((62, 20), (62, 40)), ["override"], ["slot"; "member"; "setter"]); - ("file1", ((77, 25), (77, 49)), [], ["slot"; "member"; "setter"]); + ("file1", ((77, 29), (77, 49)), [], ["slot"; "member"; "setter"]); ("file1", ((35, 20), (35, 40)), ["override"], ["slot"; "member"; "setter"])]); ("property InterfacePropertySet", [("file1", ((5, 13), (5, 33)), ["defn"], ["slot"; "member"; "prop"]); ("file1", ((62, 20), (62, 40)), ["override"], ["slot"; "member"; "prop"]); - ("file1", ((77, 25), (77, 49)), [], ["slot"; "member"; "prop"]); + ("file1", ((77, 29), (77, 49)), [], ["slot"; "member"; "prop"]); ("file1", ((35, 20), (35, 40)), ["override"], ["slot"; "member"; "prop"])]); ("property InterfaceProperty", [("file1", ((4, 13), (4, 30)), ["defn"], ["slot"; "member"; "prop"]); ("file1", ((61, 20), (61, 37)), ["override"], ["slot"; "member"; "prop"]); - ("file1", ((76, 23), (76, 44)), [], ["slot"; "member"; "prop"]); + ("file1", ((76, 27), (76, 44)), [], ["slot"; "member"; "prop"]); ("file1", ((34, 20), (34, 37)), ["override"], ["slot"; "member"; "prop"])]); ("event InterfaceEvent", [("file1", ((8, 13), (8, 27)), ["defn"], ["slot"; "member"; "event"; "clievent"]); @@ -1546,7 +1546,7 @@ let ``Test project 5 all symbols`` () = "Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicOperators.(~&)", "file1", ((15, 34), (15, 35)), []); ("val floatvalue", "floatvalue", "file1", ((15, 35), (15, 45)), []); - ("member TryParse", "System.Double.TryParse", "file1", ((15, 6), (15, 28)), []); + ("member TryParse", "System.Double.TryParse", "file1", ((15, 20), (15, 28)), []); ("Some", "Microsoft.FSharp.Core.Option<_>.Some", "file1", ((15, 52), (15, 56)), []); ("val floatvalue", "floatvalue", "file1", ((15, 57), (15, 67)), []); ("None", "Microsoft.FSharp.Core.Option<_>.None", "file1", ((16, 8), (16, 12)), @@ -2009,7 +2009,7 @@ let ``Test Project10 all symbols`` () = ("val url", "url", "file1", ((5, 20), (5, 23)), []); ("val query", "query", "file1", ((5, 33), (5, 38)), []); ("C", "C", "file1", ((7, 0), (7, 1)), ["class"]); - ("member M", "M", "file1", ((7, 0), (7, 3)), ["member"]); + ("member M", "M", "file1", ((7, 2), (7, 3)), ["member"]); ("parameter query", "query", "file1", ((7, 18), (7, 23)), []); ("NamedArgs", "NamedArgs", "file1", ((2, 7), (2, 16)), ["module"])|] @@ -2796,10 +2796,10 @@ let ``Test Project17 all symbols`` () = [("Microsoft", "Microsoft", "file1", ((4, 8), (4, 17)), [], ["namespace"]); ("Collections", "Collections", "file1", ((4, 25), (4, 36)), [], ["namespace"]); ("FSharp", "FSharp", "file1", ((4, 18), (4, 24)), [], ["namespace"]); - ("FSharpList`1", "List", "file1", ((4, 8), (4, 41)), [], ["union"]); + ("FSharpList`1", "List", "file1", ((4, 37), (4, 41)), [], ["union"]); ("int", "int", "file1", ((4, 42), (4, 45)), ["type"], ["abbrev"]); ("FSharpList`1", "List", "file1", ((4, 8), (4, 46)), [], ["union"]); - ("property Empty", "Empty", "file1", ((4, 8), (4, 52)), [], ["member"; "prop"]); + ("property Empty", "Empty", "file1", ((4, 47), (4, 52)), [], ["member"; "prop"]); ("System", "System", "file1", ((6, 11), (6, 17)), [], ["namespace"]); ("Collections", "Collections", "file1", ((6, 18), (6, 29)), [], ["namespace"]); ("Generic", "Generic", "file1", ((6, 30), (6, 37)), [], ["namespace"]); @@ -2807,13 +2807,13 @@ let ``Test Project17 all symbols`` () = ("generic parameter T", "T", "file1", ((6, 44), (6, 46)), ["type"], []); ("val x", "x", "file1", ((6, 8), (6, 9)), ["defn"], []); ("val x", "x", "file1", ((6, 51), (6, 52)), [], []); - ("property Item", "Item", "file1", ((6, 51), (6, 57)), [], + ("property Item", "Item", "file1", ((6, 53), (6, 57)), [], ["slot"; "member"; "prop"]); ("val x", "x", "file1", ((6, 62), (6, 63)), [], []); ("property Item", "Item", "file1", ((6, 62), (6, 67)), [], ["slot"; "member"; "prop"]); ("val x", "x", "file1", ((6, 69), (6, 70)), [], []); - ("property Count", "Count", "file1", ((6, 69), (6, 76)), [], + ("property Count", "Count", "file1", ((6, 71), (6, 76)), [], ["slot"; "member"; "prop"]); ("val f1", "f1", "file1", ((6, 4), (6, 6)), ["defn"], ["val"]); ("System", "System", "file1", ((8, 11), (8, 17)), [], ["namespace"]); @@ -2830,7 +2830,7 @@ let ``Test Project17 all symbols`` () = ("Exception", "Exception", "file1", ((10, 11), (10, 27)), ["type"], ["class"]); ("val x", "x", "file1", ((10, 8), (10, 9)), ["defn"], []); ("val x", "x", "file1", ((10, 31), (10, 32)), [], []); - ("property HelpLink", "HelpLink", "file1", ((10, 31), (10, 41)), [], + ("property HelpLink", "HelpLink", "file1", ((10, 33), (10, 41)), [], ["slot"; "member"; "prop"]); ("val f3", "f3", "file1", ((10, 4), (10, 6)), ["defn"], ["val"]); ("Impl", "Impl", "file1", ((2, 7), (2, 11)), ["defn"], ["module"])]) @@ -2881,7 +2881,7 @@ let ``Test Project18 all symbols`` () = allUsesOfAllSymbols |> shouldEqual [|("list`1", "list", "file1", ((4, 8), (4, 12)), [], false); ("list`1", "list", "file1", ((4, 8), (4, 15)), [], false); - ("property Empty", "Empty", "file1", ((4, 8), (4, 21)), [], false); + ("property Empty", "Empty", "file1", ((4, 16), (4, 21)), [], false); ("Impl", "Impl", "file1", ((2, 7), (2, 11)), ["defn"], false)|] @@ -2941,10 +2941,10 @@ let ``Test Project19 all symbols`` () = ["field"; "static"; "2"]); ("Enum", "Enum", "file1", ((4, 5), (4, 9)), ["defn"], ["enum"; "valuetype"]); ("Enum", "Enum", "file1", ((6, 8), (6, 12)), [], ["enum"; "valuetype"]); - ("field EnumCase1", "EnumCase1", "file1", ((6, 8), (6, 22)), [], + ("field EnumCase1", "EnumCase1", "file1", ((6, 13), (6, 22)), [], ["field"; "static"; "1"]); ("Enum", "Enum", "file1", ((7, 8), (7, 12)), [], ["enum"; "valuetype"]); - ("field EnumCase2", "EnumCase2", "file1", ((7, 8), (7, 22)), [], + ("field EnumCase2", "EnumCase2", "file1", ((7, 13), (7, 22)), [], ["field"; "static"; "2"]); ("val x", "x", "file1", ((8, 6), (8, 7)), ["defn"], []); ("val x", "x", "file1", ((8, 16), (8, 17)), [], []); @@ -2958,7 +2958,7 @@ let ``Test Project19 all symbols`` () = ("System", "System", "file1", ((10, 8), (10, 14)), [], ["namespace"]); ("DayOfWeek", "DayOfWeek", "file1", ((10, 15), (10, 24)), [], ["enum"; "valuetype"]); - ("field Monday", "Monday", "file1", ((10, 8), (10, 31)), [], + ("field Monday", "Monday", "file1", ((10, 25), (10, 31)), [], ["field"; "static"; "1"]); ("val s", "s", "file1", ((10, 4), (10, 5)), ["defn"], ["val"]); ("Impl", "Impl", "file1", ((2, 7), (2, 11)), ["defn"], ["module"])]) @@ -3092,7 +3092,7 @@ let ``Test Project21 all symbols`` () = ("unit", "unit", "file1", ((12, 43), (12, 47)), ["type"], ["abbrev"]); ("val raise", "raise", "file1", ((13, 18), (13, 23)), [], ["val"]); ("System", "System", "file1", ((13, 25), (13, 31)), [], ["namespace"]); - ("member .ctor", "NotImplementedException", "file1", ((13, 25), (13, 55)), [], ["member"]); + ("member .ctor", "NotImplementedException", "file1", ((13, 32), (13, 55)), [], ["member"]); ("Impl", "Impl", "file1", ((2, 7), (2, 11)), ["defn"], ["module"])|] //----------------------------------------------------------------------------------------- @@ -3514,41 +3514,41 @@ let ``Test Project24 all symbols`` () = ("v", "file1", ((25, 18), (25, 19)), ["defn"], []); ("``.cctor``", "file1", ((4, 5), (4, 23)), ["defn"], ["member"]); ("TypeWithProperties", "file1", ((33, 9), (33, 27)), [], ["member"; "ctor"]); - ("NameGetSet", "file1", ((33, 9), (33, 40)), [], ["member"; "prop"]); + ("NameGetSet", "file1", ((33, 30), (33, 40)), [], ["member"; "prop"]); ("v1", "file1", ((33, 4), (33, 6)), ["defn"], ["val"]); ("TypeWithProperties", "file1", ((34, 0), (34, 18)), [], ["member"; "ctor"]); - ("NameGetSet", "file1", ((34, 0), (34, 31)), [], ["member"; "prop"]); + ("NameGetSet", "file1", ((34, 21), (34, 31)), [], ["member"; "prop"]); ("TypeWithProperties", "file1", ((36, 9), (36, 27)), [], ["member"; "ctor"]); - ("NameGet", "file1", ((36, 9), (36, 37)), [], ["member"; "prop"]); + ("NameGet", "file1", ((36, 30), (36, 37)), [], ["member"; "prop"]); ("v2", "file1", ((36, 4), (36, 6)), ["defn"], ["val"]); ("TypeWithProperties", "file1", ((38, 0), (38, 18)), [], ["member"; "ctor"]); - ("NameSet", "file1", ((38, 0), (38, 28)), [], ["member"; "prop"]); + ("NameSet", "file1", ((38, 21), (38, 28)), [], ["member"; "prop"]); ("TypeWithProperties", "file1", ((40, 9), (40, 27)), [], ["class"]); - ("StaticNameGetSet", "file1", ((40, 9), (40, 44)), [], ["member"; "prop"]); + ("StaticNameGetSet", "file1", ((40, 28), (40, 44)), [], ["member"; "prop"]); ("v3", "file1", ((40, 4), (40, 6)), ["defn"], ["val"]); ("TypeWithProperties", "file1", ((41, 0), (41, 18)), [], ["class"]); - ("StaticNameGetSet", "file1", ((41, 0), (41, 35)), [], ["member"; "prop"]); + ("StaticNameGetSet", "file1", ((41, 19), (41, 35)), [], ["member"; "prop"]); ("TypeWithProperties", "file1", ((43, 9), (43, 27)), [], ["class"]); - ("StaticNameGet", "file1", ((43, 9), (43, 41)), [], ["member"; "prop"]); + ("StaticNameGet", "file1", ((43, 28), (43, 41)), [], ["member"; "prop"]); ("v4", "file1", ((43, 4), (43, 6)), ["defn"], ["val"]); ("TypeWithProperties", "file1", ((45, 0), (45, 18)), [], ["class"]); - ("StaticNameSet", "file1", ((45, 0), (45, 32)), [], ["member"; "prop"]); + ("StaticNameSet", "file1", ((45, 19), (45, 32)), [], ["member"; "prop"]); ("TypeWithProperties", "file1", ((47, 9), (47, 27)), [], ["member"; "ctor"]); - ("AutoPropGet", "file1", ((47, 9), (47, 41)), [], ["member"; "prop"]); + ("AutoPropGet", "file1", ((47, 30), (47, 41)), [], ["member"; "prop"]); ("v5", "file1", ((47, 4), (47, 6)), ["defn"], ["val"]); ("TypeWithProperties", "file1", ((49, 9), (49, 27)), [], ["member"; "ctor"]); - ("AutoPropGetSet", "file1", ((49, 9), (49, 44)), [], ["member"; "prop"]); + ("AutoPropGetSet", "file1", ((49, 30), (49, 44)), [], ["member"; "prop"]); ("v6", "file1", ((49, 4), (49, 6)), ["defn"], ["val"]); ("TypeWithProperties", "file1", ((50, 0), (50, 18)), [], ["member"; "ctor"]); - ("AutoPropGetSet", "file1", ((50, 0), (50, 35)), [], ["member"; "prop"]); + ("AutoPropGetSet", "file1", ((50, 21), (50, 35)), [], ["member"; "prop"]); ("TypeWithProperties", "file1", ((52, 9), (52, 27)), [], ["class"]); - ("StaticAutoPropGet", "file1", ((52, 9), (52, 45)), [], ["member"; "prop"]); + ("StaticAutoPropGet", "file1", ((52, 28), (52, 45)), [], ["member"; "prop"]); ("v7", "file1", ((52, 4), (52, 6)), ["defn"], ["val"]); ("TypeWithProperties", "file1", ((54, 9), (54, 27)), [], ["class"]); - ("StaticAutoPropGetSet", "file1", ((54, 9), (54, 48)), [], ["member"; "prop"]); + ("StaticAutoPropGetSet", "file1", ((54, 28), (54, 48)), [], ["member"; "prop"]); ("v8", "file1", ((54, 4), (54, 6)), ["defn"], ["val"]); ("TypeWithProperties", "file1", ((55, 0), (55, 18)), [], ["class"]); - ("StaticAutoPropGetSet", "file1", ((55, 0), (55, 39)), [], ["member"; "prop"]); + ("StaticAutoPropGetSet", "file1", ((55, 19), (55, 39)), [], ["member"; "prop"]); ("PropertyTest", "file1", ((2, 7), (2, 19)), ["defn"], ["module"])|] [] @@ -3610,41 +3610,41 @@ let ``Test symbol uses of properties with both getters and setters`` () = ("v", "file1", ((25, 18), (25, 19)), []); ("``.cctor``", "file1", ((4, 5), (4, 23)), ["member"]); ("TypeWithProperties", "file1", ((33, 9), (33, 27)), ["member"; "ctor"]); - ("NameGetSet", "file1", ((33, 9), (33, 40)), ["member"; "prop"]); + ("NameGetSet", "file1", ((33, 30), (33, 40)), ["member"; "prop"]); ("v1", "file1", ((33, 4), (33, 6)), ["val"]); ("TypeWithProperties", "file1", ((34, 0), (34, 18)), ["member"; "ctor"]); - ("NameGetSet", "file1", ((34, 0), (34, 31)), ["member"; "prop"]); + ("NameGetSet", "file1", ((34, 21), (34, 31)), ["member"; "prop"]); ("TypeWithProperties", "file1", ((36, 9), (36, 27)), ["member"; "ctor"]); - ("NameGet", "file1", ((36, 9), (36, 37)), ["member"; "prop"]); + ("NameGet", "file1", ((36, 30), (36, 37)), ["member"; "prop"]); ("v2", "file1", ((36, 4), (36, 6)), ["val"]); ("TypeWithProperties", "file1", ((38, 0), (38, 18)), ["member"; "ctor"]); - ("NameSet", "file1", ((38, 0), (38, 28)), ["member"; "prop"]); + ("NameSet", "file1", ((38, 21), (38, 28)), ["member"; "prop"]); ("TypeWithProperties", "file1", ((40, 9), (40, 27)), ["class"]); - ("StaticNameGetSet", "file1", ((40, 9), (40, 44)), ["member"; "prop"]); + ("StaticNameGetSet", "file1", ((40, 28), (40, 44)), ["member"; "prop"]); ("v3", "file1", ((40, 4), (40, 6)), ["val"]); ("TypeWithProperties", "file1", ((41, 0), (41, 18)), ["class"]); - ("StaticNameGetSet", "file1", ((41, 0), (41, 35)), ["member"; "prop"]); + ("StaticNameGetSet", "file1", ((41, 19), (41, 35)), ["member"; "prop"]); ("TypeWithProperties", "file1", ((43, 9), (43, 27)), ["class"]); - ("StaticNameGet", "file1", ((43, 9), (43, 41)), ["member"; "prop"]); + ("StaticNameGet", "file1", ((43, 28), (43, 41)), ["member"; "prop"]); ("v4", "file1", ((43, 4), (43, 6)), ["val"]); ("TypeWithProperties", "file1", ((45, 0), (45, 18)), ["class"]); - ("StaticNameSet", "file1", ((45, 0), (45, 32)), ["member"; "prop"]); + ("StaticNameSet", "file1", ((45, 19), (45, 32)), ["member"; "prop"]); ("TypeWithProperties", "file1", ((47, 9), (47, 27)), ["member"; "ctor"]); - ("AutoPropGet", "file1", ((47, 9), (47, 41)), ["member"; "prop"]); + ("AutoPropGet", "file1", ((47, 30), (47, 41)), ["member"; "prop"]); ("v5", "file1", ((47, 4), (47, 6)), ["val"]); ("TypeWithProperties", "file1", ((49, 9), (49, 27)), ["member"; "ctor"]); - ("AutoPropGetSet", "file1", ((49, 9), (49, 44)), ["member"; "prop"]); + ("AutoPropGetSet", "file1", ((49, 30), (49, 44)), ["member"; "prop"]); ("v6", "file1", ((49, 4), (49, 6)), ["val"]); ("TypeWithProperties", "file1", ((50, 0), (50, 18)), ["member"; "ctor"]); - ("AutoPropGetSet", "file1", ((50, 0), (50, 35)), ["member"; "prop"]); + ("AutoPropGetSet", "file1", ((50, 21), (50, 35)), ["member"; "prop"]); ("TypeWithProperties", "file1", ((52, 9), (52, 27)), ["class"]); - ("StaticAutoPropGet", "file1", ((52, 9), (52, 45)), ["member"; "prop"]); + ("StaticAutoPropGet", "file1", ((52, 28), (52, 45)), ["member"; "prop"]); ("v7", "file1", ((52, 4), (52, 6)), ["val"]); ("TypeWithProperties", "file1", ((54, 9), (54, 27)), ["class"]); - ("StaticAutoPropGetSet", "file1", ((54, 9), (54, 48)), ["member"; "prop"]); + ("StaticAutoPropGetSet", "file1", ((54, 28), (54, 48)), ["member"; "prop"]); ("v8", "file1", ((54, 4), (54, 6)), ["val"]); ("TypeWithProperties", "file1", ((55, 0), (55, 18)), ["class"]); - ("StaticAutoPropGetSet", "file1", ((55, 0), (55, 39)), ["member"; "prop"]); + ("StaticAutoPropGetSet", "file1", ((55, 19), (55, 39)), ["member"; "prop"]); ("PropertyTest", "file1", ((2, 7), (2, 19)), ["module"])|] let getSampleSymbolUseOpt = @@ -3657,7 +3657,7 @@ let ``Test symbol uses of properties with both getters and setters`` () = |> Array.map (fun s -> (Project24.cleanFileName s.FileName, tups s.Range)) - usesOfGetSampleSymbol |> shouldEqual [|("file1", ((9, 13), (9, 20))); ("file1", ((36, 9), (36, 37)))|] + usesOfGetSampleSymbol |> shouldEqual [|("file1", ((9, 13), (9, 20))); ("file1", ((36, 30), (36, 37)))|] #if NO_CHECK_USE_OF_FSHARP_DATA_DLL #endif @@ -3756,7 +3756,7 @@ let ``Test Project25 symbol uses of type-provided members`` () = ("ErasedWithConstructor.Provided.MyType", "file1", ((4, 9), (4, 15)), [ "class"; "provided"; "erased" ]) ("TypeProviderTests.T", "file1", ((4, 5), (4, 6)), [ "abbrev" ]) // line 4: type >T< = MyType ("ErasedWithConstructor.Provided.MyType", "file1", ((5, 8), (5, 9)), [ "member" ]) // line 5: let _ = >T<() (ctor) - ("ErasedWithConstructor.Provided.MyType.DoNothing", "file1", ((5, 8), (5, 21)), [ "member" ]) // line 5: let _ = >T().DoNothing<() + ("ErasedWithConstructor.Provided.MyType.DoNothing", "file1", ((5, 12), (5, 21)), [ "member" ]) // line 5: let _ = T().>DoNothing<() ("Microsoft.FSharp.Core.int", "file1", ((7, 23), (7, 26)), [ "abbrev" ]) // line 7: type Record = { Field: >int< } ("Microsoft.FSharp.Core.int", "file1", ((7, 23), (7, 26)), [ "abbrev" ]) // (repeated) ("TypeProviderTests.Record.Field", "file1", ((7, 16), (7, 21)), [ "field" ]) // line 7: type Record = { >Field<: int } @@ -3765,7 +3765,7 @@ let ``Test Project25 symbol uses of type-provided members`` () = ("TypeProviderTests.Record.Field", "file1", ((8, 17), (8, 22)), [ "field" ]) // line 8: let r = { Record.>Field< = 1 } ("TypeProviderTests.r", "file1", ((8, 4), (8, 5)), [ "val" ]) // line 8: let >r< = ... ("ErasedWithConstructor.Provided.MyType", "file1", ((10, 8), (10, 14)), [ "member" ]) // line 10: let _ = >MyType<() (ctor) - ("ErasedWithConstructor.Provided.MyType.DoNothing", "file1", ((10, 8), (10, 26)), [ "member" ]) // line 10: let _ = >MyType().DoNothing<() + ("ErasedWithConstructor.Provided.MyType.DoNothing", "file1", ((10, 17), (10, 26)), [ "member" ]) // line 10: let _ = MyType().>DoNothing<() ("TypeProviderTests", "file1", ((2, 7), (2, 24)), [ "module" ]) |] // line 2: module >TypeProviderTests< printfn "actual =\n%A" allUses @@ -3785,8 +3785,8 @@ let ``Test Project25 symbol uses of type-provided members`` () = usesOfDoNothing |> shouldEqual - [| ("file1", ((5, 8), (5, 21))) // line 5: T().DoNothing - ("file1", ((10, 8), (10, 26))) |] // line 10: MyType().DoNothing + [| ("file1", ((5, 12), (5, 21))) // line 5: T().DoNothing + ("file1", ((10, 17), (10, 26))) |] // line 10: MyType().DoNothing [] let ``Test Project25 symbol uses of type-provided types`` () = @@ -5065,9 +5065,9 @@ let ``Test project39 all symbols`` () = ("params", [["'a"]; ["'a0"]; ["'a"; "'a0"]]), ("return", "'b")); - ("MemberWithIncompleteSignature", ((18, 3), (18, 36)), + ("MemberWithIncompleteSignature", ((18, 7), (18, 36)), ("full", "'c -> 'd"), ("params", [["'c"]]), ("return", "'d")); - ("CurriedMemberWithIncompleteSignature", ((19, 3), (19, 43)), + ("CurriedMemberWithIncompleteSignature", ((19, 7), (19, 43)), ("full", "'a -> 'a0 -> 'a * 'a0 -> 'b"), ("params", [["'a"]; ["'a0"]; ["'a"; "'a0"]]), @@ -5112,14 +5112,14 @@ let ``Test Project40 all symbols`` () = allSymbolUsesInfo |> shouldEqual [("option", ((4, 10), (4, 16)), ["abbrev"]); ("x", ((4, 7), (4, 8)), []); ("x", ((4, 23), (4, 24)), []); - ("IsSome", ((4, 23), (4, 31)), ["member"; "prop"; "funky"]); + ("IsSome", ((4, 25), (4, 31)), ["member"; "prop"; "funky"]); ("x", ((4, 33), (4, 34)), []); - ("IsNone", ((4, 33), (4, 41)), ["member"; "prop"; "funky"]); + ("IsNone", ((4, 35), (4, 41)), ["member"; "prop"; "funky"]); ("f", ((4, 4), (4, 5)), ["val"]); ("CompilationRepresentationAttribute", ((6, 2), (6, 27)), ["class"]); ("CompilationRepresentationAttribute", ((6, 2), (6, 27)), ["member"]); ("CompilationRepresentationFlags", ((6, 28), (6, 58)), ["enum"; "valuetype"]); - ("UseNullAsTrueValue", ((6, 28), (6, 77)), ["field"; "static"; "8"]); + ("UseNullAsTrueValue", ((6, 59), (6, 77)), ["field"; "static"; "8"]); ("string", ((9, 11), (9, 17)), ["abbrev"]); ("string", ((9, 11), (9, 17)), ["abbrev"]); ("A", ((8, 6), (8, 7)), []); ("B", ((9, 6), (9, 7)), []); ("C", ((7, 5), (7, 6)), ["union"]); @@ -5131,9 +5131,9 @@ let ``Test Project40 all symbols`` () = ("A", ((11, 44), (11, 45)), []); ("B", ((11, 56), (11, 57)), []); ("C", ((13, 10), (13, 11)), ["union"]); ("x", ((13, 7), (13, 8)), []); ("x", ((13, 15), (13, 16)), []); - ("IsItAnA", ((13, 15), (13, 24)), ["member"; "prop"; "funky"]); + ("IsItAnA", ((13, 17), (13, 24)), ["member"; "prop"; "funky"]); ("x", ((13, 25), (13, 26)), []); - ("IsItAnAMethod", ((13, 25), (13, 40)), ["member"; "funky"]); + ("IsItAnAMethod", ((13, 27), (13, 40)), ["member"; "funky"]); ("g", ((13, 4), (13, 5)), ["val"]); ("M", ((2, 7), (2, 8)), ["module"])] //-------------------------------------------- @@ -5206,13 +5206,13 @@ let ``Test project41 all symbols`` () = ["field"; "anon(0, [//<>f__AnonymousType1416859829`1]X)"], (12, 19)); ("v", ((12, 12), (12, 13)), [], (12, 12)); ("v", ((12, 33), (12, 34)), [], (12, 12)); - ("X", ((12, 33), (12, 36)), + ("X", ((12, 35), (12, 36)), ["field"; "anon(0, [//<>f__AnonymousType1416859829`1]X)"], (12, 19)); ("f1", ((12, 8), (12, 10)), ["val"], (12, 8)); ("D", ((15, 16), (15, 17)), ["abbrev"], (9, 9)); ("v", ((15, 12), (15, 13)), [], (15, 12)); ("v", ((15, 21), (15, 22)), [], (15, 12)); - ("X", ((15, 21), (15, 24)), + ("X", ((15, 23), (15, 24)), ["field"; "anon(0, [//<>f__AnonymousType1416859829`1]X)"], (9, 16)); ("f2", ((15, 8), (15, 10)), ["val"], (15, 8)); ("int", ((18, 29), (18, 32)), ["abbrev"], (0, 0)); @@ -5227,7 +5227,7 @@ let ``Test project41 all symbols`` () = ("v", ((18, 54), (18, 55)), [], (18, 12)); ("X", ((18, 56), (18, 57)), ["field"; "anon(0, [//<>f__AnonymousType1416859829`1]X)"], (18, 19)); - ("X", ((18, 54), (18, 59)), + ("X", ((18, 58), (18, 59)), ["field"; "anon(0, [//<>f__AnonymousType4026451324`2]X,Y)"], (18, 25)); ("f3", ((18, 8), (18, 10)), ["val"], (18, 8)); ("Foo", ((20, 10), (20, 13)), ["apatcase0"], (20, 10)); diff --git a/tests/FSharp.Compiler.Service.Tests/Symbols.fs b/tests/FSharp.Compiler.Service.Tests/Symbols.fs index 69bfb70519a..4ffc2a34440 100644 --- a/tests/FSharp.Compiler.Service.Tests/Symbols.fs +++ b/tests/FSharp.Compiler.Service.Tests/Symbols.fs @@ -1203,10 +1203,10 @@ let d = System.Object.Builder { return 3 } (19, 28), false // A.Builder { return 3 } - (21, 8), false + (21, 10), false // System.Object.Builder { return 3 } - (22, 8), false + (22, 22), false ] [ for symbolUse in checkResults.GetAllUsesOfAllSymbolsInFile() |> Seq.sortBy (fun x -> x.Range.StartLine, x.Range.StartColumn) do diff --git a/tests/FSharp.Compiler.Service.Tests/TypeChecker/TypeCheckerRecoveryTests.fs b/tests/FSharp.Compiler.Service.Tests/TypeChecker/TypeCheckerRecoveryTests.fs index 3f9d13622e6..062ccbeb307 100644 --- a/tests/FSharp.Compiler.Service.Tests/TypeChecker/TypeCheckerRecoveryTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/TypeChecker/TypeCheckerRecoveryTests.fs @@ -39,7 +39,7 @@ Math.Max(a,) dumpDiagnosticNumbers checkResults |> shouldEqual [ "(4,10--4,11)", 3100 "(4,9--4,10)", 39 - "(4,0--4,12)", 41 + "(4,5--4,8)", 41 ] assertHasSymbolUsages ["Max"] checkResults diff --git a/tests/fsharp/Compiler/Language/TypeDirectedConversionTests.fs b/tests/fsharp/Compiler/Language/TypeDirectedConversionTests.fs index 37c8596d3e5..1200b79fcd2 100644 --- a/tests/fsharp/Compiler/Language/TypeDirectedConversionTests.fs +++ b/tests/fsharp/Compiler/Language/TypeDirectedConversionTests.fs @@ -329,7 +329,7 @@ let test2(x: 'T) = [| (FSharpDiagnosticSeverity.Error, 41, - (11, 5, 11, 11), + (11, 7, 11, 8), """A unique overload for method 'A' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: 'T @@ -341,7 +341,7 @@ Candidates: - static member M.A: n: int -> unit""") (FSharpDiagnosticSeverity.Error, 41, - (19, 5, 19, 12), + (19, 8, 19, 9), """A unique overload for method 'A' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: 'T @@ -368,7 +368,7 @@ let test(x: 'T) = """ FSharpDiagnosticSeverity.Error 41 - (10, 5, 10, 11) + (10, 7, 10, 8) """A unique overload for method 'A' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: 'T @@ -495,7 +495,7 @@ let test() = M.A(System.DateTime.UtcNow, 1) """ FSharpDiagnosticSeverity.Error 41 - (6, 14, 6, 44) + (6, 16, 6, 17) """A unique overload for method 'A' could not be determined based on type information prior to this program point. A type annotation may be needed. Known types of arguments: System.DateTime * int diff --git a/tests/fsharp/conformance/expressions/syntacticsugar/E_Slices01.bsl b/tests/fsharp/conformance/expressions/syntacticsugar/E_Slices01.bsl index 6cb4c4dde0b..ca02e74d09b 100644 --- a/tests/fsharp/conformance/expressions/syntacticsugar/E_Slices01.bsl +++ b/tests/fsharp/conformance/expressions/syntacticsugar/E_Slices01.bsl @@ -1,5 +1,5 @@ -E_Slices01.fsx(15,9,15,19): typecheck error FS0041: A unique overload for method 'GetSlice' could not be determined based on type information prior to this program point. A type annotation may be needed. +E_Slices01.fsx(15,11,15,19): typecheck error FS0041: A unique overload for method 'GetSlice' could not be determined based on type information prior to this program point. A type annotation may be needed. Known types of arguments: int * int option * 'a option @@ -15,7 +15,7 @@ Candidates: - member Foo.GetSlice: x: int * y1: int option * y2: float option -> unit - member Foo.GetSlice: x: int * y1: int option * y2: int option -> unit -E_Slices01.fsx(17,9,17,19): typecheck error FS0041: A unique overload for method 'GetSlice' could not be determined based on type information prior to this program point. A type annotation may be needed. +E_Slices01.fsx(17,11,17,19): typecheck error FS0041: A unique overload for method 'GetSlice' could not be determined based on type information prior to this program point. A type annotation may be needed. Known types of arguments: 'a option * int option * int diff --git a/tests/fsharp/conformance/expressions/type-relatedexpressions/E_RigidTypeAnnotation03.bsl b/tests/fsharp/conformance/expressions/type-relatedexpressions/E_RigidTypeAnnotation03.bsl index 974190e66a3..d66e4829247 100644 --- a/tests/fsharp/conformance/expressions/type-relatedexpressions/E_RigidTypeAnnotation03.bsl +++ b/tests/fsharp/conformance/expressions/type-relatedexpressions/E_RigidTypeAnnotation03.bsl @@ -4,7 +4,7 @@ E_RigidTypeAnnotation03.fsx(17,13,17,16): typecheck error FS0001: This expressio but here has type 'byte' -E_RigidTypeAnnotation03.fsx(17,9,17,25): typecheck error FS0041: No overloads match for method 'M'. +E_RigidTypeAnnotation03.fsx(17,11,17,12): typecheck error FS0041: No overloads match for method 'M'. Known type of argument: sbyte @@ -20,7 +20,7 @@ E_RigidTypeAnnotation03.fsx(18,13,18,19): typecheck error FS0001: This expressio but here has type 'float<'u>' -E_RigidTypeAnnotation03.fsx(18,9,18,30): typecheck error FS0041: No overloads match for method 'M'. +E_RigidTypeAnnotation03.fsx(18,11,18,12): typecheck error FS0041: No overloads match for method 'M'. Known type of argument: float32 @@ -42,7 +42,7 @@ but given a 'decimal' The unit of measure 'N s ^ 2' does not match the unit of measure 'Kg' -E_RigidTypeAnnotation03.fsx(20,9,20,39): typecheck error FS0041: No overloads match for method 'M'. +E_RigidTypeAnnotation03.fsx(20,11,20,12): typecheck error FS0041: No overloads match for method 'M'. Known type of argument: decimal @@ -58,7 +58,7 @@ E_RigidTypeAnnotation03.fsx(21,14,21,18): typecheck error FS0001: This expressio but here has type 'string' -E_RigidTypeAnnotation03.fsx(21,9,21,27): typecheck error FS0041: No overloads match for method 'M'. +E_RigidTypeAnnotation03.fsx(21,11,21,12): typecheck error FS0041: No overloads match for method 'M'. Known type of argument: char diff --git a/tests/fsharp/conformance/inference/E_LeftToRightOverloadResolution01.bsl b/tests/fsharp/conformance/inference/E_LeftToRightOverloadResolution01.bsl index 8d60e94af11..bd02bbc2d1f 100644 --- a/tests/fsharp/conformance/inference/E_LeftToRightOverloadResolution01.bsl +++ b/tests/fsharp/conformance/inference/E_LeftToRightOverloadResolution01.bsl @@ -1,5 +1,5 @@ -E_LeftToRightOverloadResolution01.fsx(7,23,7,51): typecheck error FS0041: A unique overload for method 'WriteLine' could not be determined based on type information prior to this program point. A type annotation may be needed. +E_LeftToRightOverloadResolution01.fsx(7,38,7,47): typecheck error FS0041: A unique overload for method 'WriteLine' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: 'a @@ -18,7 +18,7 @@ Candidates: - System.Console.WriteLine(value: uint32) : unit - System.Console.WriteLine(value: uint64) : unit -E_LeftToRightOverloadResolution01.fsx(9,23,9,51): typecheck error FS0041: A unique overload for method 'WriteLine' could not be determined based on type information prior to this program point. A type annotation may be needed. +E_LeftToRightOverloadResolution01.fsx(9,38,9,47): typecheck error FS0041: A unique overload for method 'WriteLine' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: 'a diff --git a/tests/fsharp/conformance/inference/E_OneTypeVariable03.bsl b/tests/fsharp/conformance/inference/E_OneTypeVariable03.bsl index e46f1757896..8b9f6640f19 100644 --- a/tests/fsharp/conformance/inference/E_OneTypeVariable03.bsl +++ b/tests/fsharp/conformance/inference/E_OneTypeVariable03.bsl @@ -1,5 +1,5 @@ -E_OneTypeVariable03.fsx(60,34,60,44): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. +E_OneTypeVariable03.fsx(60,38,60,39): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. Known types of arguments: 'a * int @@ -7,7 +7,7 @@ Candidates: - static member C23.M: x: 'a * y: 'b -> Two - static member C23.M: x: 'a * y: int -> Three -E_OneTypeVariable03.fsx(61,34,61,45): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. +E_OneTypeVariable03.fsx(61,39,61,40): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. Known types of arguments: 'a * int diff --git a/tests/fsharp/conformance/inference/E_OneTypeVariable03rec.bsl b/tests/fsharp/conformance/inference/E_OneTypeVariable03rec.bsl index 3da07112f80..3151e03e1e0 100644 --- a/tests/fsharp/conformance/inference/E_OneTypeVariable03rec.bsl +++ b/tests/fsharp/conformance/inference/E_OneTypeVariable03rec.bsl @@ -1,5 +1,5 @@ -E_OneTypeVariable03rec.fsx(60,38,60,48): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. +E_OneTypeVariable03rec.fsx(60,42,60,43): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. Known types of arguments: 'a * int @@ -7,7 +7,7 @@ Candidates: - static member C23.M: x: 'a * y: 'b -> Two - static member C23.M: x: 'a * y: int -> Three -E_OneTypeVariable03rec.fsx(61,38,61,49): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. +E_OneTypeVariable03rec.fsx(61,43,61,44): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. Known types of arguments: 'a * int diff --git a/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariables01.bsl b/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariables01.bsl index bef5539b00a..10104a9f79f 100644 --- a/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariables01.bsl +++ b/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariables01.bsl @@ -1,5 +1,5 @@ -E_TwoDifferentTypeVariables01.fsx(61,33,61,43): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. +E_TwoDifferentTypeVariables01.fsx(61,37,61,38): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. Known types of arguments: 'a * 'b @@ -7,7 +7,7 @@ Candidates: - static member C13.M: x: 'a * y: 'a -> One - static member C13.M: x: 'a * y: int -> Three -E_TwoDifferentTypeVariables01.fsx(62,33,62,43): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. +E_TwoDifferentTypeVariables01.fsx(62,37,62,38): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. Known types of arguments: 'a * 'b @@ -15,7 +15,7 @@ Candidates: - static member C24.M: x: 'a * y: 'b -> Two - static member C24.M: x: 'a * y: C -> Four -E_TwoDifferentTypeVariables01.fsx(63,33,63,47): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. +E_TwoDifferentTypeVariables01.fsx(63,37,63,38): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. Known types of arguments: 'a * 'b @@ -23,7 +23,7 @@ Candidates: - static member C13.M: x: 'a * y: 'a -> One - static member C13.M: x: 'a * y: int -> Three -E_TwoDifferentTypeVariables01.fsx(64,33,64,46): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. +E_TwoDifferentTypeVariables01.fsx(64,37,64,38): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. Known types of arguments: 'a * 'b diff --git a/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariables01rec.bsl b/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariables01rec.bsl index c00efb90a64..290833eef43 100644 --- a/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariables01rec.bsl +++ b/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariables01rec.bsl @@ -1,5 +1,5 @@ -E_TwoDifferentTypeVariables01rec.fsx(60,37,60,47): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. +E_TwoDifferentTypeVariables01rec.fsx(60,41,60,42): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. Known types of arguments: 'a * 'b @@ -7,7 +7,7 @@ Candidates: - static member C13.M: x: 'a * y: 'a -> One - static member C13.M: x: 'a * y: int -> Three -E_TwoDifferentTypeVariables01rec.fsx(61,37,61,47): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. +E_TwoDifferentTypeVariables01rec.fsx(61,41,61,42): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. Known types of arguments: 'a * 'b @@ -15,7 +15,7 @@ Candidates: - static member C24.M: x: 'a * y: 'b -> Two - static member C24.M: x: 'a * y: C -> Four -E_TwoDifferentTypeVariables01rec.fsx(62,37,62,51): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. +E_TwoDifferentTypeVariables01rec.fsx(62,41,62,42): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. Known types of arguments: 'a * 'b @@ -23,7 +23,7 @@ Candidates: - static member C13.M: x: 'a * y: 'a -> One - static member C13.M: x: 'a * y: int -> Three -E_TwoDifferentTypeVariables01rec.fsx(63,37,63,50): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. +E_TwoDifferentTypeVariables01rec.fsx(63,41,63,42): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. Known types of arguments: 'a * 'b diff --git a/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariablesGen00.bsl b/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariablesGen00.bsl index 9d9d4a60369..9795de8e8a4 100644 --- a/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariablesGen00.bsl +++ b/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariablesGen00.bsl @@ -9,7 +9,7 @@ E_TwoDifferentTypeVariablesGen00.fsx(62,52,62,53): typecheck error FS0064: This E_TwoDifferentTypeVariablesGen00.fsx(62,18,62,21): typecheck error FS0043: The type ''b' does not match the type 'int' -E_TwoDifferentTypeVariablesGen00.fsx(63,45,63,55): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. +E_TwoDifferentTypeVariablesGen00.fsx(63,49,63,50): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. Known types of arguments: 'a * 'b @@ -29,7 +29,7 @@ E_TwoDifferentTypeVariablesGen00.fsx(65,56,65,57): typecheck error FS0064: This E_TwoDifferentTypeVariablesGen00.fsx(65,18,65,21): typecheck error FS0043: The type ''a' does not match the type 'int' -E_TwoDifferentTypeVariablesGen00.fsx(66,45,66,59): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. +E_TwoDifferentTypeVariablesGen00.fsx(66,49,66,50): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. Known types of arguments: 'a * 'b @@ -43,7 +43,7 @@ E_TwoDifferentTypeVariablesGen00.fsx(67,18,67,21): typecheck error FS0064: This E_TwoDifferentTypeVariablesGen00.fsx(67,18,67,21): typecheck error FS0043: The type ''b' does not match the type ''b0' -E_TwoDifferentTypeVariablesGen00.fsx(68,45,68,58): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. +E_TwoDifferentTypeVariablesGen00.fsx(68,49,68,50): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. Known types of arguments: 'a * 'b diff --git a/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariablesGen00rec.bsl b/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariablesGen00rec.bsl index 99d338ef47a..ea33553fa7e 100644 --- a/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariablesGen00rec.bsl +++ b/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariablesGen00rec.bsl @@ -9,7 +9,7 @@ E_TwoDifferentTypeVariablesGen00rec.fsx(62,52,62,53): typecheck error FS0064: Th E_TwoDifferentTypeVariablesGen00rec.fsx(62,18,62,21): typecheck error FS0043: The type ''b' does not match the type 'int' -E_TwoDifferentTypeVariablesGen00rec.fsx(63,45,63,55): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. +E_TwoDifferentTypeVariablesGen00rec.fsx(63,49,63,50): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. Known types of arguments: 'a * 'b @@ -29,7 +29,7 @@ E_TwoDifferentTypeVariablesGen00rec.fsx(65,56,65,57): typecheck error FS0064: Th E_TwoDifferentTypeVariablesGen00rec.fsx(65,18,65,21): typecheck error FS0043: The type ''a' does not match the type 'int' -E_TwoDifferentTypeVariablesGen00rec.fsx(66,45,66,59): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. +E_TwoDifferentTypeVariablesGen00rec.fsx(66,49,66,50): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. Known types of arguments: 'a * 'b @@ -43,7 +43,7 @@ E_TwoDifferentTypeVariablesGen00rec.fsx(67,18,67,21): typecheck error FS0064: Th E_TwoDifferentTypeVariablesGen00rec.fsx(67,18,67,21): typecheck error FS0043: The type ''b' does not match the type ''b0' -E_TwoDifferentTypeVariablesGen00rec.fsx(68,45,68,58): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. +E_TwoDifferentTypeVariablesGen00rec.fsx(68,49,68,50): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. Known types of arguments: 'a * 'b diff --git a/tests/fsharp/conformance/inference/E_TwoEqualTypeVariables02.bsl b/tests/fsharp/conformance/inference/E_TwoEqualTypeVariables02.bsl index d9df255dd5a..be71d64c0e3 100644 --- a/tests/fsharp/conformance/inference/E_TwoEqualTypeVariables02.bsl +++ b/tests/fsharp/conformance/inference/E_TwoEqualTypeVariables02.bsl @@ -1,5 +1,5 @@ -E_TwoEqualTypeVariables02.fsx(61,33,61,43): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. +E_TwoEqualTypeVariables02.fsx(61,37,61,38): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. Known types of arguments: 'a * 'a @@ -7,7 +7,7 @@ Candidates: - static member C12.M: x: 'a * y: 'a -> One - static member C12.M: x: 'a * y: 'b -> Two -E_TwoEqualTypeVariables02.fsx(62,33,62,43): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. +E_TwoEqualTypeVariables02.fsx(62,37,62,38): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. Known types of arguments: 'a * 'a @@ -15,7 +15,7 @@ Candidates: - static member C14.M: x: 'a * y: 'a -> One - static member C14.M: x: 'a * y: C -> Four -E_TwoEqualTypeVariables02.fsx(63,33,63,43): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. +E_TwoEqualTypeVariables02.fsx(63,37,63,38): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. Known types of arguments: 'a * 'a @@ -23,7 +23,7 @@ Candidates: - static member C24.M: x: 'a * y: 'b -> Two - static member C24.M: x: 'a * y: C -> Four -E_TwoEqualTypeVariables02.fsx(64,33,64,44): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. +E_TwoEqualTypeVariables02.fsx(64,38,64,39): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. Known types of arguments: 'a * 'a @@ -32,7 +32,7 @@ Candidates: - static member C123.M: x: 'a * y: 'b -> Two - static member C123.M: x: 'a * y: int -> Three -E_TwoEqualTypeVariables02.fsx(65,33,65,45): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. +E_TwoEqualTypeVariables02.fsx(65,39,65,40): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. Known types of arguments: 'a * 'a @@ -42,7 +42,7 @@ Candidates: - static member C1234.M: x: 'a * y: C -> Four - static member C1234.M: x: 'a * y: int -> Three -E_TwoEqualTypeVariables02.fsx(66,33,66,46): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. +E_TwoEqualTypeVariables02.fsx(66,37,66,38): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. Known types of arguments: 'a * 'a diff --git a/tests/fsharp/conformance/inference/E_TwoEqualTypeVariables02rec.bsl b/tests/fsharp/conformance/inference/E_TwoEqualTypeVariables02rec.bsl index 9380c2906a8..e1caf5a7791 100644 --- a/tests/fsharp/conformance/inference/E_TwoEqualTypeVariables02rec.bsl +++ b/tests/fsharp/conformance/inference/E_TwoEqualTypeVariables02rec.bsl @@ -1,5 +1,5 @@ -E_TwoEqualTypeVariables02rec.fsx(60,37,60,47): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. +E_TwoEqualTypeVariables02rec.fsx(60,41,60,42): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. Known types of arguments: 'a * 'a @@ -7,7 +7,7 @@ Candidates: - static member C12.M: x: 'a * y: 'a -> One - static member C12.M: x: 'a * y: 'b -> Two -E_TwoEqualTypeVariables02rec.fsx(61,37,61,47): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. +E_TwoEqualTypeVariables02rec.fsx(61,41,61,42): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. Known types of arguments: 'a * 'a @@ -15,7 +15,7 @@ Candidates: - static member C14.M: x: 'a * y: 'a -> One - static member C14.M: x: 'a * y: C -> Four -E_TwoEqualTypeVariables02rec.fsx(62,37,62,47): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. +E_TwoEqualTypeVariables02rec.fsx(62,41,62,42): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. Known types of arguments: 'a * 'a @@ -23,7 +23,7 @@ Candidates: - static member C24.M: x: 'a * y: 'b -> Two - static member C24.M: x: 'a * y: C -> Four -E_TwoEqualTypeVariables02rec.fsx(63,37,63,48): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. +E_TwoEqualTypeVariables02rec.fsx(63,42,63,43): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. Known types of arguments: 'a * 'a @@ -32,7 +32,7 @@ Candidates: - static member C123.M: x: 'a * y: 'b -> Two - static member C123.M: x: 'a * y: int -> Three -E_TwoEqualTypeVariables02rec.fsx(64,37,64,49): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. +E_TwoEqualTypeVariables02rec.fsx(64,43,64,44): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. Known types of arguments: 'a * 'a @@ -42,7 +42,7 @@ Candidates: - static member C1234.M: x: 'a * y: C -> Four - static member C1234.M: x: 'a * y: int -> Three -E_TwoEqualTypeVariables02rec.fsx(65,37,65,50): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. +E_TwoEqualTypeVariables02rec.fsx(65,41,65,42): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. Known types of arguments: 'a * 'a diff --git a/tests/fsharp/conformance/lexicalanalysis/E_LessThanDotOpenParen001.bsl b/tests/fsharp/conformance/lexicalanalysis/E_LessThanDotOpenParen001.bsl index 07d69bc5277..0b076cf0e3a 100644 --- a/tests/fsharp/conformance/lexicalanalysis/E_LessThanDotOpenParen001.bsl +++ b/tests/fsharp/conformance/lexicalanalysis/E_LessThanDotOpenParen001.bsl @@ -11,7 +11,7 @@ Available overloads: - static member TestType.(+++) : a: TestType<'T,'S> * b: ('T -> 'S) -> 'T // Argument 'a' doesn't match - static member TestType.(+++) : a: TestType<'T,'S> * b: TestType<'T,'S> -> 'T // Argument 'a' doesn't match -E_LessThanDotOpenParen001.fsx(25,10,25,45): typecheck error FS0041: No overloads match for method 'op_PlusPlusPlus'. +E_LessThanDotOpenParen001.fsx(25,22,25,37): typecheck error FS0041: No overloads match for method 'op_PlusPlusPlus'. Known types of arguments: (string -> int) * TestType @@ -21,7 +21,7 @@ Available overloads: - static member TestType.(+++) : a: TestType<'T,'S> * b: ('T -> 'S) -> 'T // Argument 'a' doesn't match - static member TestType.(+++) : a: TestType<'T,'S> * b: TestType<'T,'S> -> 'T // Argument 'a' doesn't match -E_LessThanDotOpenParen001.fsx(26,10,26,68): typecheck error FS0041: No overloads match for method 'op_PlusPlusPlus'. +E_LessThanDotOpenParen001.fsx(26,22,26,37): typecheck error FS0041: No overloads match for method 'op_PlusPlusPlus'. Known types of arguments: (string -> int) * TestType diff --git a/tests/fsharp/conformance/wellformedness/E_Clashing_Values_in_AbstractClass01.bsl b/tests/fsharp/conformance/wellformedness/E_Clashing_Values_in_AbstractClass01.bsl index d19330fa22b..d91fe957a84 100644 --- a/tests/fsharp/conformance/wellformedness/E_Clashing_Values_in_AbstractClass01.bsl +++ b/tests/fsharp/conformance/wellformedness/E_Clashing_Values_in_AbstractClass01.bsl @@ -1,5 +1,5 @@ -E_Clashing_Values_in_AbstractClass01.fsx(22,11,22,16): typecheck error FS0041: A unique overload for method 'X' could not be determined based on type information prior to this program point. A type annotation may be needed. +E_Clashing_Values_in_AbstractClass01.fsx(22,13,22,14): typecheck error FS0041: A unique overload for method 'X' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: - member Q.X: unit -> decimal - member Q.X: unit -> float diff --git a/tests/fsharp/conformance/wellformedness/E_Clashing_Values_in_AbstractClass03.bsl b/tests/fsharp/conformance/wellformedness/E_Clashing_Values_in_AbstractClass03.bsl index 756341cd472..db26a73d948 100644 --- a/tests/fsharp/conformance/wellformedness/E_Clashing_Values_in_AbstractClass03.bsl +++ b/tests/fsharp/conformance/wellformedness/E_Clashing_Values_in_AbstractClass03.bsl @@ -1,5 +1,5 @@ -E_Clashing_Values_in_AbstractClass03.fsx(16,18,16,25): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. +E_Clashing_Values_in_AbstractClass03.fsx(16,21,16,22): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: int @@ -7,7 +7,7 @@ Candidates: - abstract D.M: 'T -> int - abstract D.M: 'U -> string -E_Clashing_Values_in_AbstractClass03.fsx(17,18,17,25): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. +E_Clashing_Values_in_AbstractClass03.fsx(17,21,17,22): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: int diff --git a/tests/fsharp/conformance/wellformedness/E_Clashing_Values_in_AbstractClass04.bsl b/tests/fsharp/conformance/wellformedness/E_Clashing_Values_in_AbstractClass04.bsl index 89195ec2cc3..5c6906bf787 100644 --- a/tests/fsharp/conformance/wellformedness/E_Clashing_Values_in_AbstractClass04.bsl +++ b/tests/fsharp/conformance/wellformedness/E_Clashing_Values_in_AbstractClass04.bsl @@ -1,5 +1,5 @@ -E_Clashing_Values_in_AbstractClass04.fsx(16,18,16,25): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. +E_Clashing_Values_in_AbstractClass04.fsx(16,21,16,22): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: int @@ -7,7 +7,7 @@ Candidates: - abstract D.M: 'T -> int - abstract D.M: 'U -> string -E_Clashing_Values_in_AbstractClass04.fsx(17,18,17,25): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. +E_Clashing_Values_in_AbstractClass04.fsx(17,21,17,22): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: int diff --git a/tests/fsharp/core/fsfromfsviacs/compilation.errors.output.bsl b/tests/fsharp/core/fsfromfsviacs/compilation.errors.output.bsl index 4c76cf6f127..14c9a504c56 100644 --- a/tests/fsharp/core/fsfromfsviacs/compilation.errors.output.bsl +++ b/tests/fsharp/core/fsfromfsviacs/compilation.errors.output.bsl @@ -1,10 +1,10 @@ -test.fsx(216,34): error FS0041: A unique overload for method 'OverloadedMethodTakingOptionals' could not be determined based on type information prior to this program point. A type annotation may be needed. +test.fsx(216,44): error FS0041: A unique overload for method 'OverloadedMethodTakingOptionals' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: - SomeClass.OverloadedMethodTakingOptionals(?x: int, ?y: string, ?d: float) : int - SomeClass.OverloadedMethodTakingOptionals(?x: int, ?y: string, ?d: float32) : int -test.fsx(217,34): error FS0041: A unique overload for method 'OverloadedMethodTakingOptionals' could not be determined based on type information prior to this program point. A type annotation may be needed. +test.fsx(217,44): error FS0041: A unique overload for method 'OverloadedMethodTakingOptionals' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: x: int @@ -12,7 +12,7 @@ Candidates: - SomeClass.OverloadedMethodTakingOptionals(?x: int, ?y: string, ?d: float) : int - SomeClass.OverloadedMethodTakingOptionals(?x: int, ?y: string, ?d: float32) : int -test.fsx(218,34): error FS0041: A unique overload for method 'OverloadedMethodTakingOptionals' could not be determined based on type information prior to this program point. A type annotation may be needed. +test.fsx(218,44): error FS0041: A unique overload for method 'OverloadedMethodTakingOptionals' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: y: string @@ -20,7 +20,7 @@ Candidates: - SomeClass.OverloadedMethodTakingOptionals(?x: int, ?y: string, ?d: float) : int - SomeClass.OverloadedMethodTakingOptionals(?x: int, ?y: string, ?d: float32) : int -test.fsx(219,34): error FS0041: A unique overload for method 'OverloadedMethodTakingOptionals' could not be determined based on type information prior to this program point. A type annotation may be needed. +test.fsx(219,44): error FS0041: A unique overload for method 'OverloadedMethodTakingOptionals' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: x: int option @@ -28,7 +28,7 @@ Candidates: - SomeClass.OverloadedMethodTakingOptionals(?x: int, ?y: string, ?d: float) : int - SomeClass.OverloadedMethodTakingOptionals(?x: int, ?y: string, ?d: float32) : int -test.fsx(220,34): error FS0041: A unique overload for method 'OverloadedMethodTakingOptionals' could not be determined based on type information prior to this program point. A type annotation may be needed. +test.fsx(220,44): error FS0041: A unique overload for method 'OverloadedMethodTakingOptionals' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: y: string option @@ -36,7 +36,7 @@ Candidates: - SomeClass.OverloadedMethodTakingOptionals(?x: int, ?y: string, ?d: float) : int - SomeClass.OverloadedMethodTakingOptionals(?x: int, ?y: string, ?d: float32) : int -test.fsx(221,34): error FS0041: A unique overload for method 'OverloadedMethodTakingOptionals' could not be determined based on type information prior to this program point. A type annotation may be needed. +test.fsx(221,44): error FS0041: A unique overload for method 'OverloadedMethodTakingOptionals' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: x: 'a option @@ -44,7 +44,7 @@ Candidates: - SomeClass.OverloadedMethodTakingOptionals(?x: int, ?y: string, ?d: float) : int - SomeClass.OverloadedMethodTakingOptionals(?x: int, ?y: string, ?d: float32) : int -test.fsx(222,34): error FS0041: A unique overload for method 'OverloadedMethodTakingOptionals' could not be determined based on type information prior to this program point. A type annotation may be needed. +test.fsx(222,44): error FS0041: A unique overload for method 'OverloadedMethodTakingOptionals' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: y: 'a option @@ -52,7 +52,7 @@ Candidates: - SomeClass.OverloadedMethodTakingOptionals(?x: int, ?y: string, ?d: float) : int - SomeClass.OverloadedMethodTakingOptionals(?x: int, ?y: string, ?d: float32) : int -test.fsx(223,34): error FS0041: A unique overload for method 'OverloadedMethodTakingOptionals' could not be determined based on type information prior to this program point. A type annotation may be needed. +test.fsx(223,44): error FS0041: A unique overload for method 'OverloadedMethodTakingOptionals' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: d: 'a option @@ -60,7 +60,7 @@ Candidates: - SomeClass.OverloadedMethodTakingOptionals(?x: int, ?y: string, ?d: float) : int - SomeClass.OverloadedMethodTakingOptionals(?x: int, ?y: string, ?d: float32) : int -test.fsx(226,42): error FS0041: A unique overload for method 'OverloadedMethodTakingOptionals' could not be determined based on type information prior to this program point. A type annotation may be needed. +test.fsx(226,52): error FS0041: A unique overload for method 'OverloadedMethodTakingOptionals' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: 'a0 @@ -68,12 +68,12 @@ Candidates: - SomeClass.OverloadedMethodTakingOptionals(?x: int, ?y: string, ?d: float) : int - SomeClass.OverloadedMethodTakingOptionals(?x: int, ?y: string, ?d: float32) : int -test.fsx(228,35): error FS0041: A unique overload for method 'OverloadedMethodTakingNullableOptionalsWithDefaults' could not be determined based on type information prior to this program point. A type annotation may be needed. +test.fsx(228,45): error FS0041: A unique overload for method 'OverloadedMethodTakingNullableOptionalsWithDefaults' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: - SomeClass.OverloadedMethodTakingNullableOptionalsWithDefaults(?x: Nullable, ?y: string, ?d: Nullable) : int - SomeClass.OverloadedMethodTakingNullableOptionalsWithDefaults(?x: Nullable, ?y: string, ?d: Nullable) : int -test.fsx(229,35): error FS0041: A unique overload for method 'OverloadedMethodTakingNullableOptionalsWithDefaults' could not be determined based on type information prior to this program point. A type annotation may be needed. +test.fsx(229,45): error FS0041: A unique overload for method 'OverloadedMethodTakingNullableOptionalsWithDefaults' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: y: string @@ -81,7 +81,7 @@ Candidates: - SomeClass.OverloadedMethodTakingNullableOptionalsWithDefaults(?x: Nullable, ?y: string, ?d: Nullable) : int - SomeClass.OverloadedMethodTakingNullableOptionalsWithDefaults(?x: Nullable, ?y: string, ?d: Nullable) : int -test.fsx(230,35): error FS0041: A unique overload for method 'OverloadedMethodTakingNullableOptionalsWithDefaults' could not be determined based on type information prior to this program point. A type annotation may be needed. +test.fsx(230,45): error FS0041: A unique overload for method 'OverloadedMethodTakingNullableOptionalsWithDefaults' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: d: Nullable @@ -89,7 +89,7 @@ Candidates: - SomeClass.OverloadedMethodTakingNullableOptionalsWithDefaults(?x: Nullable, ?y: string, ?d: Nullable) : int - SomeClass.OverloadedMethodTakingNullableOptionalsWithDefaults(?x: Nullable, ?y: string, ?d: Nullable) : int -test.fsx(231,36): error FS0041: A unique overload for method 'OverloadedMethodTakingNullableOptionalsWithDefaults' could not be determined based on type information prior to this program point. A type annotation may be needed. +test.fsx(231,46): error FS0041: A unique overload for method 'OverloadedMethodTakingNullableOptionalsWithDefaults' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: d: float @@ -97,7 +97,7 @@ Candidates: - SomeClass.OverloadedMethodTakingNullableOptionalsWithDefaults(?x: Nullable, ?y: string, ?d: Nullable) : int - SomeClass.OverloadedMethodTakingNullableOptionalsWithDefaults(?x: Nullable, ?y: string, ?d: Nullable) : int -test.fsx(232,36): error FS0041: A unique overload for method 'OverloadedMethodTakingNullableOptionalsWithDefaults' could not be determined based on type information prior to this program point. A type annotation may be needed. +test.fsx(232,46): error FS0041: A unique overload for method 'OverloadedMethodTakingNullableOptionalsWithDefaults' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: d: float option @@ -105,7 +105,7 @@ Candidates: - SomeClass.OverloadedMethodTakingNullableOptionalsWithDefaults(?x: Nullable, ?y: string, ?d: Nullable) : int - SomeClass.OverloadedMethodTakingNullableOptionalsWithDefaults(?x: Nullable, ?y: string, ?d: Nullable) : int -test.fsx(233,36): error FS0041: A unique overload for method 'OverloadedMethodTakingNullableOptionalsWithDefaults' could not be determined based on type information prior to this program point. A type annotation may be needed. +test.fsx(233,46): error FS0041: A unique overload for method 'OverloadedMethodTakingNullableOptionalsWithDefaults' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: x: 'a option @@ -113,7 +113,7 @@ Candidates: - SomeClass.OverloadedMethodTakingNullableOptionalsWithDefaults(?x: Nullable, ?y: string, ?d: Nullable) : int - SomeClass.OverloadedMethodTakingNullableOptionalsWithDefaults(?x: Nullable, ?y: string, ?d: Nullable) : int -test.fsx(234,36): error FS0041: A unique overload for method 'OverloadedMethodTakingNullableOptionalsWithDefaults' could not be determined based on type information prior to this program point. A type annotation may be needed. +test.fsx(234,46): error FS0041: A unique overload for method 'OverloadedMethodTakingNullableOptionalsWithDefaults' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: d: 'a option @@ -121,7 +121,7 @@ Candidates: - SomeClass.OverloadedMethodTakingNullableOptionalsWithDefaults(?x: Nullable, ?y: string, ?d: Nullable) : int - SomeClass.OverloadedMethodTakingNullableOptionalsWithDefaults(?x: Nullable, ?y: string, ?d: Nullable) : int -test.fsx(236,43): error FS0041: A unique overload for method 'OverloadedMethodTakingNullableOptionalsWithDefaults' could not be determined based on type information prior to this program point. A type annotation may be needed. +test.fsx(236,53): error FS0041: A unique overload for method 'OverloadedMethodTakingNullableOptionalsWithDefaults' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: 'a0 @@ -129,12 +129,12 @@ Candidates: - SomeClass.OverloadedMethodTakingNullableOptionalsWithDefaults(?x: Nullable, ?y: string, ?d: Nullable) : int - SomeClass.OverloadedMethodTakingNullableOptionalsWithDefaults(?x: Nullable, ?y: string, ?d: Nullable) : int -test.fsx(238,34): error FS0041: A unique overload for method 'OverloadedMethodTakingNullableOptionals' could not be determined based on type information prior to this program point. A type annotation may be needed. +test.fsx(238,44): error FS0041: A unique overload for method 'OverloadedMethodTakingNullableOptionals' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: - SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable, ?y: string, ?d: Nullable) : int - SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable, ?y: string, ?d: Nullable) : int -test.fsx(239,34): error FS0041: A unique overload for method 'OverloadedMethodTakingNullableOptionals' could not be determined based on type information prior to this program point. A type annotation may be needed. +test.fsx(239,44): error FS0041: A unique overload for method 'OverloadedMethodTakingNullableOptionals' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: y: string @@ -142,7 +142,7 @@ Candidates: - SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable, ?y: string, ?d: Nullable) : int - SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable, ?y: string, ?d: Nullable) : int -test.fsx(240,33): error FS0041: A unique overload for method 'OverloadedMethodTakingNullableOptionals' could not be determined based on type information prior to this program point. A type annotation may be needed. +test.fsx(240,43): error FS0041: A unique overload for method 'OverloadedMethodTakingNullableOptionals' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: d: float @@ -150,7 +150,7 @@ Candidates: - SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable, ?y: string, ?d: Nullable) : int - SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable, ?y: string, ?d: Nullable) : int -test.fsx(241,34): error FS0041: A unique overload for method 'OverloadedMethodTakingNullableOptionals' could not be determined based on type information prior to this program point. A type annotation may be needed. +test.fsx(241,44): error FS0041: A unique overload for method 'OverloadedMethodTakingNullableOptionals' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: d: Nullable @@ -158,7 +158,7 @@ Candidates: - SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable, ?y: string, ?d: Nullable) : int - SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable, ?y: string, ?d: Nullable) : int -test.fsx(242,35): error FS0041: A unique overload for method 'OverloadedMethodTakingNullableOptionals' could not be determined based on type information prior to this program point. A type annotation may be needed. +test.fsx(242,45): error FS0041: A unique overload for method 'OverloadedMethodTakingNullableOptionals' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: d: float @@ -166,7 +166,7 @@ Candidates: - SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable, ?y: string, ?d: Nullable) : int - SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable, ?y: string, ?d: Nullable) : int -test.fsx(243,35): error FS0041: A unique overload for method 'OverloadedMethodTakingNullableOptionals' could not be determined based on type information prior to this program point. A type annotation may be needed. +test.fsx(243,45): error FS0041: A unique overload for method 'OverloadedMethodTakingNullableOptionals' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: d: float option @@ -174,7 +174,7 @@ Candidates: - SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable, ?y: string, ?d: Nullable) : int - SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable, ?y: string, ?d: Nullable) : int -test.fsx(244,35): error FS0041: A unique overload for method 'OverloadedMethodTakingNullableOptionals' could not be determined based on type information prior to this program point. A type annotation may be needed. +test.fsx(244,45): error FS0041: A unique overload for method 'OverloadedMethodTakingNullableOptionals' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: x: 'a option @@ -182,7 +182,7 @@ Candidates: - SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable, ?y: string, ?d: Nullable) : int - SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable, ?y: string, ?d: Nullable) : int -test.fsx(245,35): error FS0041: A unique overload for method 'OverloadedMethodTakingNullableOptionals' could not be determined based on type information prior to this program point. A type annotation may be needed. +test.fsx(245,45): error FS0041: A unique overload for method 'OverloadedMethodTakingNullableOptionals' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: d: 'a option @@ -190,7 +190,7 @@ Candidates: - SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable, ?y: string, ?d: Nullable) : int - SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable, ?y: string, ?d: Nullable) : int -test.fsx(246,42): error FS0041: A unique overload for method 'OverloadedMethodTakingNullableOptionals' could not be determined based on type information prior to this program point. A type annotation may be needed. +test.fsx(246,52): error FS0041: A unique overload for method 'OverloadedMethodTakingNullableOptionals' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: 'a0 @@ -200,7 +200,7 @@ Candidates: test.fsx(248,93): error FS0691: Named arguments must appear after all other arguments -test.fsx(249,88): error FS0041: A unique overload for method 'OverloadedMethodTakingNullables' could not be determined based on type information prior to this program point. A type annotation may be needed. +test.fsx(249,98): error FS0041: A unique overload for method 'OverloadedMethodTakingNullables' could not be determined based on type information prior to this program point. A type annotation may be needed. Known types of arguments: Nullable<'a> * string * Nullable<'b> when 'a: (new: unit -> 'a) and 'a: struct and 'a :> ValueType and 'b: (new: unit -> 'b) and 'b: struct and 'b :> ValueType diff --git a/tests/fsharp/typecheck/overloads/neg_System.Convert.ToString.OverloadList.bsl b/tests/fsharp/typecheck/overloads/neg_System.Convert.ToString.OverloadList.bsl index 090ddf39205..abfd96c8d9c 100644 --- a/tests/fsharp/typecheck/overloads/neg_System.Convert.ToString.OverloadList.bsl +++ b/tests/fsharp/typecheck/overloads/neg_System.Convert.ToString.OverloadList.bsl @@ -1,5 +1,5 @@ -neg_System.Convert.ToString.OverloadList.fsx(1,1,1,31): typecheck error FS0041: No overloads match for method 'ToString'. +neg_System.Convert.ToString.OverloadList.fsx(1,16,1,24): typecheck error FS0041: No overloads match for method 'ToString'. Known types of arguments: char * int @@ -25,7 +25,7 @@ Available overloads: - System.Convert.ToString(value: uint32, provider: System.IFormatProvider) : string // Argument 'value' doesn't match - System.Convert.ToString(value: uint64, provider: System.IFormatProvider) : string // Argument 'value' doesn't match -neg_System.Convert.ToString.OverloadList.fsx(2,1,2,47): typecheck error FS0041: No overloads match for method 'ToString'. +neg_System.Convert.ToString.OverloadList.fsx(2,16,2,24): typecheck error FS0041: No overloads match for method 'ToString'. Known types of arguments: provider: char * value: int diff --git a/tests/fsharp/typecheck/overloads/neg_System.Drawing.Graphics.DrawRectangleOverloadList.bsl b/tests/fsharp/typecheck/overloads/neg_System.Drawing.Graphics.DrawRectangleOverloadList.bsl index cfa6d36b91b..e132b8605c2 100644 --- a/tests/fsharp/typecheck/overloads/neg_System.Drawing.Graphics.DrawRectangleOverloadList.bsl +++ b/tests/fsharp/typecheck/overloads/neg_System.Drawing.Graphics.DrawRectangleOverloadList.bsl @@ -1,5 +1,5 @@ -neg_System.Drawing.Graphics.DrawRectangleOverloadList.fsx(9,1,9,31): typecheck error FS0041: No overloads match for method 'DrawRectangle'. +neg_System.Drawing.Graphics.DrawRectangleOverloadList.fsx(9,3,9,16): typecheck error FS0041: No overloads match for method 'DrawRectangle'. Known types of arguments: Pen * float32 * float32 * float32 * int @@ -7,7 +7,7 @@ Available overloads: - Graphics.DrawRectangle(pen: Pen, x: float32, y: float32, width: float32, height: float32) : unit // Argument 'height' doesn't match - Graphics.DrawRectangle(pen: Pen, x: int, y: int, width: int, height: int) : unit // Argument 'x' doesn't match -neg_System.Drawing.Graphics.DrawRectangleOverloadList.fsx(10,1,10,32): typecheck error FS0041: No overloads match for method 'DrawRectangle'. +neg_System.Drawing.Graphics.DrawRectangleOverloadList.fsx(10,3,10,16): typecheck error FS0041: No overloads match for method 'DrawRectangle'. Known types of arguments: Pen * int * float32 * float32 * decimal diff --git a/tests/fsharp/typecheck/overloads/neg_System.Threading.Tasks.Task.Run.OverloadList.bsl b/tests/fsharp/typecheck/overloads/neg_System.Threading.Tasks.Task.Run.OverloadList.bsl index c004363a8f2..8070f43bad8 100644 --- a/tests/fsharp/typecheck/overloads/neg_System.Threading.Tasks.Task.Run.OverloadList.bsl +++ b/tests/fsharp/typecheck/overloads/neg_System.Threading.Tasks.Task.Run.OverloadList.bsl @@ -1,5 +1,5 @@ -neg_System.Threading.Tasks.Task.Run.OverloadList.fsx(5,11,5,35): typecheck error FS0041: A unique overload for method 'Run' could not be determined based on type information prior to this program point. A type annotation may be needed. +neg_System.Threading.Tasks.Task.Run.OverloadList.fsx(5,16,5,19): typecheck error FS0041: A unique overload for method 'Run' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: (unit -> Task) @@ -7,7 +7,7 @@ Candidates: - Task.Run<'TResult>(``function`` : Func<'TResult>) : Task<'TResult> - Task.Run<'TResult>(``function`` : Func>) : Task<'TResult> -neg_System.Threading.Tasks.Task.Run.OverloadList.fsx(6,11,6,44): typecheck error FS0041: A unique overload for method 'Run' could not be determined based on type information prior to this program point. A type annotation may be needed. +neg_System.Threading.Tasks.Task.Run.OverloadList.fsx(6,16,6,19): typecheck error FS0041: A unique overload for method 'Run' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: Func> @@ -15,7 +15,7 @@ Candidates: - Task.Run<'TResult>(``function`` : Func<'TResult>) : Task<'TResult> - Task.Run<'TResult>(``function`` : Func>) : Task<'TResult> -neg_System.Threading.Tasks.Task.Run.OverloadList.fsx(7,11,7,47): typecheck error FS0041: A unique overload for method 'Run' could not be determined based on type information prior to this program point. A type annotation may be needed. +neg_System.Threading.Tasks.Task.Run.OverloadList.fsx(7,16,7,19): typecheck error FS0041: A unique overload for method 'Run' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: Func> @@ -23,7 +23,7 @@ Candidates: - Task.Run<'TResult>(``function`` : Func<'TResult>) : Task<'TResult> - Task.Run<'TResult>(``function`` : Func>) : Task<'TResult> -neg_System.Threading.Tasks.Task.Run.OverloadList.fsx(8,21,8,57): typecheck error FS0041: A unique overload for method 'Run' could not be determined based on type information prior to this program point. A type annotation may be needed. +neg_System.Threading.Tasks.Task.Run.OverloadList.fsx(8,26,8,29): typecheck error FS0041: A unique overload for method 'Run' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: Func> @@ -31,7 +31,7 @@ Candidates: - Task.Run<'TResult>(``function`` : Func<'TResult>) : Task<'TResult> - Task.Run<'TResult>(``function`` : Func>) : Task<'TResult> -neg_System.Threading.Tasks.Task.Run.OverloadList.fsx(9,11,9,50): typecheck error FS0041: A unique overload for method 'Run' could not be determined based on type information prior to this program point. A type annotation may be needed. +neg_System.Threading.Tasks.Task.Run.OverloadList.fsx(9,16,9,19): typecheck error FS0041: A unique overload for method 'Run' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: Func> @@ -39,7 +39,7 @@ Candidates: - Task.Run<'TResult>(``function`` : Func<'TResult>) : Task<'TResult> - Task.Run<'TResult>(``function`` : Func>) : Task<'TResult> -neg_System.Threading.Tasks.Task.Run.OverloadList.fsx(10,11,10,52): typecheck error FS0041: A unique overload for method 'Run' could not be determined based on type information prior to this program point. A type annotation may be needed. +neg_System.Threading.Tasks.Task.Run.OverloadList.fsx(10,16,10,19): typecheck error FS0041: A unique overload for method 'Run' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: Func> diff --git a/tests/fsharp/typecheck/overloads/neg_generic_known_argument_types.bsl b/tests/fsharp/typecheck/overloads/neg_generic_known_argument_types.bsl index 4b256a7c3b8..bd298dbb742 100644 --- a/tests/fsharp/typecheck/overloads/neg_generic_known_argument_types.bsl +++ b/tests/fsharp/typecheck/overloads/neg_generic_known_argument_types.bsl @@ -1,5 +1,5 @@ -neg_generic_known_argument_types.fsx(9,16,9,49): typecheck error FS0041: A unique overload for method 'Foo' could not be determined based on type information prior to this program point. A type annotation may be needed. +neg_generic_known_argument_types.fsx(9,23,9,26): typecheck error FS0041: A unique overload for method 'Foo' could not be determined based on type information prior to this program point. A type annotation may be needed. Known types of arguments: ^fa * 'fb * 'a * argD: 'c when ^fa: (member X: ^b -> ^b) and ^b: (member BBBB: unit -> unit) diff --git a/tests/fsharp/typecheck/overloads/neg_interface_generics.bsl b/tests/fsharp/typecheck/overloads/neg_interface_generics.bsl index 8cb798d4fa7..c31ed3d0041 100644 --- a/tests/fsharp/typecheck/overloads/neg_interface_generics.bsl +++ b/tests/fsharp/typecheck/overloads/neg_interface_generics.bsl @@ -1,7 +1,7 @@ neg_interface_generics.fsx(14,1,18,2): typecheck error FS0505: The member or object constructor 'Foo' does not take 13073 argument(s). An overload was found taking 1 arguments. -neg_interface_generics.fsx(20,9,20,27): typecheck error FS0041: No overloads match for method 'Foo'. +neg_interface_generics.fsx(20,13,20,16): typecheck error FS0041: No overloads match for method 'Foo'. Known types of arguments: string * XmlReader diff --git a/tests/fsharp/typecheck/overloads/neg_many_many_overloads.bsl b/tests/fsharp/typecheck/overloads/neg_many_many_overloads.bsl index c37fa993868..2563c0c3843 100644 --- a/tests/fsharp/typecheck/overloads/neg_many_many_overloads.bsl +++ b/tests/fsharp/typecheck/overloads/neg_many_many_overloads.bsl @@ -1,5 +1,5 @@ -neg_many_many_overloads.fsx(123,1,123,13): typecheck error FS0041: A unique overload for method 'A' could not be determined based on type information prior to this program point. A type annotation may be needed. +neg_many_many_overloads.fsx(123,7,123,8): typecheck error FS0041: A unique overload for method 'A' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: 'a0 when 'a0: null @@ -77,7 +77,7 @@ Candidates: - static member Class.A: a: Task -> Task - static member Class.A: a: string -> string -neg_many_many_overloads.fsx(124,1,124,34): typecheck error FS0041: No overloads match for method 'A'. +neg_many_many_overloads.fsx(124,7,124,8): typecheck error FS0041: No overloads match for method 'A'. Known type of argument: Type @@ -167,7 +167,7 @@ Available overloads: - static member Class.A: a: uint64 -> uint64 // Argument 'a' doesn't match - static member Class.A: a: uint8 -> uint8 // Argument 'a' doesn't match -neg_many_many_overloads.fsx(125,1,125,25): typecheck error FS0041: No overloads match for method 'A'. +neg_many_many_overloads.fsx(125,7,125,8): typecheck error FS0041: No overloads match for method 'A'. Known type of argument: Guid @@ -257,7 +257,7 @@ Available overloads: - static member Class.A: a: uint64 -> uint64 // Argument 'a' doesn't match - static member Class.A: a: uint8 -> uint8 // Argument 'a' doesn't match -neg_many_many_overloads.fsx(126,1,126,48): typecheck error FS0041: No overloads match for method 'A'. +neg_many_many_overloads.fsx(126,7,126,8): typecheck error FS0041: No overloads match for method 'A'. Known type of argument: DayOfWeek diff --git a/tests/fsharp/typecheck/overloads/neg_tupled_arguments.bsl b/tests/fsharp/typecheck/overloads/neg_tupled_arguments.bsl index 33de258632b..480b1f39deb 100644 --- a/tests/fsharp/typecheck/overloads/neg_tupled_arguments.bsl +++ b/tests/fsharp/typecheck/overloads/neg_tupled_arguments.bsl @@ -1,5 +1,5 @@ -neg_tupled_arguments.fsx(6,9,6,31): typecheck error FS0041: No overloads match for method 'A'. +neg_tupled_arguments.fsx(6,11,6,12): typecheck error FS0041: No overloads match for method 'A'. Known types of arguments: (int * (int * string) * int) * int @@ -9,7 +9,7 @@ Available overloads: neg_tupled_arguments.fsx(7,9,7,28): typecheck error FS0503: A member or object constructor 'A' taking 4 arguments is not accessible from this code location. All accessible versions of method 'A' take 2 arguments. -neg_tupled_arguments.fsx(14,9,14,40): typecheck error FS0041: No overloads match for method 'B'. +neg_tupled_arguments.fsx(14,11,14,12): typecheck error FS0041: No overloads match for method 'B'. Known types of arguments: int * int * (int * (int * int * int * (int * int))) * int * int diff --git a/tests/fsharp/typecheck/sigs/neg06.bsl b/tests/fsharp/typecheck/sigs/neg06.bsl index aac7fe5403b..66b21b0f504 100644 --- a/tests/fsharp/typecheck/sigs/neg06.bsl +++ b/tests/fsharp/typecheck/sigs/neg06.bsl @@ -108,7 +108,7 @@ neg06.fs(350,13,350,21): typecheck error FS0800: Invalid use of a type name neg06.fs(375,9,375,10): typecheck error FS1197: The parameter 'x' was inferred to have byref type. Parameters of byref type must be given an explicit type annotation, e.g. 'x1: byref'. When used, a byref parameter is implicitly dereferenced. -neg06.fs(382,13,382,19): typecheck error FS0041: A unique overload for method 'M1' could not be determined based on type information prior to this program point. A type annotation may be needed. +neg06.fs(382,15,382,17): typecheck error FS0041: A unique overload for method 'M1' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: 'a diff --git a/tests/fsharp/typecheck/sigs/neg106.bsl b/tests/fsharp/typecheck/sigs/neg106.bsl index f25e10e776e..911ad185297 100644 --- a/tests/fsharp/typecheck/sigs/neg106.bsl +++ b/tests/fsharp/typecheck/sigs/neg106.bsl @@ -1,7 +1,7 @@ neg106.fs(8,59,8,61): typecheck error FS3230: A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' -neg106.fs(13,18,13,72): typecheck error FS0041: No overloads match for method 'CompareExchange'. +neg106.fs(13,47,13,62): typecheck error FS0041: No overloads match for method 'CompareExchange'. Known types of arguments: inref * int * int @@ -16,7 +16,7 @@ Available overloads: neg106.fs(17,59,17,61): typecheck error FS3236: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. -neg106.fs(17,14,17,68): typecheck error FS0041: No overloads match for method 'CompareExchange'. +neg106.fs(17,43,17,58): typecheck error FS0041: No overloads match for method 'CompareExchange'. Known types of arguments: inref * int * int @@ -41,7 +41,7 @@ but given a 'inref' The type 'ByRefKinds.InOut' does not match the type 'ByRefKinds.In' -neg106.fs(40,18,40,32): typecheck error FS0041: No overloads match for method 'M'. +neg106.fs(40,20,40,21): typecheck error FS0041: No overloads match for method 'M'. Known types of arguments: string * inref @@ -49,7 +49,7 @@ Available overloads: - static member C.M: a: int * [] x: byref -> unit // Argument 'a' doesn't match - static member C.M: a: string * [] x: byref -> unit // Argument 'x' doesn't match -neg106.fs(41,19,41,31): typecheck error FS0041: No overloads match for method 'M'. +neg106.fs(41,21,41,22): typecheck error FS0041: No overloads match for method 'M'. Known types of arguments: int * inref @@ -172,3 +172,11 @@ neg106.fs(147,34,147,44): typecheck error FS1204: This construct is for use in t neg106.fs(148,34,148,44): typecheck error FS1204: This construct is for use in the FSharp.Core library and should not be used directly neg106.fs(149,34,149,44): typecheck error FS1204: This construct is for use in the FSharp.Core library and should not be used directly + +neg106.fs(146,34,146,47): typecheck error FS1204: This construct is for use in the FSharp.Core library and should not be used directly + +neg106.fs(147,34,147,44): typecheck error FS1204: This construct is for use in the FSharp.Core library and should not be used directly + +neg106.fs(148,34,148,44): typecheck error FS1204: This construct is for use in the FSharp.Core library and should not be used directly + +neg106.fs(149,34,149,44): typecheck error FS1204: This construct is for use in the FSharp.Core library and should not be used directly diff --git a/tests/fsharp/typecheck/sigs/neg106.vsbsl b/tests/fsharp/typecheck/sigs/neg106.vsbsl index f25e10e776e..911ad185297 100644 --- a/tests/fsharp/typecheck/sigs/neg106.vsbsl +++ b/tests/fsharp/typecheck/sigs/neg106.vsbsl @@ -1,7 +1,7 @@ neg106.fs(8,59,8,61): typecheck error FS3230: A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' -neg106.fs(13,18,13,72): typecheck error FS0041: No overloads match for method 'CompareExchange'. +neg106.fs(13,47,13,62): typecheck error FS0041: No overloads match for method 'CompareExchange'. Known types of arguments: inref * int * int @@ -16,7 +16,7 @@ Available overloads: neg106.fs(17,59,17,61): typecheck error FS3236: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. -neg106.fs(17,14,17,68): typecheck error FS0041: No overloads match for method 'CompareExchange'. +neg106.fs(17,43,17,58): typecheck error FS0041: No overloads match for method 'CompareExchange'. Known types of arguments: inref * int * int @@ -41,7 +41,7 @@ but given a 'inref' The type 'ByRefKinds.InOut' does not match the type 'ByRefKinds.In' -neg106.fs(40,18,40,32): typecheck error FS0041: No overloads match for method 'M'. +neg106.fs(40,20,40,21): typecheck error FS0041: No overloads match for method 'M'. Known types of arguments: string * inref @@ -49,7 +49,7 @@ Available overloads: - static member C.M: a: int * [] x: byref -> unit // Argument 'a' doesn't match - static member C.M: a: string * [] x: byref -> unit // Argument 'x' doesn't match -neg106.fs(41,19,41,31): typecheck error FS0041: No overloads match for method 'M'. +neg106.fs(41,21,41,22): typecheck error FS0041: No overloads match for method 'M'. Known types of arguments: int * inref @@ -172,3 +172,11 @@ neg106.fs(147,34,147,44): typecheck error FS1204: This construct is for use in t neg106.fs(148,34,148,44): typecheck error FS1204: This construct is for use in the FSharp.Core library and should not be used directly neg106.fs(149,34,149,44): typecheck error FS1204: This construct is for use in the FSharp.Core library and should not be used directly + +neg106.fs(146,34,146,47): typecheck error FS1204: This construct is for use in the FSharp.Core library and should not be used directly + +neg106.fs(147,34,147,44): typecheck error FS1204: This construct is for use in the FSharp.Core library and should not be used directly + +neg106.fs(148,34,148,44): typecheck error FS1204: This construct is for use in the FSharp.Core library and should not be used directly + +neg106.fs(149,34,149,44): typecheck error FS1204: This construct is for use in the FSharp.Core library and should not be used directly diff --git a/tests/fsharp/typecheck/sigs/neg131.bsl b/tests/fsharp/typecheck/sigs/neg131.bsl index 2319a3914d4..ae9eced1f18 100644 --- a/tests/fsharp/typecheck/sigs/neg131.bsl +++ b/tests/fsharp/typecheck/sigs/neg131.bsl @@ -1,5 +1,5 @@ -neg131.fs(15,9,15,55): typecheck error FS0041: A unique overload for method 'SomeMethod' could not be determined based on type information prior to this program point. A type annotation may be needed. +neg131.fs(15,27,15,37): typecheck error FS0041: A unique overload for method 'SomeMethod' could not be determined based on type information prior to this program point. A type annotation may be needed. Known types of arguments: 'a * ('b -> int) diff --git a/tests/fsharp/typecheck/sigs/neg132.bsl b/tests/fsharp/typecheck/sigs/neg132.bsl index c7d10ed0af0..d3913a2b7c8 100644 --- a/tests/fsharp/typecheck/sigs/neg132.bsl +++ b/tests/fsharp/typecheck/sigs/neg132.bsl @@ -1,5 +1,5 @@ -neg132.fs(15,9,15,55): typecheck error FS0041: A unique overload for method 'SomeMethod' could not be determined based on type information prior to this program point. A type annotation may be needed. +neg132.fs(15,27,15,37): typecheck error FS0041: A unique overload for method 'SomeMethod' could not be determined based on type information prior to this program point. A type annotation may be needed. Known types of arguments: 'a * ('b -> int) diff --git a/tests/fsharp/typecheck/sigs/neg20.bsl b/tests/fsharp/typecheck/sigs/neg20.bsl index 6e5923f6116..c14de22c3c6 100644 --- a/tests/fsharp/typecheck/sigs/neg20.bsl +++ b/tests/fsharp/typecheck/sigs/neg20.bsl @@ -109,7 +109,7 @@ neg20.fs(128,19,128,22): typecheck error FS0001: This expression was expected to but here has type 'obj' -neg20.fs(131,5,131,24): typecheck error FS0041: No overloads match for method 'OM3'. +neg20.fs(131,12,131,15): typecheck error FS0041: No overloads match for method 'OM3'. Known types of arguments: string * obj @@ -145,7 +145,7 @@ neg20.fs(166,13,166,35): typecheck error FS0502: The member or object constructo neg20.fs(167,13,167,31): typecheck error FS0502: The member or object constructor 'M5' takes 2 type argument(s) but is here given 1. The required signature is 'member C.M5<'b,'c> : y: 'a * z: 'b -> int'. -neg20.fs(182,14,182,31): typecheck error FS0041: No overloads match for method 'M'. +neg20.fs(182,17,182,18): typecheck error FS0041: No overloads match for method 'M'. Known types of arguments: string * objnull @@ -158,6 +158,16 @@ neg20.fs(183,29,183,34): typecheck error FS0001: This expression was expected to but here has type 'objnull' +neg20.fs(183,29,183,34): typecheck error FS0001: This expression was expected to have type + 'int' +but here has type + 'objnull' + +neg20.fs(183,35,183,40): typecheck error FS0001: This expression was expected to have type + 'int' +but here has type + 'objnull' + neg20.fs(183,35,183,40): typecheck error FS0001: This expression was expected to have type 'int' but here has type @@ -174,12 +184,22 @@ neg20.fs(184,28,184,33): typecheck error FS0001: This expression was expected to but here has type 'objnull' +neg20.fs(184,28,184,33): typecheck error FS0001: This expression was expected to have type + 'int' +but here has type + 'objnull' + +neg20.fs(184,34,184,39): typecheck error FS0001: This expression was expected to have type + 'int' +but here has type + 'objnull' + neg20.fs(184,34,184,39): typecheck error FS0001: This expression was expected to have type 'int' but here has type 'objnull' -neg20.fs(188,14,188,31): typecheck error FS0041: No overloads match for method 'M'. +neg20.fs(188,17,188,18): typecheck error FS0041: No overloads match for method 'M'. Known types of arguments: string * objnull @@ -192,6 +212,16 @@ neg20.fs(189,29,189,34): typecheck error FS0001: This expression was expected to but here has type 'objnull' +neg20.fs(189,29,189,34): typecheck error FS0001: This expression was expected to have type + 'string' +but here has type + 'objnull' + +neg20.fs(189,35,189,40): typecheck error FS0001: This expression was expected to have type + 'string' +but here has type + 'objnull' + neg20.fs(189,35,189,40): typecheck error FS0001: This expression was expected to have type 'string' but here has type @@ -208,6 +238,16 @@ neg20.fs(190,28,190,33): typecheck error FS0001: This expression was expected to but here has type 'objnull' +neg20.fs(190,28,190,33): typecheck error FS0001: This expression was expected to have type + 'string' +but here has type + 'objnull' + +neg20.fs(190,34,190,39): typecheck error FS0001: This expression was expected to have type + 'string' +but here has type + 'objnull' + neg20.fs(190,34,190,39): typecheck error FS0001: This expression was expected to have type 'string' but here has type @@ -311,6 +351,8 @@ neg20.fs(288,17,288,18): typecheck error FS0038: 'x' is bound twice in this patt neg20.fs(294,5,294,36): typecheck error FS0840: Unrecognized attribute target. Valid attribute targets are 'assembly', 'module', 'type', 'method', 'property', 'return', 'param', 'field', 'event', 'constructor'. +neg20.fs(294,5,294,36): typecheck error FS0840: Unrecognized attribute target. Valid attribute targets are 'assembly', 'module', 'type', 'method', 'property', 'return', 'param', 'field', 'event', 'constructor'. + neg20.fs(301,8,301,16): typecheck error FS3132: This type definition may not have the 'CLIMutable' attribute. Only record types may have this attribute. neg20.fs(304,8,304,16): typecheck error FS3132: This type definition may not have the 'CLIMutable' attribute. Only record types may have this attribute. @@ -327,7 +369,7 @@ neg20.fs(319,8,319,17): typecheck error FS3132: This type definition may not hav neg20.fs(322,8,322,18): typecheck error FS3132: This type definition may not have the 'CLIMutable' attribute. Only record types may have this attribute. -neg20.fs(335,11,335,24): typecheck error FS0041: A unique overload for method 'String' could not be determined based on type information prior to this program point. A type annotation may be needed. +neg20.fs(335,18,335,24): typecheck error FS0041: A unique overload for method 'String' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: 'a0 @@ -336,7 +378,7 @@ Candidates: - System.String(value: nativeptr) : System.String - System.String(value: nativeptr) : System.String -neg20.fs(336,11,336,22): typecheck error FS0041: A unique overload for method 'Guid' could not be determined based on type information prior to this program point. A type annotation may be needed. +neg20.fs(336,18,336,22): typecheck error FS0041: A unique overload for method 'Guid' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: 'a0 diff --git a/tests/fsharp/typecheck/sigs/neg45.bsl b/tests/fsharp/typecheck/sigs/neg45.bsl index 18de4770ac8..f6d5725abbf 100644 --- a/tests/fsharp/typecheck/sigs/neg45.bsl +++ b/tests/fsharp/typecheck/sigs/neg45.bsl @@ -61,7 +61,7 @@ neg45.fs(80,20,80,22): typecheck error FS0340: The signature and implementation neg45.fs(81,35,81,40): typecheck error FS0001: A type parameter is missing a constraint 'when 'T :> System.IComparable' -neg45.fs(89,26,89,40): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. +neg45.fs(89,28,89,29): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: R1 @@ -69,7 +69,7 @@ Candidates: - member D.M: 'a -> 'b - member D.M: 'a -> 'b -neg45.fs(97,26,97,55): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. +neg45.fs(97,28,97,29): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: (R1 * R1) @@ -77,7 +77,7 @@ Candidates: - member D.M: 'a -> 'b - member D.M: 'a -> 'b -neg45.fs(104,26,104,31): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. +neg45.fs(104,28,104,29): typecheck error FS0041: A unique overload for method 'M' could not be determined based on type information prior to this program point. A type annotation may be needed. Known type of argument: int diff --git a/tests/fsharp/typecheck/sigs/neg70.vsbsl b/tests/fsharp/typecheck/sigs/neg70.vsbsl index c392fc98985..ee570a41e50 100644 --- a/tests/fsharp/typecheck/sigs/neg70.vsbsl +++ b/tests/fsharp/typecheck/sigs/neg70.vsbsl @@ -1,11 +1,13 @@ neg70.fsx(109,64,109,65): parse error FS0010: Unexpected symbol ')' in binding. Expected incomplete structured construct at or before this point or other token. +neg70.fsx(109,64,109,65): parse error FS0010: Unexpected symbol ')' in binding. Expected incomplete structured construct at or before this point or other token. + neg70.fsx(107,29,107,69): typecheck error FS0507: No accessible member or object constructor named 'Rectangle' takes 0 arguments. Note the call to this member also provides 1 named arguments. neg70.fsx(108,39,108,40): typecheck error FS0039: The value or constructor 'y' is not defined. -neg70.fsx(110,18,110,43): typecheck error FS0041: No overloads match for method 'FillEllipse'. +neg70.fsx(110,20,110,31): typecheck error FS0041: No overloads match for method 'FillEllipse'. Known types of arguments: Brush * (int * bool * bool * bool) From 13885274823d852a542bf78a1e5a6ad1f9925db9 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Thu, 14 May 2026 08:04:16 +0200 Subject: [PATCH 2/5] Address review feedback: remove unused mItemIdent from TcItemThen - Remove the unused _mItemIdent parameter from TcItemThen signature, decomposing the 6-tuple result at call sites (TcLongIdentThen, TcTypeItemThen, TcNameOfExpr) to strip itemIdentRange before passing to TcItemThen. Addresses @abonie's feedback. - Improve ComputeItemRange doc comment to clarify that itemRange is consumed by TcItemThen for typed-tree construction/delayRest, while itemIdentRange is used only in name-resolution sink callbacks for IDE symbol reporting. Addresses @auduchinok's question. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Checking/Expressions/CheckExpressions.fs | 16 ++++++++-------- src/Compiler/Checking/NameResolution.fs | 19 ++++++++++--------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/Compiler/Checking/Expressions/CheckExpressions.fs b/src/Compiler/Checking/Expressions/CheckExpressions.fs index c5598952347..2db92a85eb9 100644 --- a/src/Compiler/Checking/Expressions/CheckExpressions.fs +++ b/src/Compiler/Checking/Expressions/CheckExpressions.fs @@ -6642,7 +6642,7 @@ and TcTyparExprThen (cenv: cenv) overallTy env tpenv synTypar m delayed = | [] -> delayed2 | _ -> DelayedDotLookup (rest, m2) :: delayed2 CallNameResolutionSink cenv.tcSink (ident.idRange, env.NameEnv, item, emptyTyparInst, ItemOccurrence.Use, env.AccessRights) - TcItemThen cenv overallTy env tpenv ([], item, mExprAndLongId, mExprAndLongId, [], AfterResolution.DoNothing) (Some ty) delayed3 + TcItemThen cenv overallTy env tpenv ([], item, mExprAndLongId, [], AfterResolution.DoNothing) (Some ty) delayed3 //TcLookupItemThen cenv overallTy env tpenv mObjExpr objExpr objExprTy delayed item mItem rest afterResolution | _ -> let (SynTypar(_, q, _)) = synTypar @@ -8631,7 +8631,7 @@ and TcNameOfExpr (cenv: cenv) env tpenv (synArg: SynExpr) = let nameResolutionResult = ResolveLongIdentAsExprAndComputeRange cenv.tcSink cenv.nameResolver (rangeOfLid longId) ad env.eNameResEnv typeNameResInfo longId None let resolvesAsExpr = match nameResolutionResult with - | Result (_, item, _, _, _, _ as res) + | Result (tinstEnclosing, item, mItem, _, rest, afterRes) when (match item with | Item.DelegateCtor _ @@ -8642,7 +8642,7 @@ and TcNameOfExpr (cenv: cenv) env tpenv (synArg: SynExpr) = | _ -> true | _ -> true) -> let overallTy = match overallTyOpt with None -> MustEqual (NewInferenceType g) | Some t -> t - let _, _ = TcItemThen cenv overallTy env tpenv res None delayed + let _, _ = TcItemThen cenv overallTy env tpenv (tinstEnclosing, item, mItem, rest, afterRes) None delayed true | _ -> false @@ -8869,18 +8869,18 @@ and TcLongIdentThen (cenv: cenv) (overallTy: OverallTy) env tpenv (SynLongIdent( let ad = env.eAccessRights let typeNameResInfo = GetLongIdentTypeNameInfo delayed - let nameResolutionResult = + let (tinstEnclosing, item, mItem, _, rest, afterResolution) = let maybeAppliedArgExpr = DelayedItem.maybeAppliedArgForPreferExtensionOverProperty delayed ResolveLongIdentAsExprAndComputeRange cenv.tcSink cenv.nameResolver (rangeOfLid longId) ad env.eNameResEnv typeNameResInfo longId maybeAppliedArgExpr |> ForceRaise - TcItemThen cenv overallTy env tpenv nameResolutionResult None delayed + TcItemThen cenv overallTy env tpenv (tinstEnclosing, item, mItem, rest, afterResolution) None delayed //------------------------------------------------------------------------- // Typecheck "item+projections" //------------------------------------------------------------------------- *) // mItem is the textual range covered by the long identifiers that make up the item -and TcItemThen (cenv: cenv) (overallTy: OverallTy) env tpenv (tinstEnclosing, item, mItem, _mItemIdent, rest, afterResolution) staticTyOpt delayed = +and TcItemThen (cenv: cenv) (overallTy: OverallTy) env tpenv (tinstEnclosing, item, mItem, rest, afterResolution) staticTyOpt delayed = let delayed = delayRest rest mItem delayed match item with // x where x is a union case or active pattern result tag. @@ -9120,8 +9120,8 @@ and TcTypeItemThen (cenv: cenv) overallTy env nm ty tpenv mItem tinstEnclosing d let item = Item.Types(nm, [ty]) CallNameResolutionSink cenv.tcSink (mExprAndTypeArgs, env.NameEnv, item, emptyTyparInst, ItemOccurrence.Use, env.eAccessRights) let typeNameResInfo = GetLongIdentTypeNameInfo otherDelayed - let item, mItem, mItemIdent, rest, afterResolution = ResolveExprDotLongIdentAndComputeRange cenv.tcSink cenv.nameResolver (unionRanges mExprAndTypeArgs mLongId) ad env.eNameResEnv ty longId typeNameResInfo IgnoreOverrides true None - TcItemThen cenv overallTy env tpenv ((argsOfAppTy g ty), item, mItem, mItemIdent, rest, afterResolution) None otherDelayed + let item, mItem, _, rest, afterResolution = ResolveExprDotLongIdentAndComputeRange cenv.tcSink cenv.nameResolver (unionRanges mExprAndTypeArgs mLongId) ad env.eNameResEnv ty longId typeNameResInfo IgnoreOverrides true None + TcItemThen cenv overallTy env tpenv ((argsOfAppTy g ty), item, mItem, rest, afterResolution) None otherDelayed | DelayedTypeApp(tyargs, _mTypeArgs, mExprAndTypeArgs) :: _delayed' -> // A case where we have an incomplete name e.g. 'Foo.' - we still want to report it to VS! diff --git a/src/Compiler/Checking/NameResolution.fs b/src/Compiler/Checking/NameResolution.fs index 5d98ef45590..14646f6f0e7 100644 --- a/src/Compiler/Checking/NameResolution.fs +++ b/src/Compiler/Checking/NameResolution.fs @@ -4164,18 +4164,19 @@ let private ResolveExprDotLongIdent (ncenv: NameResolver) m ad nenv ty (id: Iden /// /// * `itemRange` is the structural range of the long identifier as consumed /// by resolution — the whole-long-id span when `rest = []`, or the range -/// over the consumed prefix when `rest <> []`. This is what typed-tree -/// construction uses for expression ranges and sequence points, so we -/// never narrow it. +/// over the consumed prefix when `rest <> []`. This is used downstream in +/// `TcItemThen` for typed-tree expression ranges, sequence points, and +/// `delayRest` computations, so we never narrow it. +/// /// * `itemIdentRange` is the terminal identifier's own source range — the -/// piece the user perceives as "this item's name". It is used for -/// diagnostics and for sink-reported symbol ranges (Find Usages, symbol -/// highlight, FSharpSymbolUse) so error / IDE UI hits only the resolved -/// name. Fixes #14284 and #3920. +/// piece the user perceives as "this item's name". It is used only inside +/// the name-resolution sink callbacks (above) for diagnostics and IDE +/// symbol-use reporting (Find Usages, symbol highlight, FSharpSymbolUse), +/// so error / IDE UI hits only the resolved name. Fixes #14284 and #3920. /// /// For `T.Instance.Method("")`: -/// itemRange = `T.Instance.Method` -/// itemIdentRange = `Method` +/// itemRange = `T.Instance.Method` (consumed by TcItemThen for tree construction) +/// itemIdentRange = `Method` (reported to IDE sinks only) let ComputeItemRange wholem (lid: Ident list) rest = let itemRange = match rest with From 97eaeec7fc4ec90405f1704437807dd7f33f1e26 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Tue, 19 May 2026 12:36:04 +0200 Subject: [PATCH 3/5] Address review: thread mItemIdent instead of manual range arithmetic Replace error-prone column arithmetic for overload-error narrowing with the terminal-identifier range (mItemIdent) that ComputeItemRange already computes. This addresses @auduchinok's review feedback to not add error-prone range calculations and instead use the known Method range. Changes: - Add mItemIdent parameter to TcMethodApplicationThen and TcMethodApplication - Thread mItemIdent from ResolveLongIdentAsExprAndComputeRange through TcLongIdentThen -> TcItemThen -> TcMethodItemThen - Thread mItemIdent from ResolveExprDotLongIdentAndComputeRange through TcLookupThen -> TcLookupItemThen - Simplify error narrowing in TcMethodApplication to just use mItemIdent - Remove DoesIdentifierNeedBackticks/mkPos/withStart workarounds - Update backtick-escaped test: now correctly narrows to the identifier (ComputeItemRange's idRange includes backtick delimiters) This also addresses @abonie's comment - the previously discarded mItemIdent parameter from ResolveLongIdentAsExprAndComputeRange is now used. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Checking/Expressions/CheckExpressions.fs | 85 ++++++++----------- src/Compiler/Checking/NameResolution.fs | 10 +-- .../OverloadResolutionErrorRangeTests.fs | 12 +-- 3 files changed, 47 insertions(+), 60 deletions(-) diff --git a/src/Compiler/Checking/Expressions/CheckExpressions.fs b/src/Compiler/Checking/Expressions/CheckExpressions.fs index 9cc85cdf760..c4bfbb51a9c 100644 --- a/src/Compiler/Checking/Expressions/CheckExpressions.fs +++ b/src/Compiler/Checking/Expressions/CheckExpressions.fs @@ -6643,7 +6643,7 @@ and TcTyparExprThen (cenv: cenv) overallTy env tpenv synTypar m delayed = | [] -> delayed2 | _ -> DelayedDotLookup (rest, m2) :: delayed2 CallNameResolutionSink cenv.tcSink (ident.idRange, env.NameEnv, item, emptyTyparInst, ItemOccurrence.Use, env.AccessRights) - TcItemThen cenv overallTy env tpenv ([], item, mExprAndLongId, [], AfterResolution.DoNothing) (Some ty) delayed3 + TcItemThen cenv overallTy env tpenv ([], item, mExprAndLongId, ident.idRange, [], AfterResolution.DoNothing) (Some ty) delayed3 //TcLookupItemThen cenv overallTy env tpenv mObjExpr objExpr objExprTy delayed item mItem rest afterResolution | _ -> let (SynTypar(_, q, _)) = synTypar @@ -6968,7 +6968,7 @@ and TcCtorCall isNaked cenv env tpenv (overallTy: OverallTy) objTy mObjTyOpt ite | Some mObjTy, None -> ForNewConstructors cenv.tcSink env mObjTy methodName minfos | None, _ -> AfterResolution.DoNothing - TcMethodApplicationThen cenv env overallTy (Some objTy) tpenv None [] mWholeCall mItem methodName ad PossiblyMutates false meths afterResolution isSuperInit args ExprAtomicFlag.NonAtomic None delayed + TcMethodApplicationThen cenv env overallTy (Some objTy) tpenv None [] mWholeCall mItem mItem methodName ad PossiblyMutates false meths afterResolution isSuperInit args ExprAtomicFlag.NonAtomic None delayed | Item.DelegateCtor ty, [arg] -> // Re-record the name resolution since we now know it's a constructor call @@ -7395,7 +7395,7 @@ and TcObjectExpr (cenv: cenv) env tpenv (objTy, realObjTy, argopt, binds, extraI let afterResolution = ForNewConstructors cenv.tcSink env mObjTy methodName minfos let ad = env.AccessRights - let expr, tpenv = TcMethodApplicationThen cenv env (MustEqual objTy) None tpenv None [] mWholeExpr mObjTy methodName ad PossiblyMutates false meths afterResolution CtorValUsedAsSuperInit [arg] ExprAtomicFlag.Atomic None [] + let expr, tpenv = TcMethodApplicationThen cenv env (MustEqual objTy) None tpenv None [] mWholeExpr mObjTy mObjTy methodName ad PossiblyMutates false meths afterResolution CtorValUsedAsSuperInit [arg] ExprAtomicFlag.Atomic None [] // The 'base' value is always bound let baseIdOpt = (match baseIdOpt with None -> Some(ident("base", mObjTy)) | Some id -> Some id) expr, baseIdOpt, tpenv @@ -8632,7 +8632,7 @@ and TcNameOfExpr (cenv: cenv) env tpenv (synArg: SynExpr) = let nameResolutionResult = ResolveLongIdentAsExprAndComputeRange cenv.tcSink cenv.nameResolver (rangeOfLid longId) ad env.eNameResEnv typeNameResInfo longId None let resolvesAsExpr = match nameResolutionResult with - | Result (tinstEnclosing, item, mItem, _, rest, afterRes) + | Result (tinstEnclosing, item, mItem, mItemIdent, rest, afterRes) when (match item with | Item.DelegateCtor _ @@ -8643,7 +8643,7 @@ and TcNameOfExpr (cenv: cenv) env tpenv (synArg: SynExpr) = | _ -> true | _ -> true) -> let overallTy = match overallTyOpt with None -> MustEqual (NewInferenceType g) | Some t -> t - let _, _ = TcItemThen cenv overallTy env tpenv (tinstEnclosing, item, mItem, rest, afterRes) None delayed + let _, _ = TcItemThen cenv overallTy env tpenv (tinstEnclosing, item, mItem, mItemIdent, rest, afterRes) None delayed true | _ -> false @@ -8870,18 +8870,19 @@ and TcLongIdentThen (cenv: cenv) (overallTy: OverallTy) env tpenv (SynLongIdent( let ad = env.eAccessRights let typeNameResInfo = GetLongIdentTypeNameInfo delayed - let (tinstEnclosing, item, mItem, _, rest, afterResolution) = + let (tinstEnclosing, item, mItem, mItemIdent, rest, afterResolution) = let maybeAppliedArgExpr = DelayedItem.maybeAppliedArgForPreferExtensionOverProperty delayed ResolveLongIdentAsExprAndComputeRange cenv.tcSink cenv.nameResolver (rangeOfLid longId) ad env.eNameResEnv typeNameResInfo longId maybeAppliedArgExpr |> ForceRaise - TcItemThen cenv overallTy env tpenv (tinstEnclosing, item, mItem, rest, afterResolution) None delayed + TcItemThen cenv overallTy env tpenv (tinstEnclosing, item, mItem, mItemIdent, rest, afterResolution) None delayed //------------------------------------------------------------------------- // Typecheck "item+projections" //------------------------------------------------------------------------- *) // mItem is the textual range covered by the long identifiers that make up the item -and TcItemThen (cenv: cenv) (overallTy: OverallTy) env tpenv (tinstEnclosing, item, mItem, rest, afterResolution) staticTyOpt delayed = +// mItemIdent is the range of the terminal identifier (method/property name only) +and TcItemThen (cenv: cenv) (overallTy: OverallTy) env tpenv (tinstEnclosing, item, mItem, mItemIdent, rest, afterResolution) staticTyOpt delayed = let delayed = delayRest rest mItem delayed match item with // x where x is a union case or active pattern result tag. @@ -8892,7 +8893,7 @@ and TcItemThen (cenv: cenv) (overallTy: OverallTy) env tpenv (tinstEnclosing, it TcTypeItemThen cenv overallTy env nm ty tpenv mItem tinstEnclosing delayed | Item.MethodGroup (methodName, minfos, _) -> - TcMethodItemThen cenv overallTy env item methodName minfos tpenv mItem afterResolution staticTyOpt delayed + TcMethodItemThen cenv overallTy env item methodName minfos tpenv mItem mItemIdent afterResolution staticTyOpt delayed | Item.Trait traitInfo -> TcTraitItemThen cenv overallTy env None traitInfo tpenv mItem delayed @@ -9121,8 +9122,8 @@ and TcTypeItemThen (cenv: cenv) overallTy env nm ty tpenv mItem tinstEnclosing d let item = Item.Types(nm, [ty]) CallNameResolutionSink cenv.tcSink (mExprAndTypeArgs, env.NameEnv, item, emptyTyparInst, ItemOccurrence.Use, env.eAccessRights) let typeNameResInfo = GetLongIdentTypeNameInfo otherDelayed - let item, mItem, _, rest, afterResolution = ResolveExprDotLongIdentAndComputeRange cenv.tcSink cenv.nameResolver (unionRanges mExprAndTypeArgs mLongId) ad env.eNameResEnv ty longId typeNameResInfo IgnoreOverrides true None - TcItemThen cenv overallTy env tpenv ((argsOfAppTy g ty), item, mItem, rest, afterResolution) None otherDelayed + let item, mItem, mItemIdent, rest, afterResolution = ResolveExprDotLongIdentAndComputeRange cenv.tcSink cenv.nameResolver (unionRanges mExprAndTypeArgs mLongId) ad env.eNameResEnv ty longId typeNameResInfo IgnoreOverrides true None + TcItemThen cenv overallTy env tpenv ((argsOfAppTy g ty), item, mItem, mItemIdent, rest, afterResolution) None otherDelayed | DelayedTypeApp(tyargs, _mTypeArgs, mExprAndTypeArgs) :: _delayed' -> // A case where we have an incomplete name e.g. 'Foo.' - we still want to report it to VS! @@ -9142,13 +9143,13 @@ and TcTypeItemThen (cenv: cenv) overallTy env nm ty tpenv mItem tinstEnclosing d else error(Error(FSComp.SR.tcInvalidUseOfTypeName(), mItem)) -and TcMethodItemThen (cenv: cenv) overallTy env item methodName minfos tpenv mItem afterResolution staticTyOpt delayed = +and TcMethodItemThen (cenv: cenv) overallTy env item methodName minfos tpenv mItem mItemIdent afterResolution staticTyOpt delayed = let ad = env.eAccessRights // Static method calls Type.Foo(arg1, ..., argn) let meths = List.map (fun minfo -> minfo, None) minfos match delayed with | DelayedApp (atomicFlag, _, _, arg, mExprAndArg) :: otherDelayed -> - TcMethodApplicationThen cenv env overallTy None tpenv None [] mExprAndArg mItem methodName ad NeverMutates false meths afterResolution NormalValUse [arg] atomicFlag staticTyOpt otherDelayed + TcMethodApplicationThen cenv env overallTy None tpenv None [] mExprAndArg mItem mItemIdent methodName ad NeverMutates false meths afterResolution NormalValUse [arg] atomicFlag staticTyOpt otherDelayed | DelayedTypeApp(tys, mTypeArgs, mExprAndTypeArgs) :: otherDelayed -> @@ -9162,9 +9163,9 @@ and TcMethodItemThen (cenv: cenv) overallTy env item methodName minfos tpenv mIt match otherDelayed with | DelayedApp(atomicFlag, _, _, arg, mExprAndArg) :: otherDelayed -> - TcMethodApplicationThen cenv env overallTy None tpenv None [] mExprAndArg mItem methodName ad NeverMutates false [(minfoAfterStaticArguments, None)] afterResolution NormalValUse [arg] atomicFlag staticTyOpt otherDelayed + TcMethodApplicationThen cenv env overallTy None tpenv None [] mExprAndArg mItem mItemIdent methodName ad NeverMutates false [(minfoAfterStaticArguments, None)] afterResolution NormalValUse [arg] atomicFlag staticTyOpt otherDelayed | _ -> - TcMethodApplicationThen cenv env overallTy None tpenv None [] mExprAndTypeArgs mItem methodName ad NeverMutates false [(minfoAfterStaticArguments, None)] afterResolution NormalValUse [] ExprAtomicFlag.Atomic staticTyOpt otherDelayed + TcMethodApplicationThen cenv env overallTy None tpenv None [] mExprAndTypeArgs mItem mItemIdent methodName ad NeverMutates false [(minfoAfterStaticArguments, None)] afterResolution NormalValUse [] ExprAtomicFlag.Atomic staticTyOpt otherDelayed | None -> #endif @@ -9178,16 +9179,16 @@ and TcMethodItemThen (cenv: cenv) overallTy env item methodName minfos tpenv mIt match otherDelayed with | DelayedApp(atomicFlag, _, _, arg, mExprAndArg) :: otherDelayed -> - TcMethodApplicationThen cenv env overallTy None tpenv (Some tyargs) [] mExprAndArg mItem methodName ad NeverMutates false meths afterResolution NormalValUse [arg] atomicFlag staticTyOpt otherDelayed + TcMethodApplicationThen cenv env overallTy None tpenv (Some tyargs) [] mExprAndArg mItem mItemIdent methodName ad NeverMutates false meths afterResolution NormalValUse [arg] atomicFlag staticTyOpt otherDelayed | _ -> - TcMethodApplicationThen cenv env overallTy None tpenv (Some tyargs) [] mExprAndTypeArgs mItem methodName ad NeverMutates false meths afterResolution NormalValUse [] ExprAtomicFlag.Atomic staticTyOpt otherDelayed + TcMethodApplicationThen cenv env overallTy None tpenv (Some tyargs) [] mExprAndTypeArgs mItem mItemIdent methodName ad NeverMutates false meths afterResolution NormalValUse [] ExprAtomicFlag.Atomic staticTyOpt otherDelayed | _ -> #if !NO_TYPEPROVIDERS if not minfos.IsEmpty && minfos[0].ProvidedStaticParameterInfo.IsSome then error(Error(FSComp.SR.etMissingStaticArgumentsToMethod(), mItem)) #endif - TcMethodApplicationThen cenv env overallTy None tpenv None [] mItem mItem methodName ad NeverMutates false meths afterResolution NormalValUse [] ExprAtomicFlag.Atomic staticTyOpt delayed + TcMethodApplicationThen cenv env overallTy None tpenv None [] mItem mItem mItemIdent methodName ad NeverMutates false meths afterResolution NormalValUse [] ExprAtomicFlag.Atomic staticTyOpt delayed and TcCtorItemThen (cenv: cenv) overallTy env item nm minfos tinstEnclosing tpenv mItem afterResolution delayed = #if !NO_TYPEPROVIDERS @@ -9583,19 +9584,19 @@ and TcPropertyItemThen cenv overallTy env nm pinfos tpenv mItem afterResolution // x.P <- ... byref setter if isNil meths then error (Error (FSComp.SR.tcPropertyIsNotReadable nm, mItem)) - TcMethodApplicationThen cenv env overallTy None tpenv tyArgsOpt [] mItem mItem nm ad NeverMutates true meths afterResolution NormalValUse args ExprAtomicFlag.Atomic staticTyOpt delayed + TcMethodApplicationThen cenv env overallTy None tpenv tyArgsOpt [] mItem mItem mItem nm ad NeverMutates true meths afterResolution NormalValUse args ExprAtomicFlag.Atomic staticTyOpt delayed else let args = if pinfo.IsIndexer then args else [] if isNil meths then errorR (Error (FSComp.SR.tcPropertyCannotBeSet1 nm, mItem)) // Note: static calls never mutate a struct object argument - TcMethodApplicationThen cenv env overallTy None tpenv tyArgsOpt [] mStmt mItem nm ad NeverMutates true meths afterResolution NormalValUse (args@[expr2]) ExprAtomicFlag.NonAtomic staticTyOpt otherDelayed + TcMethodApplicationThen cenv env overallTy None tpenv tyArgsOpt [] mStmt mItem mItem nm ad NeverMutates true meths afterResolution NormalValUse (args@[expr2]) ExprAtomicFlag.NonAtomic staticTyOpt otherDelayed | _ -> // Static Property Get (possibly indexer) let meths = pinfos |> GettersOfPropInfos if isNil meths then error (Error (FSComp.SR.tcPropertyIsNotReadable nm, mItem)) // Note: static calls never mutate a struct object argument - TcMethodApplicationThen cenv env overallTy None tpenv tyArgsOpt [] mItem mItem nm ad NeverMutates true meths afterResolution NormalValUse args ExprAtomicFlag.Atomic staticTyOpt delayed + TcMethodApplicationThen cenv env overallTy None tpenv tyArgsOpt [] mItem mItem mItem nm ad NeverMutates true meths afterResolution NormalValUse args ExprAtomicFlag.Atomic staticTyOpt delayed and TcILFieldItemThen cenv overallTy env finfo tpenv mItem delayed = let g = cenv.g @@ -9721,10 +9722,10 @@ and TcLookupThen cenv overallTy env tpenv mObjExpr objExpr objExprTy longId dela CanonicalizePartialInferenceProblem cenv.css env.DisplayEnv mExprAndLongId (freeInTypeLeftToRight g false objExprTy) let maybeAppliedArgExpr = DelayedItem.maybeAppliedArgForPreferExtensionOverProperty delayed - let item, mItem, _mItemIdent, rest, afterResolution = ResolveExprDotLongIdentAndComputeRange cenv.tcSink cenv.nameResolver mExprAndLongId ad env.NameEnv objExprTy longId TypeNameResolutionInfo.Default findFlag false maybeAppliedArgExpr - TcLookupItemThen cenv overallTy env tpenv mObjExpr objExpr objExprTy delayed item mItem rest afterResolution + let item, mItem, mItemIdent, rest, afterResolution = ResolveExprDotLongIdentAndComputeRange cenv.tcSink cenv.nameResolver mExprAndLongId ad env.NameEnv objExprTy longId TypeNameResolutionInfo.Default findFlag false maybeAppliedArgExpr + TcLookupItemThen cenv overallTy env tpenv mObjExpr objExpr objExprTy delayed item mItem mItemIdent rest afterResolution -and TcLookupItemThen cenv overallTy env tpenv mObjExpr objExpr objExprTy delayed item mItem rest afterResolution = +and TcLookupItemThen cenv overallTy env tpenv mObjExpr objExpr objExprTy delayed item mItem mItemIdent rest afterResolution = let g = cenv.g let ad = env.eAccessRights let objArgs = [objExpr] @@ -9750,7 +9751,7 @@ and TcLookupItemThen cenv overallTy env tpenv mObjExpr objExpr objExprTy delayed let item = Item.MethodGroup(methodName, [minfoAfterStaticArguments], Some minfos[0]) CallNameResolutionSinkReplacing cenv.tcSink (mExprAndItem, env.NameEnv, item, [], ItemOccurrence.Use, env.eAccessRights) - TcMethodApplicationThen cenv env overallTy None tpenv None objArgs mExprAndItem mItem methodName ad mutates false [(minfoAfterStaticArguments, None)] afterResolution NormalValUse args atomicFlag None delayed + TcMethodApplicationThen cenv env overallTy None tpenv None objArgs mExprAndItem mItem mItemIdent methodName ad mutates false [(minfoAfterStaticArguments, None)] afterResolution NormalValUse args atomicFlag None delayed | None -> if not minfos.IsEmpty && minfos[0].ProvidedStaticParameterInfo.IsSome then error(Error(FSComp.SR.etMissingStaticArgumentsToMethod(), mItem)) @@ -9759,7 +9760,7 @@ and TcLookupItemThen cenv overallTy env tpenv mObjExpr objExpr objExprTy delayed let tyArgsOpt, tpenv = TcMemberTyArgsOpt cenv env tpenv tyArgsOpt let meths = minfos |> List.map (fun minfo -> minfo, None) - TcMethodApplicationThen cenv env overallTy None tpenv tyArgsOpt objArgs mExprAndItem mItem methodName ad mutates false meths afterResolution NormalValUse args atomicFlag None delayed + TcMethodApplicationThen cenv env overallTy None tpenv tyArgsOpt objArgs mExprAndItem mItem mItemIdent methodName ad mutates false meths afterResolution NormalValUse args atomicFlag None delayed | Item.Property (nm, pinfos, _) -> // Instance property @@ -9787,7 +9788,7 @@ and TcLookupItemThen cenv overallTy env tpenv mObjExpr objExpr objExprTy delayed errorR (Error (FSComp.SR.tcPropertyCannotBeSet1 nm, mItem)) // x.P <- ... byref setter if isNil meths then error (Error (FSComp.SR.tcPropertyIsNotReadable nm, mItem)) - TcMethodApplicationThen cenv env overallTy None tpenv tyArgsOpt objArgs mExprAndItem mItem nm ad PossiblyMutates true meths afterResolution NormalValUse args atomicFlag None delayed + TcMethodApplicationThen cenv env overallTy None tpenv tyArgsOpt objArgs mExprAndItem mItem mItemIdent nm ad PossiblyMutates true meths afterResolution NormalValUse args atomicFlag None delayed else if g.langVersion.SupportsFeature(LanguageFeature.RequiredPropertiesSupport) && pinfo.IsSetterInitOnly then @@ -9795,12 +9796,12 @@ and TcLookupItemThen cenv overallTy env tpenv mObjExpr objExpr objExprTy delayed let args = if pinfo.IsIndexer then args else [] let mut = (if isStructTy g (tyOfExpr g objExpr) then DefinitelyMutates else PossiblyMutates) - TcMethodApplicationThen cenv env overallTy None tpenv tyArgsOpt objArgs mStmt mItem nm ad mut true meths afterResolution NormalValUse (args @ [expr2]) atomicFlag None [] + TcMethodApplicationThen cenv env overallTy None tpenv tyArgsOpt objArgs mStmt mItem mItemIdent nm ad mut true meths afterResolution NormalValUse (args @ [expr2]) atomicFlag None [] | _ -> // Instance property getter let meths = GettersOfPropInfos pinfos if isNil meths then error (Error (FSComp.SR.tcPropertyIsNotReadable nm, mItem)) - TcMethodApplicationThen cenv env overallTy None tpenv tyArgsOpt objArgs mExprAndItem mItem nm ad PossiblyMutates true meths afterResolution NormalValUse args atomicFlag None delayed + TcMethodApplicationThen cenv env overallTy None tpenv tyArgsOpt objArgs mExprAndItem mItem mItemIdent nm ad PossiblyMutates true meths afterResolution NormalValUse args atomicFlag None delayed | Item.RecdField rfinfo -> // Get or set instance F# field or literal @@ -9961,6 +9962,7 @@ and TcMethodApplicationThen objArgs // The 'obj' arguments in obj.M(...) and obj.M, if any m // The range of the object argument or whole application. We immediately union this with the range of the arguments mItem // The range of the item that resolved to the method name + mItemIdent // The range of the terminal identifier (method name only) for error reporting methodName // string, name of the method ad // accessibility rights of the caller mut // what do we know/assume about whether this method will mutate or not? @@ -9988,7 +9990,7 @@ and TcMethodApplicationThen // Call the helper below to do the real checking let (expr, attributeAssignedNamedItems, delayed), tpenv = - TcMethodApplication false cenv env tpenv callerTyArgs objArgs mWholeExpr mItem methodName objTyOpt ad mut isProp meths afterResolution isSuperInit args exprTy staticTyOpt delayed + TcMethodApplication false cenv env tpenv callerTyArgs objArgs mWholeExpr mItem mItemIdent methodName objTyOpt ad mut isProp meths afterResolution isSuperInit args exprTy staticTyOpt delayed // Give errors if some things couldn't be assigned if not (isNil attributeAssignedNamedItems) then @@ -10373,6 +10375,7 @@ and TcMethodApplication objArgs mMethExpr // range of the entire method expression mItem + mItemIdent // range of the terminal identifier (method name only) for error reporting methodName (objTyOpt: TType option) ad @@ -10464,27 +10467,11 @@ and TcMethodApplication let result, errors = ResolveOverloadingForCall denv cenv.css mMethExpr methodName callerArgs ad postArgumentTypeCheckingCalledMethGroup true returnTy // Narrow the error range for unresolved overloading from the whole expression (mMethExpr) - // to just the method name. For instance calls like T.Instance.Method(""), mItem covers - // the entire "T.Instance.Method" range, so we compute the method-name-only range from - // the end of mItem and the method name length. See https://github.com/dotnet/fsharp/issues/14284. + // to the terminal identifier range (mItemIdent). See https://github.com/dotnet/fsharp/issues/14284. let errors = match errors with | ErrorResult(warns, UnresolvedOverloading(denvErr, callerArgsErr, failure, _mWide)) -> - let mMethodName = - let itemWidth = mItem.EndColumn - mItem.StartColumn - // Only narrow when the range is single-line and the method name fits within it. - // Generic constructors may have internal names longer than the source text - // (e.g., "ImmutableStack`1" vs source "ImmutableStack"). - if - mItem.StartLine = mItem.EndLine - && methodName.Length < itemWidth - && not (DoesIdentifierNeedBackticks methodName) - then - let startPos = mkPos mItem.EndLine (mItem.EndColumn - methodName.Length) - withStart startPos mItem - else - mItem - ErrorResult(warns, UnresolvedOverloading(denvErr, callerArgsErr, failure, mMethodName)) + ErrorResult(warns, UnresolvedOverloading(denvErr, callerArgsErr, failure, mItemIdent)) | other -> other match afterResolution, result with @@ -11706,7 +11693,7 @@ and TcAttributeEx canFail (cenv: cenv) (env: TcEnv) attrTgt attrEx (synAttr: Syn let meths = minfos |> List.map (fun minfo -> minfo, None) let afterResolution = ForNewConstructors cenv.tcSink env tyId.idRange methodName minfos let (expr, attributeAssignedNamedItems, _), _ = - TcMethodApplication true cenv env tpenv None [] mAttr mAttr methodName None ad PossiblyMutates false meths afterResolution NormalValUse [arg] (MustEqual ty) None [] + TcMethodApplication true cenv env tpenv None [] mAttr mAttr mAttr methodName None ad PossiblyMutates false meths afterResolution NormalValUse [arg] (MustEqual ty) None [] UnifyTypes cenv env mAttr ty (tyOfExpr g expr) diff --git a/src/Compiler/Checking/NameResolution.fs b/src/Compiler/Checking/NameResolution.fs index b9d63125006..3f4312a1b38 100644 --- a/src/Compiler/Checking/NameResolution.fs +++ b/src/Compiler/Checking/NameResolution.fs @@ -4203,14 +4203,14 @@ let private ResolveExprDotLongIdent (ncenv: NameResolver) m ad nenv ty (id: Iden /// `delayRest` computations, so we never narrow it. /// /// * `itemIdentRange` is the terminal identifier's own source range — the -/// piece the user perceives as "this item's name". It is used only inside -/// the name-resolution sink callbacks (above) for diagnostics and IDE -/// symbol-use reporting (Find Usages, symbol highlight, FSharpSymbolUse), -/// so error / IDE UI hits only the resolved name. Fixes #14284 and #3920. +/// piece the user perceives as "this item's name". It is used for +/// diagnostics (e.g. narrowing overload-error ranges to the method name), +/// name-resolution sink callbacks, and IDE symbol-use reporting (Find +/// Usages, symbol highlight, FSharpSymbolUse). Fixes #14284 and #3920. /// /// For `T.Instance.Method("")`: /// itemRange = `T.Instance.Method` (consumed by TcItemThen for tree construction) -/// itemIdentRange = `Method` (reported to IDE sinks only) +/// itemIdentRange = `Method` (reported to IDE sinks and diagnostics) let ComputeItemRange wholem (lid: Ident list) rest = let itemRange = match rest with diff --git a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/OverloadResolutionErrorRangeTests.fs b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/OverloadResolutionErrorRangeTests.fs index c2c1f28225c..35425a514fc 100644 --- a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/OverloadResolutionErrorRangeTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/OverloadResolutionErrorRangeTests.fs @@ -98,10 +98,10 @@ Available overloads: - member T.Method: double -> unit // Argument at index 1 doesn't match - member T.Method: int -> unit // Argument at index 1 doesn't match") ] -// Verify that backtick-escaped method names fall back to the full mItem range -// (methodName.Length doesn't account for backtick delimiters in source text) +// Verify that backtick-escaped method names are also correctly narrowed +// (itemIdentRange from ComputeItemRange includes the backtick delimiters) [] -let ``Issue 14284 - backtick-escaped method name falls back to full range`` () = +let ``Issue 14284 - backtick-escaped method name is narrowed to identifier`` () = FSharp """ type T() = @@ -115,7 +115,7 @@ T.Instance.``My Method``("") |> typecheck |> shouldFail |> withDiagnostics - [ (Error 41, Line 8, Col 1, Line 8, Col 25, "No overloads match for method 'My Method'. + [ (Error 41, Line 8, Col 12, Line 8, Col 25, "No overloads match for method 'My Method'. Known type of argument: string @@ -123,9 +123,9 @@ Available overloads: - member T.``My Method`` : double -> unit // Argument at index 1 doesn't match - member T.``My Method`` : int -> unit // Argument at index 1 doesn't match") ] -// Verify multiline method access falls back to mItem range +// Verify multiline method access is also correctly narrowed to the method name [] -let ``Issue 14284 - multiline method access falls back to mItem`` () = +let ``Issue 14284 - multiline method access narrows to method name`` () = FSharp """ type T() = From f7a06f3ee9d63c5d5e8b8042b4e31e558ace0a9b Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Tue, 19 May 2026 14:31:19 +0200 Subject: [PATCH 4/5] Simplify ComputeItemRange doc comment Address review feedback: reduce verbose doc comment to concise description of itemRange vs itemIdentRange distinction. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/Compiler/Checking/NameResolution.fs | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/src/Compiler/Checking/NameResolution.fs b/src/Compiler/Checking/NameResolution.fs index 13a683ab699..1b4db6740ae 100644 --- a/src/Compiler/Checking/NameResolution.fs +++ b/src/Compiler/Checking/NameResolution.fs @@ -4194,23 +4194,9 @@ let private ResolveExprDotLongIdent (ncenv: NameResolver) m ad nenv ty (id: Iden | _ -> ForceRaise adhocDotSearchAccessible -/// Returns a pair (itemRange, itemIdentRange): -/// -/// * `itemRange` is the structural range of the long identifier as consumed -/// by resolution — the whole-long-id span when `rest = []`, or the range -/// over the consumed prefix when `rest <> []`. This is used downstream in -/// `TcItemThen` for typed-tree expression ranges, sequence points, and -/// `delayRest` computations, so we never narrow it. -/// -/// * `itemIdentRange` is the terminal identifier's own source range — the -/// piece the user perceives as "this item's name". It is used for -/// diagnostics (e.g. narrowing overload-error ranges to the method name), -/// name-resolution sink callbacks, and IDE symbol-use reporting (Find -/// Usages, symbol highlight, FSharpSymbolUse). Fixes #14284 and #3920. -/// -/// For `T.Instance.Method("")`: -/// itemRange = `T.Instance.Method` (consumed by TcItemThen for tree construction) -/// itemIdentRange = `Method` (reported to IDE sinks and diagnostics) +/// Computes the range of the consumed long-identifier prefix (`itemRange`) and the +/// terminal identifier only (`itemIdentRange`). +/// `itemIdentRange` is used for diagnostics and sink reporting (see #14284, #3920). let ComputeItemRange wholem (lid: Ident list) rest = let itemRange = match rest with From b54543579a6535c519a6304e2ee4f62acba950dd Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Tue, 19 May 2026 16:16:36 +0200 Subject: [PATCH 5/5] Thread mItemIdent through constructor path and fix baselines - Add mItemIdentOpt parameter to TcCtorCall so that constructor overload-error diagnostics narrow to the terminal identifier (e.g. 'String' in 'System.String(...)'). - Pass mItemIdent from TcCtorItemThen to TcCtorCall so that the narrowing is applied when resolving constructor overloads. - Revert E_Slices01.bsl: synthetic GetSlice idents carry the whole-expression range so narrowing is a no-op. - Update E_LessThanDotOpenParen001.bsl: .(+++) correctly narrows to the operator identifier +++. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Checking/Expressions/CheckExpressions.fs | 19 ++++++++++--------- .../expressions/syntacticsugar/E_Slices01.bsl | 4 ++-- .../E_LessThanDotOpenParen001.bsl | 4 ++-- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/Compiler/Checking/Expressions/CheckExpressions.fs b/src/Compiler/Checking/Expressions/CheckExpressions.fs index c4bfbb51a9c..75dc33a41ef 100644 --- a/src/Compiler/Checking/Expressions/CheckExpressions.fs +++ b/src/Compiler/Checking/Expressions/CheckExpressions.fs @@ -6931,15 +6931,16 @@ and TcNewExpr cenv env tpenv objTy mObjTyOpt superInit arg mWholeExprOrObjTy = if not (isAppTy g objTy) && not (isAnyTupleTy g objTy) then error(Error(FSComp.SR.tcNamedTypeRequired(if superInit then "inherit" else "new"), mWholeExprOrObjTy)) let item = ForceRaise (ResolveObjectConstructor cenv.nameResolver env.DisplayEnv mWholeExprOrObjTy ad objTy) - TcCtorCall false cenv env tpenv (MustEqual objTy) objTy mObjTyOpt item superInit [arg] mWholeExprOrObjTy [] None + TcCtorCall false cenv env tpenv (MustEqual objTy) objTy mObjTyOpt item superInit [arg] mWholeExprOrObjTy [] None None /// Check an 'inheritedTys declaration in an implicit or explicit class -and TcCtorCall isNaked cenv env tpenv (overallTy: OverallTy) objTy mObjTyOpt item superInit args mWholeCall delayed afterTcOverloadResolutionOpt = +and TcCtorCall isNaked cenv env tpenv (overallTy: OverallTy) objTy mObjTyOpt item superInit args mWholeCall delayed afterTcOverloadResolutionOpt mItemIdentOpt = let g = cenv.g let ad = env.AccessRights let isSuperInit = (if superInit then CtorValUsedAsSuperInit else NormalValUse) let mItem = match mObjTyOpt with Some m -> m | None -> mWholeCall + let mItemIdent = match mItemIdentOpt with Some m -> m | None -> mItem if isInterfaceTy g objTy then error(Error((if superInit then FSComp.SR.tcInheritCannotBeUsedOnInterfaceType() else FSComp.SR.tcNewCannotBeUsedOnInterfaceType()), mWholeCall)) @@ -6968,7 +6969,7 @@ and TcCtorCall isNaked cenv env tpenv (overallTy: OverallTy) objTy mObjTyOpt ite | Some mObjTy, None -> ForNewConstructors cenv.tcSink env mObjTy methodName minfos | None, _ -> AfterResolution.DoNothing - TcMethodApplicationThen cenv env overallTy (Some objTy) tpenv None [] mWholeCall mItem mItem methodName ad PossiblyMutates false meths afterResolution isSuperInit args ExprAtomicFlag.NonAtomic None delayed + TcMethodApplicationThen cenv env overallTy (Some objTy) tpenv None [] mWholeCall mItem mItemIdent methodName ad PossiblyMutates false meths afterResolution isSuperInit args ExprAtomicFlag.NonAtomic None delayed | Item.DelegateCtor ty, [arg] -> // Re-record the name resolution since we now know it's a constructor call @@ -8899,7 +8900,7 @@ and TcItemThen (cenv: cenv) (overallTy: OverallTy) env tpenv (tinstEnclosing, it TcTraitItemThen cenv overallTy env None traitInfo tpenv mItem delayed | Item.CtorGroup(nm, minfos) -> - TcCtorItemThen cenv overallTy env item nm minfos tinstEnclosing tpenv mItem afterResolution delayed + TcCtorItemThen cenv overallTy env item nm minfos tinstEnclosing tpenv mItem mItemIdent afterResolution delayed | Item.ImplicitOp(id, sln) -> TcImplicitOpItemThen cenv overallTy env id sln tpenv mItem delayed @@ -9190,7 +9191,7 @@ and TcMethodItemThen (cenv: cenv) overallTy env item methodName minfos tpenv mIt #endif TcMethodApplicationThen cenv env overallTy None tpenv None [] mItem mItem mItemIdent methodName ad NeverMutates false meths afterResolution NormalValUse [] ExprAtomicFlag.Atomic staticTyOpt delayed -and TcCtorItemThen (cenv: cenv) overallTy env item nm minfos tinstEnclosing tpenv mItem afterResolution delayed = +and TcCtorItemThen (cenv: cenv) overallTy env item nm minfos tinstEnclosing tpenv mItem mItemIdent afterResolution delayed = #if !NO_TYPEPROVIDERS let g = cenv.g let ad = env.eAccessRights @@ -9204,7 +9205,7 @@ and TcCtorItemThen (cenv: cenv) overallTy env item nm minfos tinstEnclosing tpen | DelayedApp(_, _, _, arg, mExprAndArg) :: otherDelayed -> CallExprHasTypeSink cenv.tcSink (mExprAndArg, env.NameEnv, objTy, env.eAccessRights) - TcCtorCall true cenv env tpenv overallTy objTy (Some mItem) item false [arg] mExprAndArg otherDelayed (Some afterResolution) + TcCtorCall true cenv env tpenv overallTy objTy (Some mItem) item false [arg] mExprAndArg otherDelayed (Some afterResolution) (Some mItemIdent) | DelayedTypeApp(tyargs, _mTypeArgs, mExprAndTypeArgs) :: DelayedApp(_, _, _, arg, mExprAndArg) :: otherDelayed -> @@ -9225,7 +9226,7 @@ and TcCtorItemThen (cenv: cenv) overallTy env item nm minfos tinstEnclosing tpen item, minfos minfosAfterTyArgs |> List.iter (fun minfo -> UnifyTypes cenv env mExprAndTypeArgs minfo.ApparentEnclosingType objTyAfterTyArgs) - TcCtorCall true cenv env tpenv overallTy objTyAfterTyArgs (Some mExprAndTypeArgs) itemAfterTyArgs false [arg] mExprAndArg otherDelayed (Some afterResolution) + TcCtorCall true cenv env tpenv overallTy objTyAfterTyArgs (Some mExprAndTypeArgs) itemAfterTyArgs false [arg] mExprAndArg otherDelayed (Some afterResolution) (Some mItemIdent) | DelayedTypeApp(tyargs, _mTypeArgs, mExprAndTypeArgs) :: otherDelayed -> @@ -9236,11 +9237,11 @@ and TcCtorItemThen (cenv: cenv) overallTy env item nm minfos tinstEnclosing tpen CallNameResolutionSink cenv.tcSink (mExprAndTypeArgs, env.NameEnv, resolvedItem, emptyTyparInst, ItemOccurrence.Use, env.eAccessRights) minfos |> List.iter (fun minfo -> UnifyTypes cenv env mExprAndTypeArgs minfo.ApparentEnclosingType objTy) - TcCtorCall true cenv env tpenv overallTy objTy (Some mExprAndTypeArgs) item false [] mExprAndTypeArgs otherDelayed (Some afterResolution) + TcCtorCall true cenv env tpenv overallTy objTy (Some mExprAndTypeArgs) item false [] mExprAndTypeArgs otherDelayed (Some afterResolution) (Some mItemIdent) | _ -> - TcCtorCall true cenv env tpenv overallTy objTy (Some mItem) item false [] mItem delayed (Some afterResolution) + TcCtorCall true cenv env tpenv overallTy objTy (Some mItem) item false [] mItem delayed (Some afterResolution) (Some mItemIdent) and TcTraitItemThen (cenv: cenv) overallTy env objOpt traitInfo tpenv mItem delayed = let g = cenv.g diff --git a/tests/fsharp/conformance/expressions/syntacticsugar/E_Slices01.bsl b/tests/fsharp/conformance/expressions/syntacticsugar/E_Slices01.bsl index ca02e74d09b..6cb4c4dde0b 100644 --- a/tests/fsharp/conformance/expressions/syntacticsugar/E_Slices01.bsl +++ b/tests/fsharp/conformance/expressions/syntacticsugar/E_Slices01.bsl @@ -1,5 +1,5 @@ -E_Slices01.fsx(15,11,15,19): typecheck error FS0041: A unique overload for method 'GetSlice' could not be determined based on type information prior to this program point. A type annotation may be needed. +E_Slices01.fsx(15,9,15,19): typecheck error FS0041: A unique overload for method 'GetSlice' could not be determined based on type information prior to this program point. A type annotation may be needed. Known types of arguments: int * int option * 'a option @@ -15,7 +15,7 @@ Candidates: - member Foo.GetSlice: x: int * y1: int option * y2: float option -> unit - member Foo.GetSlice: x: int * y1: int option * y2: int option -> unit -E_Slices01.fsx(17,11,17,19): typecheck error FS0041: A unique overload for method 'GetSlice' could not be determined based on type information prior to this program point. A type annotation may be needed. +E_Slices01.fsx(17,9,17,19): typecheck error FS0041: A unique overload for method 'GetSlice' could not be determined based on type information prior to this program point. A type annotation may be needed. Known types of arguments: 'a option * int option * int diff --git a/tests/fsharp/conformance/lexicalanalysis/E_LessThanDotOpenParen001.bsl b/tests/fsharp/conformance/lexicalanalysis/E_LessThanDotOpenParen001.bsl index 0b076cf0e3a..a49c97ff4e9 100644 --- a/tests/fsharp/conformance/lexicalanalysis/E_LessThanDotOpenParen001.bsl +++ b/tests/fsharp/conformance/lexicalanalysis/E_LessThanDotOpenParen001.bsl @@ -11,7 +11,7 @@ Available overloads: - static member TestType.(+++) : a: TestType<'T,'S> * b: ('T -> 'S) -> 'T // Argument 'a' doesn't match - static member TestType.(+++) : a: TestType<'T,'S> * b: TestType<'T,'S> -> 'T // Argument 'a' doesn't match -E_LessThanDotOpenParen001.fsx(25,22,25,37): typecheck error FS0041: No overloads match for method 'op_PlusPlusPlus'. +E_LessThanDotOpenParen001.fsx(25,33,25,36): typecheck error FS0041: No overloads match for method 'op_PlusPlusPlus'. Known types of arguments: (string -> int) * TestType @@ -21,7 +21,7 @@ Available overloads: - static member TestType.(+++) : a: TestType<'T,'S> * b: ('T -> 'S) -> 'T // Argument 'a' doesn't match - static member TestType.(+++) : a: TestType<'T,'S> * b: TestType<'T,'S> -> 'T // Argument 'a' doesn't match -E_LessThanDotOpenParen001.fsx(26,22,26,37): typecheck error FS0041: No overloads match for method 'op_PlusPlusPlus'. +E_LessThanDotOpenParen001.fsx(26,33,26,36): typecheck error FS0041: No overloads match for method 'op_PlusPlusPlus'. Known types of arguments: (string -> int) * TestType