From acd7cfd2513e0ec9aeca7e64a33ebf1717956a26 Mon Sep 17 00:00:00 2001 From: Gauthier Segay Date: Wed, 19 Feb 2020 01:40:22 +0100 Subject: [PATCH] improve compiler error message for failed overload resolution (#6596) * migrate (as a separate copy) fsharpqa tests that are going to be impacted by #6596 the baseline files are empty on purpose, expecting CI failure reporting those tests, I intend to update the baseline and clean up the comments / xml tags from fsharpqa syntax in later commit, and then remove those specific tests altogether from fsharpqa if this is OK with the maintainers. * update the .bsl files * remove comments that are handled by baseline files, update baseline files * remove the migrated tests from fsharpqa tests * need to be more careful when migrating those * testing if running the test with .fs instead of .fsx makes them work on .netcore * exclude migrated fsharpqa from dotnet core run * sample test in fsharpqa (can't run locally for now) * trying to make it green now. * checking if this path is covered by a test, trying to identify how to trigger this other overload related error message * * [MethodCalls.fs] Defining CallerArgs<'T> in, this replaces passing of callerArgsCount, uncurriedCallerArgs and other variants in the overload resolution logic happening in ConstraintSolver & TypeChecker * [TypeChecker.fs] pass CallerArgs instace at call sites for overload resolution + some commented code as we'll be building a list of given argument types (probably moving as a CallerArgs method or property) * [ConstraintSolver.fs/fsi] pipe the overload resolution traced callback to `trace.CollectThenUndoOrCommit` as that expression is long and more important in that context * bit of refactoring of error message building logic during failed overload resolution [ConstraintSolver.fsi] * define OverloadInformation and OverloadResolutionFailure, those replace workflow where `string * ((CalledMeth<_> * exn) list)` values were created at call site mixed with message building and matched later in non obvious fashion in `failOverloading` closure * adjust UnresolvedOverloading and PossibleOverload exceptions [ConstraintSolver.fs] * get rid of `GetPossibleOverloads`, this was used only in `failOverloading` closure, and just being passed the same parameters at call site * give `failOverloading` a more meaningful signature and consolidate the prefix message building logic there * fix `failOverloading` call sites [CompilerOps.fs] adjust pattern matching Expecting behaviour of this code to be identical as before PR ` * (buildfix) harmonizing .fsi/.fs right before commit doesn't always work with simple copy paste. * trying to check what kind of things break loose when I change this I'm trying to identify why we get `(CalledMeth * exn list)`, I'm making a cartesian product through getMethodSlotsAndErrors for now, trying to figure out if we can get other than 0 or 1 exception in the list for a given method slot. I may revert that one if it doesn't make sense make from a reviewer standpoint and/or breaks fsharpqa tests surounding overload resolution error messages. * (minor) [ConstraintSolver.fs] revert space mishapps to reduce diff, put back comments where they were * toward displaying the argument names properly (may fail some fsharpqa tests for now) * missing Resharper's Ctrl+Alt+V "introduce variable" refactoring @auduchinok :) * pretty print unresolved overloads without all the type submsumption per overload verbose messages * Overload resolution error messages: things display like I want in fsi, almost like I want in VS2019, this is for the simple non generic method overload case. I want to check if user experience changes wrt https://github.com/Microsoft/visualfsharp/issues/2503 and put some time to add tests. * adjust message for candidates overload * Hijack the split phase for UnresolvedOverloading, remove the match on PossibleOverload. It consolidates some more of the string building logic, and it now shows as a single compact and exhaustive error message in VS Thinking I'll change PossibleOverload to not be an exception if going this way is OK * updating existing failing baseline files that looks correct to me * quickfix for update.base.line.with.actuals.fsx so that it skips missing base line files in the loop * (minor) minimize diff, typos, comments * fix vsintegration tests affected by overload error message changes * merge issue unused variable warning * update the 12 fsharpqa migrated baseline with new error messages * (minor) baseline update script [update.base.line.with.actuals.fsx] * add few directories * error handling (when tests are running, the .err files are locked * move System.Convert.ToString and System.Threading.Tasks.Task.Run tests from QA * * moving 3 fsharpqa tests to new test suite * bring back neg_System.Convert.ToString.OverloadList.fsx which I mistakenly removed during merge * consolidate all string building logic in CompileOps.fs, fix remaining cases with missing \n (the end result code is less whack-a-mole-ish) * update base lines * remove the migrated tests from fsharpqa * fix vstest error message * fix env.lst, removed wrong one... * update baselines of remaining tests * adding one simple test with many overloads * appropriate /// comments on `CalledMeth` constructor arguments * minimize diff / formatting * trim unused code * add simple test, one message is interesting, mentioning parameter count for possible overloads * comment flaky test for now * code review on the `coerceExpr` function from @tihan, we can discard first `isOutArg` argument as the only hardcoded usage was guarded by `error` when the value is true, and passing an explicit false which is now guaranteed equivalent to `callerArg.IsOptional` * code formatting remarks on ConstraintSolver.fs/fsi * (minor) formatting * format known argument type / updating .bsl * update missing baseline * update missing baselines * update missing baseline * minor: make TTrait better in debugger display * [wip] pass TraitConstraintInfo around failed overload resolution error, and try to display some of it's info * minimize diff * signature file mismatch * removing duplicate in fscomp.txt * surfacing initial bits of TraitConstraintInfo, roughly for now * formatting types of known argument in one go, the formatting is still wrong: * unamed type arguments aren't relabelled (still show their numerical ids) * SRTP constraints are dismissed, not sure how they should be lined up to pass to SimplifyTypes.CollectInfo * rework of overload failure message to prettify *ALL* types in a single go, not only argument types, but return types and known generic argument types (this info was never displayed originally but is useful for scenario similar to FSharpPlus implementation) added `PrettifyDiscriminantAndTypePairs` in TastOps, this allow to weave extra information with the complete list of types, to help reconstituting the several types from their origin (in the usage spot: argument types, return type, generic parameter types) * fixup the tests and add two tests * one checking on the new information of known return type and generic parameter types * one checking we don't leak internal unammed Typar and that they don't all get named 'a despite being different * updating baselines that got tighter. * simplify handling of TraitConstraintInfo * naming couple of fields and turning a property to a methods as it triggers an assert in debugger when inspecting variables * comments in the assembling of overload resolution error message * Add information about which argument doesn't match Add couple of tests Updating bunch of baselines * minor updates to testguide and devguide * fix PrimitiveConstraints.``Invalid object constructor`` test * fix(?) salsa tests * minimize diff * put back tests under !FSHARP_SUITE_DRIVES_CORECLR_TESTS * missing updated message * minor adjustments to TESTGUIDE.md * return type was missing prettifying in prettyLayoutsOfUnresolvedOverloading * address code review nits / minimize diff / add comment on PrettifyDiscriminantAndTypePairs * minimize diff * proposed work around the flaky error message until https://github.com/dotnet/fsharp/issues/6725 has a fix we keep the fsharpqa test around (but removing the overload error messages from what is asserted out of it) in the meantime * fixing baselines of new tests from master * sisyphus round of baseline update * removing type which isn't in use and popped back up after rebase * minimize diff * tidy inconsistent tuple literal * * removing TTrait properties that end up not being used * renaming tys and returnTy fields to better match convention (`tys` is used, so no underscore prefix) * minimizing diff * minimize diff * minimize diff * minimize diff * link to usage example in same file * revert converting CallerArg single cased DU into Record * minimize diff * minimize diff * minimize diff * fix rebase glitches * fix rebase glitch * update baseline * fix base lines / new tests base lines * edge case: needs a new line after "A unique overload for method '%s' could not be determined based on type information prior to this program point. A type annotation may be needed." if there are no optional parts. * updating base line for edge case of missing new line * missing baseline * removing comment --- DEVGUIDE.md | 2 +- TESTGUIDE.md | 20 +- src/fsharp/CompileOps.fs | 105 +++++- src/fsharp/ConstraintSolver.fs | 127 ++++--- src/fsharp/ConstraintSolver.fsi | 29 +- src/fsharp/FSComp.txt | 18 +- src/fsharp/FSStrings.resx | 3 - src/fsharp/MethodCalls.fs | 64 +++- src/fsharp/NicePrint.fs | 130 +++++-- src/fsharp/TastOps.fs | 5 + src/fsharp/TastOps.fsi | 5 + src/fsharp/TypeChecker.fs | 8 +- src/fsharp/tast.fs | 4 +- tests/fsharp/Compiler/CompilerAssert.fs | 31 ++ .../ConstraintSolver/PrimitiveConstraints.fs | 18 +- .../expressions/syntacticsugar/E_Slices01.bsl | 38 +- .../expressions/syntacticsugar/E_Slices01.fsx | 7 - .../E_RigidTypeAnnotation03.bsl | 70 ++++ .../E_RigidTypeAnnotation03.fsx | 0 .../E_LeftToRightOverloadResolution01.bsl | 38 +- .../inference/E_OneTypeVariable03.bsl | 17 +- .../inference/E_OneTypeVariable03rec.bsl | 17 +- .../E_TwoDifferentTypeVariables01.bsl | 32 +- .../E_TwoDifferentTypeVariables01rec.bsl | 32 +- .../E_TwoDifferentTypeVariablesGen00.bsl | 56 +++ .../E_TwoDifferentTypeVariablesGen00.fsx | 69 ++++ .../E_TwoDifferentTypeVariablesGen00rec.bsl | 24 +- .../inference/E_TwoEqualTypeVariables02.bsl | 51 ++- .../E_TwoEqualYypeVariables02rec.bsl | 51 ++- .../E_LessThanDotOpenParen001.bsl | 32 ++ .../E_LessThanDotOpenParen001.fsx | 26 ++ .../E_Clashing_Values_in_AbstractClass01.bsl | 5 +- .../E_Clashing_Values_in_AbstractClass03.bsl | 16 +- .../E_Clashing_Values_in_AbstractClass04.bsl | 16 +- .../compilation.errors.output.bsl | 199 ++++++++-- .../compilation.langversion.old.output.bsl | 5 +- tests/fsharp/readme.md | 6 +- tests/fsharp/test-framework.fs | 4 +- tests/fsharp/tests.fs | 42 ++- .../constructors/neg_invalid_constructor.bsl | 22 ++ .../constructors/neg_invalid_constructor.fs | 7 + ...g_System.Convert.ToString.OverloadList.bsl | 56 +++ ...g_System.Convert.ToString.OverloadList.fsx | 4 + ...ing.Graphics.DrawRectangleOverloadList.bsl | 16 + ...ing.Graphics.DrawRectangleOverloadList.fsx | 10 + ....Threading.Tasks.Task.Run.OverloadList.bsl | 48 +++ ....Threading.Tasks.Task.Run.OverloadList.fsx | 14 + .../neg_generic_known_argument_types.bsl | 8 + .../neg_generic_known_argument_types.fsx | 10 + .../overloads/neg_interface_generics.bsl | 10 + .../overloads/neg_interface_generics.fsx | 21 ++ ...n_return_type_and_known_type_arguments.bsl | 26 ++ ...n_return_type_and_known_type_arguments.fsx | 90 +++++ .../overloads/neg_many_many_overloads.bsl | 348 ++++++++++++++++++ .../overloads/neg_many_many_overloads.fsx | 126 +++++++ .../overloads/neg_tupled_arguments.bsl | 18 + .../overloads/neg_tupled_arguments.fsx | 14 + tests/fsharp/typecheck/sigs/neg06.bsl | 8 +- tests/fsharp/typecheck/sigs/neg106.bsl | 134 ++----- tests/fsharp/typecheck/sigs/neg106.vsbsl | 134 ++----- tests/fsharp/typecheck/sigs/neg116.bsl | 20 +- tests/fsharp/typecheck/sigs/neg117.bsl | 20 +- tests/fsharp/typecheck/sigs/neg119.bsl | 32 +- tests/fsharp/typecheck/sigs/neg120.bsl | 38 +- tests/fsharp/typecheck/sigs/neg124.bsl | 56 +-- tests/fsharp/typecheck/sigs/neg125.bsl | 273 +++++++++++++- tests/fsharp/typecheck/sigs/neg127.bsl | 273 +++++++++++++- tests/fsharp/typecheck/sigs/neg128.bsl | 21 +- tests/fsharp/typecheck/sigs/neg129.bsl | 21 +- tests/fsharp/typecheck/sigs/neg20.bsl | 71 ++-- tests/fsharp/typecheck/sigs/neg45.bsl | 24 +- tests/fsharp/typecheck/sigs/neg61.bsl | 18 +- tests/fsharp/typecheck/sigs/neg_byref_13.bsl | 2 +- .../fsharp/update.base.line.with.actuals.fsx | 27 -- .../Type-relatedExpressions/env.lst | 1 - .../E_TwoDifferentTypeVariablesGen00.fs | 120 ------ .../InferenceProcedures/TypeInference/env.lst | 1 - .../E_LessThanDotOpenParen001.fs | 5 +- tests/scripts/update-baselines.fsx | 8 +- .../Tests.LanguageService.ErrorList.fs | 63 +++- 80 files changed, 2828 insertions(+), 812 deletions(-) create mode 100644 tests/fsharp/conformance/expressions/type-relatedexpressions/E_RigidTypeAnnotation03.bsl rename tests/{fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions => fsharp/conformance/expressions/type-relatedexpressions}/E_RigidTypeAnnotation03.fsx (100%) create mode 100644 tests/fsharp/conformance/inference/E_TwoDifferentTypeVariablesGen00.bsl create mode 100644 tests/fsharp/conformance/inference/E_TwoDifferentTypeVariablesGen00.fsx create mode 100644 tests/fsharp/conformance/lexicalanalysis/E_LessThanDotOpenParen001.bsl create mode 100644 tests/fsharp/conformance/lexicalanalysis/E_LessThanDotOpenParen001.fsx create mode 100644 tests/fsharp/typecheck/constructors/neg_invalid_constructor.bsl create mode 100644 tests/fsharp/typecheck/constructors/neg_invalid_constructor.fs create mode 100644 tests/fsharp/typecheck/overloads/neg_System.Convert.ToString.OverloadList.bsl create mode 100644 tests/fsharp/typecheck/overloads/neg_System.Convert.ToString.OverloadList.fsx create mode 100644 tests/fsharp/typecheck/overloads/neg_System.Drawing.Graphics.DrawRectangleOverloadList.bsl create mode 100644 tests/fsharp/typecheck/overloads/neg_System.Drawing.Graphics.DrawRectangleOverloadList.fsx create mode 100644 tests/fsharp/typecheck/overloads/neg_System.Threading.Tasks.Task.Run.OverloadList.bsl create mode 100644 tests/fsharp/typecheck/overloads/neg_System.Threading.Tasks.Task.Run.OverloadList.fsx create mode 100644 tests/fsharp/typecheck/overloads/neg_generic_known_argument_types.bsl create mode 100644 tests/fsharp/typecheck/overloads/neg_generic_known_argument_types.fsx create mode 100644 tests/fsharp/typecheck/overloads/neg_interface_generics.bsl create mode 100644 tests/fsharp/typecheck/overloads/neg_interface_generics.fsx create mode 100644 tests/fsharp/typecheck/overloads/neg_known_return_type_and_known_type_arguments.bsl create mode 100644 tests/fsharp/typecheck/overloads/neg_known_return_type_and_known_type_arguments.fsx create mode 100644 tests/fsharp/typecheck/overloads/neg_many_many_overloads.bsl create mode 100644 tests/fsharp/typecheck/overloads/neg_many_many_overloads.fsx create mode 100644 tests/fsharp/typecheck/overloads/neg_tupled_arguments.bsl create mode 100644 tests/fsharp/typecheck/overloads/neg_tupled_arguments.fsx delete mode 100644 tests/fsharp/update.base.line.with.actuals.fsx delete mode 100644 tests/fsharpqa/Source/Conformance/InferenceProcedures/TypeInference/E_TwoDifferentTypeVariablesGen00.fs diff --git a/DEVGUIDE.md b/DEVGUIDE.md index 5c6f51c3c8e..712ac7eb5f0 100644 --- a/DEVGUIDE.md +++ b/DEVGUIDE.md @@ -45,7 +45,7 @@ Building is simple: Desktop tests can be run with: - build.cmd -test + build.cmd -test -c Release After you build the first time you can open and use this solution in Visual Studio: diff --git a/TESTGUIDE.md b/TESTGUIDE.md index f658b443c1d..f166588309f 100644 --- a/TESTGUIDE.md +++ b/TESTGUIDE.md @@ -4,11 +4,17 @@ To run tests, use variations such as the following, depending on which test suite and build configuration you want: - build.cmd test - build.cmd net40 test - build.cmd coreclr test - build.cmd vs test - build.cmd all test + .\build -testAll -c Release + .\build -test -c Release + .\build -testCambridge -c Release + .\build -testCompiler -c Release + .\build -testDependencyManager -c Release + .\build -testDesktop -c Release + .\build -testCoreClr -c Release + .\build -testFSharpCore -c Release + .\build -testFSharpQA -c Release + .\build -testScripting -c Release + .\build -testVs -c Release You can also submit pull requests to https://github.com/dotnet/fsharp and run the tests via continuous integration. Most people do wholesale testing that way. @@ -48,7 +54,7 @@ There are also negative tests checking code expected to fail compilation. See no The FSharpQA suite relies on [Perl](http://www.perl.org/get.html), StrawberryPerl package from nuget is used automatically by the test suite. -These tests use the `RunAll.pl` framework to execute, however the easiest way to run them is via the `build.cmd` script, see [usage examples](https://github.com/Microsoft/visualfsharp/blob/master/build.cmd#L31). +These tests use the `RunAll.pl` framework to execute, however the easiest way to run them is via the `.\build` script, see [usage examples](#quick-start-running-tests). Tests are grouped in folders per area. Each folder contains a number of source code files and a single `env.lst` file. The `env.lst` file defines a series of test cases, one per line. @@ -66,7 +72,7 @@ For the FSharpQA suite, the list of test areas and their associated "tags" is st Tags are in the left column, paths to to corresponding test folders are in the right column. If no tags are specified, all tests will be run. -If you want to re-run a particular test area, the easiest way to do so is to set a temporary tag for that area in test.lst (e.g. "RERUN") and then pass that as an argument to `build.cmd`: `build.cmd test-net40-fsharpqa include RERUN`. +If you want to re-run a particular test area, the easiest way to do so is to set a temporary tag for that area in test.lst (e.g. "RERUN") and adjust `ttags` [run.fsharpqa.test.fsx script](tests/fsharpqa/run.fsharpqa.test.fsx) and run it. ### FSharp.Compiler.UnitTests, FSharp.Core.UnitTests, VisualFSharp.UnitTests diff --git a/src/fsharp/CompileOps.fs b/src/fsharp/CompileOps.fs index b949a475cb7..ff1dce25a37 100644 --- a/src/fsharp/CompileOps.fs +++ b/src/fsharp/CompileOps.fs @@ -188,7 +188,6 @@ let GetRangeOfDiagnostic(err: PhasedDiagnostic) = | NameClash(_, _, _, m, _, _, _) | UnresolvedOverloading(_, _, _, m) | UnresolvedConversionOperator (_, _, _, m) - | PossibleOverload(_, _, _, m) | VirtualAugmentationOnNullValuedType m | NonVirtualAugmentationOnNullValuedType m | NonRigidTypar(_, _, _, _, _, m) @@ -403,12 +402,9 @@ let warningOn err level specificWarnOn = | 3180 -> false // abImplicitHeapAllocation - off by default | _ -> level >= GetWarningLevel err -let SplitRelatedDiagnostics(err: PhasedDiagnostic) = +let SplitRelatedDiagnostics(err: PhasedDiagnostic) : PhasedDiagnostic * PhasedDiagnostic list = let ToPhased e = {Exception=e; Phase = err.Phase} let rec SplitRelatedException = function - | UnresolvedOverloading(a, overloads, b, c) -> - let related = overloads |> List.map ToPhased - UnresolvedOverloading(a, [], b, c)|>ToPhased, related | ConstraintSolverRelatedInformation(fopt, m2, e) -> let e, related = SplitRelatedException e ConstraintSolverRelatedInformation(fopt, m2, e.Exception)|>ToPhased, related @@ -452,7 +448,6 @@ let ErrorFromApplyingDefault2E() = DeclareResourceString("ErrorFromApplyingDefau let ErrorsFromAddingSubsumptionConstraintE() = DeclareResourceString("ErrorsFromAddingSubsumptionConstraint", "%s%s%s") let UpperCaseIdentifierInPatternE() = DeclareResourceString("UpperCaseIdentifierInPattern", "") let NotUpperCaseConstructorE() = DeclareResourceString("NotUpperCaseConstructor", "") -let PossibleOverloadE() = DeclareResourceString("PossibleOverload", "%s%s") let FunctionExpectedE() = DeclareResourceString("FunctionExpected", "") let BakedInMemberConstraintNameE() = DeclareResourceString("BakedInMemberConstraintName", "%s") let BadEventTransformationE() = DeclareResourceString("BadEventTransformation", "") @@ -770,20 +765,100 @@ let OutputPhasedErrorR (os: StringBuilder) (err: PhasedDiagnostic) (canSuggestNa os.Append(e.ContextualErrorMessage) |> ignore #endif - | UnresolvedOverloading(_, _, mtext, _) -> - os.Append mtext |> ignore + | UnresolvedOverloading(denv, callerArgs, failure, m) -> + + // extract eventual information (return type and type parameters) + // from ConstraintTraitInfo + let knownReturnType, genericParameterTypes = + match failure with + | NoOverloadsFound (cx=Some cx) + | PossibleCandidates (cx=Some cx) -> cx.ReturnType, cx.ArgumentTypes + | _ -> None, [] + + // prepare message parts (known arguments, known return type, known generic parameters) + let argsMessage, returnType, genericParametersMessage = + + let retTy = + knownReturnType + |> Option.defaultValue (TType.TType_var (Typar.NewUnlinked())) + + let argRepr = + callerArgs.ArgumentNamesAndTypes + |> List.map (fun (name,tTy) -> tTy, {ArgReprInfo.Name = name |> Option.map (fun name -> Ident(name, range.Zero)); ArgReprInfo.Attribs = []}) + + let argsL,retTyL,genParamTysL = NicePrint.prettyLayoutsOfUnresolvedOverloading denv argRepr retTy genericParameterTypes + + match callerArgs.ArgumentNamesAndTypes with + | [] -> None, Layout.showL retTyL, Layout.showL genParamTysL + | items -> + let args = Layout.showL argsL + let prefixMessage = + match items with + | [_] -> FSComp.SR.csNoOverloadsFoundArgumentsPrefixSingular + | _ -> FSComp.SR.csNoOverloadsFoundArgumentsPrefixPlural + Some (prefixMessage args) + , Layout.showL retTyL + , Layout.showL genParamTysL + + let knownReturnType = + match knownReturnType with + | None -> None + | Some _ -> Some (FSComp.SR.csNoOverloadsFoundReturnType returnType) + + let genericParametersMessage = + match genericParameterTypes with + | [] -> None + | [_] -> Some (FSComp.SR.csNoOverloadsFoundTypeParametersPrefixSingular genericParametersMessage) + | _ -> Some (FSComp.SR.csNoOverloadsFoundTypeParametersPrefixPlural genericParametersMessage) + + let overloadMethodInfo displayEnv m (x: OverloadInformation) = + let paramInfo = + match x.error with + | :? ArgDoesNotMatchError as x -> + let nameOrOneBasedIndexMessage = + x.calledArg.NameOpt + |> Option.map (fun n -> FSComp.SR.csOverloadCandidateNamedArgumentTypeMismatch n.idText) + |> Option.defaultValue (FSComp.SR.csOverloadCandidateIndexedArgumentTypeMismatch ((snd x.calledArg.Position) + 1)) + sprintf " // %s" nameOrOneBasedIndexMessage + | _ -> "" + + (NicePrint.stringOfMethInfo x.amap m displayEnv x.methodSlot.Method) + paramInfo + + let nl = System.Environment.NewLine + let formatOverloads (overloads: OverloadInformation list) = + overloads + |> List.map (overloadMethodInfo denv m) + |> List.sort + |> List.map FSComp.SR.formatDashItem + |> String.concat nl + + // assemble final message composing the parts + let msg = + let optionalParts = + [knownReturnType; genericParametersMessage; argsMessage] + |> List.choose id + |> String.concat (nl + nl) + |> function | "" -> nl + | result -> nl + nl + result + nl + nl + + match failure with + | NoOverloadsFound (methodName, overloads, _) -> + FSComp.SR.csNoOverloadsFound methodName + + optionalParts + + (FSComp.SR.csAvailableOverloads (formatOverloads overloads)) + | PossibleCandidates (methodName, [], _) -> + FSComp.SR.csMethodIsOverloaded methodName + | PossibleCandidates (methodName, overloads, _) -> + FSComp.SR.csMethodIsOverloaded methodName + + optionalParts + + FSComp.SR.csCandidates (formatOverloads overloads) + + os.Append msg |> ignore | UnresolvedConversionOperator(denv, fromTy, toTy, _) -> let t1, t2, _tpcs = NicePrint.minimalStringsOfTwoTypes denv fromTy toTy os.Append(FSComp.SR.csTypeDoesNotSupportConversion(t1, t2)) |> ignore - | PossibleOverload(_, minfo, originalError, _) -> - // print original error that describes reason why this overload was rejected - let buf = new StringBuilder() - OutputExceptionR buf originalError - - os.Append(PossibleOverloadE().Format minfo (buf.ToString())) |> ignore - | FunctionExpected _ -> os.Append(FunctionExpectedE().Format) |> ignore diff --git a/src/fsharp/ConstraintSolver.fs b/src/fsharp/ConstraintSolver.fs index 00460eab9ef..c7293960a97 100644 --- a/src/fsharp/ConstraintSolver.fs +++ b/src/fsharp/ConstraintSolver.fs @@ -52,6 +52,7 @@ open FSharp.Compiler.ErrorLogger open FSharp.Compiler.Infos open FSharp.Compiler.AccessibilityLogic open FSharp.Compiler.AttributeChecking +open FSharp.Compiler.Import open FSharp.Compiler.Lib open FSharp.Compiler.MethodCalls open FSharp.Compiler.PrettyNaming @@ -181,13 +182,30 @@ type ContextInfo = /// The type equation comes from a sequence expression. | SequenceExpression of TType -exception ConstraintSolverTupleDiffLengths of displayEnv: DisplayEnv * TType list * TType list * range * range +/// Captures relevant information for a particular failed overload resolution. +type OverloadInformation = + { + methodSlot: CalledMeth + amap : ImportMap + error: exn + } + +/// Cases for overload resolution failure that exists in the implementation of the compiler. +type OverloadResolutionFailure = + | NoOverloadsFound of methodName: string + * candidates: OverloadInformation list + * cx: TraitConstraintInfo option + | PossibleCandidates of methodName: string + * candidates: OverloadInformation list // methodNames may be different (with operators?), this is refactored from original logic to assemble overload failure message + * cx: TraitConstraintInfo option + +exception ConstraintSolverTupleDiffLengths of displayEnv: DisplayEnv * TType list * TType list * range * range exception ConstraintSolverInfiniteTypes of displayEnv: DisplayEnv * contextInfo: ContextInfo * TType * TType * range * range exception ConstraintSolverTypesNotInEqualityRelation of displayEnv: DisplayEnv * TType * TType * range * range * ContextInfo -exception ConstraintSolverTypesNotInSubsumptionRelation of displayEnv: DisplayEnv * TType * TType * range * range +exception ConstraintSolverTypesNotInSubsumptionRelation of displayEnv: DisplayEnv * argTy: TType * paramTy: TType * callRange: range * parameterRange: range exception ConstraintSolverMissingConstraint of displayEnv: DisplayEnv * Tast.Typar * Tast.TyparConstraint * range * range @@ -197,22 +215,16 @@ exception ConstraintSolverRelatedInformation of string option * range * exn exception ErrorFromApplyingDefault of tcGlobals: TcGlobals * displayEnv: DisplayEnv * Tast.Typar * TType * exn * range -exception ErrorFromAddingTypeEquation of tcGlobals: TcGlobals * displayEnv: DisplayEnv * TType * TType * exn * range +exception ErrorFromAddingTypeEquation of tcGlobals: TcGlobals * displayEnv: DisplayEnv * actualTy: TType * expectedTy: TType * exn * range -exception ErrorsFromAddingSubsumptionConstraint of tcGlobals: TcGlobals * displayEnv: DisplayEnv * TType * TType * exn * ContextInfo * range +exception ErrorsFromAddingSubsumptionConstraint of tcGlobals: TcGlobals * displayEnv: DisplayEnv * actualTy: TType * expectedTy: TType * exn * ContextInfo * parameterRange: range exception ErrorFromAddingConstraint of displayEnv: DisplayEnv * exn * range -exception PossibleOverload of displayEnv: DisplayEnv * string * exn * range - -exception UnresolvedOverloading of displayEnv: DisplayEnv * exn list * string * range +exception UnresolvedOverloading of displayEnv: DisplayEnv * callerArgs: CallerArgs * failure: OverloadResolutionFailure * range exception UnresolvedConversionOperator of displayEnv: DisplayEnv * TType * TType * range -let GetPossibleOverloads amap m denv (calledMethGroup: (CalledMeth<_> * exn) list) = - calledMethGroup |> List.map (fun (cmeth, e) -> - PossibleOverload(denv, NicePrint.stringOfMethInfo amap m denv cmeth.Method, e, m)) - type TcValF = (ValRef -> ValUseFlag -> TType list -> range -> Expr * TType) type ConstraintSolverState = @@ -509,6 +521,9 @@ exception AbortForFailedOverloadResolution let inline TryD_IgnoreAbortForFailedOverloadResolution f1 f2 = TryD f1 (function AbortForFailedOverloadResolution -> CompleteD | exn -> f2 exn) +/// used to provide detail about non matched argument in overload resolution error message +exception ArgDoesNotMatchError of error: ErrorsFromAddingSubsumptionConstraint * calledMeth: CalledMeth * calledArg: CalledArg * callerArg: CallerArg + /// Represents a very local condition where we prefer to report errors before stripping type abbreviations. exception LocallyAbortOperationThatLosesAbbrevs @@ -1520,15 +1535,17 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload // curried members may not be used to satisfy constraints |> List.choose (fun minfo -> if minfo.IsCurried then None else - let callerArgs = argtys |> List.map (fun argty -> CallerArg(argty, m, false, dummyExpr)) + let callerArgs = + { Unnamed = [ (argtys |> List.map (fun argty -> CallerArg(argty, m, false, dummyExpr))) ] + Named = [ [ ] ] } let minst = FreshenMethInfo m minfo let objtys = minfo.GetObjArgTypes(amap, m, minst) - Some(CalledMeth(csenv.InfoReader, None, false, FreshenMethInfo, m, AccessibleFromEverywhere, minfo, minst, minst, None, objtys, [(callerArgs, [])], false, false, None))) + Some(CalledMeth(csenv.InfoReader, None, false, FreshenMethInfo, m, AccessibleFromEverywhere, minfo, minst, minst, None, objtys, callerArgs, false, false, None))) let methOverloadResult, errors = trace.CollectThenUndoOrCommit (fun (a, _) -> Option.isSome a) - (fun trace -> ResolveOverloading csenv (WithTrace trace) nm ndeep (Some traitInfo) (0, 0) AccessibleFromEverywhere calledMethGroup false (Some rty)) + (fun trace -> ResolveOverloading csenv (WithTrace trace) nm ndeep (Some traitInfo) CallerArgs.Empty AccessibleFromEverywhere calledMethGroup false (Some rty)) match anonRecdPropSearch, recdPropSearch, methOverloadResult with | Some (anonInfo, tinst, i), None, None -> @@ -2264,7 +2281,7 @@ and CanMemberSigsMatchUpToCheck // // "ty2 casts to ty1" // "a value of type ty2 can be used where a value of type ty1 is expected" -and private SolveTypeSubsumesTypeWithReport (csenv: ConstraintSolverEnv) ndeep m trace cxsln ty1 ty2 = +and private SolveTypeSubsumesTypeWithWrappedContextualReport (csenv: ConstraintSolverEnv) ndeep m trace cxsln ty1 ty2 wrapper = TryD_IgnoreAbortForFailedOverloadResolution (fun () -> SolveTypeSubsumesTypeKeepAbbrevs csenv ndeep m trace cxsln ty1 ty2) (fun res -> @@ -2272,10 +2289,13 @@ and private SolveTypeSubsumesTypeWithReport (csenv: ConstraintSolverEnv) ndeep m | ContextInfo.RuntimeTypeTest isOperator -> // test if we can cast other way around match CollectThenUndo (fun newTrace -> SolveTypeSubsumesTypeKeepAbbrevs csenv ndeep m (OptionalTrace.WithTrace newTrace) cxsln ty2 ty1) with - | OkResult _ -> ErrorD (ErrorsFromAddingSubsumptionConstraint(csenv.g, csenv.DisplayEnv, ty1, ty2, res, ContextInfo.DowncastUsedInsteadOfUpcast isOperator, m)) - | _ -> ErrorD (ErrorsFromAddingSubsumptionConstraint(csenv.g, csenv.DisplayEnv, ty1, ty2, res, ContextInfo.NoContext, m)) - | _ -> ErrorD (ErrorsFromAddingSubsumptionConstraint(csenv.g, csenv.DisplayEnv, ty1, ty2, res, csenv.eContextInfo, m))) + | OkResult _ -> ErrorD (wrapper (ErrorsFromAddingSubsumptionConstraint(csenv.g, csenv.DisplayEnv, ty1, ty2, res, ContextInfo.DowncastUsedInsteadOfUpcast isOperator, m))) + | _ -> ErrorD (wrapper (ErrorsFromAddingSubsumptionConstraint(csenv.g, csenv.DisplayEnv, ty1, ty2, res, ContextInfo.NoContext, m))) + | _ -> ErrorD (wrapper (ErrorsFromAddingSubsumptionConstraint(csenv.g, csenv.DisplayEnv, ty1, ty2, res, csenv.eContextInfo, m)))) +and private SolveTypeSubsumesTypeWithReport (csenv: ConstraintSolverEnv) ndeep m trace cxsln ty1 ty2 = + SolveTypeSubsumesTypeWithWrappedContextualReport (csenv) ndeep m trace cxsln ty1 ty2 id + // ty1: actual // ty2: expected and private SolveTypeEqualsTypeWithReport (csenv: ConstraintSolverEnv) ndeep m trace cxsln actual expected = @@ -2308,9 +2328,9 @@ and MustUnify csenv ndeep trace cxsln ty1 ty2 = and MustUnifyInsideUndo csenv ndeep trace cxsln ty1 ty2 = SolveTypeEqualsTypeWithReport csenv ndeep csenv.m (WithTrace trace) cxsln ty1 ty2 -and ArgsMustSubsumeOrConvertInsideUndo (csenv: ConstraintSolverEnv) ndeep trace cxsln isConstraint calledArg (CallerArg(callerArgTy, m, _, _) as callerArg) = +and ArgsMustSubsumeOrConvertInsideUndo (csenv: ConstraintSolverEnv) ndeep trace cxsln isConstraint calledMeth calledArg (CallerArg(callerArgTy, m, _, _) as callerArg) = let calledArgTy = AdjustCalledArgType csenv.InfoReader isConstraint true calledArg callerArg - SolveTypeSubsumesTypeWithReport csenv ndeep m (WithTrace trace) cxsln calledArgTy callerArgTy + SolveTypeSubsumesTypeWithWrappedContextualReport csenv ndeep m (WithTrace trace) cxsln calledArgTy callerArgTy (fun e -> ArgDoesNotMatchError(e :?> _, calledMeth, calledArg, callerArg)) and TypesMustSubsumeOrConvertInsideUndo (csenv: ConstraintSolverEnv) ndeep trace cxsln m calledArgTy callerArgTy = SolveTypeSubsumesTypeWithReport csenv ndeep m trace cxsln calledArgTy callerArgTy @@ -2448,7 +2468,7 @@ and ResolveOverloading methodName // The name of the method being called, for error reporting ndeep // Depth of inference cx // We're doing overload resolution as part of constraint solving, where special rules apply for op_Explicit and op_Implicit constraints. - callerArgCounts // How many named/unnamed args id the caller provide? + (callerArgs: CallerArgs) ad // The access domain of the caller, e.g. a module, type etc. calledMethGroup // The set of methods being called permitOptArgs // Can we supply optional arguments? @@ -2471,7 +2491,7 @@ and ResolveOverloading None, ErrorD (Error (FSComp.SR.csMethodNotFound(methodName), m)), NoTrace | _, [] when not isOpConversion -> - None, ReportNoCandidatesErrorExpr csenv callerArgCounts methodName ad calledMethGroup, NoTrace + None, ReportNoCandidatesErrorExpr csenv callerArgs.CallerArgCounts methodName ad calledMethGroup, NoTrace | _, _ -> @@ -2509,11 +2529,11 @@ and ResolveOverloading alwaysCheckReturn (MustUnifyInsideUndo csenv ndeep newTrace cxsln) (TypesMustSubsumeOrConvertInsideUndo csenv ndeep (WithTrace newTrace) cxsln m) - (ArgsMustSubsumeOrConvertInsideUndo csenv ndeep newTrace cxsln cx.IsSome) + (ArgsMustSubsumeOrConvertInsideUndo csenv ndeep newTrace cxsln cx.IsSome candidate) reqdRetTyOpt candidate) - let failOverloading (msg: string) errors = + let failOverloading overloadResolutionFailure = // Try to extract information to give better error for ambiguous op_Explicit and op_Implicit let convOpData = if isOpConversion then @@ -2528,11 +2548,8 @@ and ResolveOverloading | Some (fromTy, toTy) -> UnresolvedConversionOperator (denv, fromTy, toTy, m) | None -> - // Otherwise collect a list of possible overloads - let overloads = GetPossibleOverloads amap m denv errors - // if list of overloads is not empty - append line with "The available overloads are shown below..." - let msg = if isNil overloads then msg else sprintf "%s %s" msg (FSComp.SR.csSeeAvailableOverloads ()) - UnresolvedOverloading (denv, overloads, msg, m) + // Otherwise pass the overload resolution failure for error printing in CompileOps + UnresolvedOverloading (denv, callerArgs, overloadResolutionFailure, m) match applicable with | [] -> @@ -2548,13 +2565,14 @@ and ResolveOverloading alwaysCheckReturn (MustUnifyInsideUndo csenv ndeep newTrace cxsln) (TypesMustSubsumeOrConvertInsideUndo csenv ndeep (WithTrace newTrace) cxsln m) - (ArgsMustSubsumeOrConvertInsideUndo csenv ndeep newTrace cxsln cx.IsSome) + (ArgsMustSubsumeOrConvertInsideUndo csenv ndeep newTrace cxsln cx.IsSome calledMeth) reqdRetTyOpt calledMeth) with | OkResult _ -> None - | ErrorResult(_, exn) -> Some (calledMeth, exn)) + | ErrorResult(_warnings, exn) -> + Some {methodSlot = calledMeth; amap = amap; error = exn }) - None, ErrorD (failOverloading (FSComp.SR.csNoOverloadsFound methodName) errors), NoTrace + None, ErrorD (failOverloading (NoOverloadsFound (methodName, errors, cx))), NoTrace | [(calledMeth, warns, t)] -> Some calledMeth, OkResult (warns, ()), WithTrace t @@ -2726,27 +2744,26 @@ and ResolveOverloading match bestMethods with | [(calledMeth, warns, t)] -> Some calledMeth, OkResult (warns, ()), WithTrace t | bestMethods -> - let methodNames = - let methods = - // use the most precise set - // - if after filtering bestMethods still contains something - use it - // - otherwise use applicableMeths or initial set of candidate methods - match bestMethods with - | [] -> - match applicableMeths with - | [] -> candidates - | m -> m |> List.map (fun (x, _, _) -> x) - | m -> m |> List.map (fun (x, _, _) -> x) - - methods - |> List.map (fun cmeth -> NicePrint.stringOfMethInfo amap m denv cmeth.Method) - |> List.sort - let msg = FSComp.SR.csMethodIsOverloaded methodName - let msg = - match methodNames with - | [] -> msg - | names -> sprintf "%s %s" msg (FSComp.SR.csCandidates (String.concat ", " names)) - None, ErrorD (failOverloading msg []), NoTrace + let methods = + let getMethodSlotsAndErrors methodSlot errors = + [ match errors with + | [] -> yield { methodSlot = methodSlot; error = Unchecked.defaultof; amap = amap } + | errors -> for error in errors do yield { methodSlot = methodSlot; error = error; amap = amap } ] + + + // use the most precise set + // - if after filtering bestMethods still contains something - use it + // - otherwise use applicableMeths or initial set of candidate methods + [ match bestMethods with + | [] -> + match applicableMeths with + | [] -> for methodSlot in candidates do yield getMethodSlotsAndErrors methodSlot [] + | m -> for (methodSlot, errors, _) in m do yield getMethodSlotsAndErrors methodSlot errors + | m -> for (methodSlot, errors, _) in m do yield getMethodSlotsAndErrors methodSlot errors ] + + let methods = List.concat methods + + None, ErrorD (failOverloading (PossibleCandidates(methodName, methods,cx))), NoTrace // If we've got a candidate solution: make the final checks - no undo here! // Allow subsumption on arguments. Include the return type. @@ -2790,9 +2807,9 @@ and ResolveOverloading | None -> None, errors -let ResolveOverloadingForCall denv css m methodName ndeep cx callerArgCounts ad calledMethGroup permitOptArgs reqdRetTyOpt = +let ResolveOverloadingForCall denv css m methodName ndeep cx callerArgs ad calledMethGroup permitOptArgs reqdRetTyOpt = let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m denv - ResolveOverloading csenv NoTrace methodName ndeep cx callerArgCounts ad calledMethGroup permitOptArgs reqdRetTyOpt + ResolveOverloading csenv NoTrace methodName ndeep cx callerArgs ad calledMethGroup permitOptArgs reqdRetTyOpt /// This is used before analyzing the types of arguments in a single overload resolution let UnifyUniqueOverloading diff --git a/src/fsharp/ConstraintSolver.fsi b/src/fsharp/ConstraintSolver.fsi index 8fdaabf82cf..6c76d383c21 100644 --- a/src/fsharp/ConstraintSolver.fsi +++ b/src/fsharp/ConstraintSolver.fsi @@ -90,23 +90,40 @@ type ContextInfo = /// The type equation comes from a sequence expression. | SequenceExpression of TType +/// Captures relevant information for a particular failed overload resolution. +type OverloadInformation = + { + methodSlot: CalledMeth + amap : ImportMap + error: exn + } + +/// Cases for overload resolution failure that exists in the implementation of the compiler. +type OverloadResolutionFailure = + | NoOverloadsFound of methodName: string + * candidates: OverloadInformation list + * cx: TraitConstraintInfo option + | PossibleCandidates of methodName: string + * candidates: OverloadInformation list // methodNames may be different (with operators?), this is refactored from original logic to assemble overload failure message + * cx: TraitConstraintInfo option + exception ConstraintSolverTupleDiffLengths of displayEnv: DisplayEnv * TType list * TType list * range * range exception ConstraintSolverInfiniteTypes of displayEnv: DisplayEnv * contextInfo: ContextInfo * TType * TType * range * range exception ConstraintSolverTypesNotInEqualityRelation of displayEnv: DisplayEnv * TType * TType * range * range * ContextInfo -exception ConstraintSolverTypesNotInSubsumptionRelation of displayEnv: DisplayEnv * TType * TType * range * range +exception ConstraintSolverTypesNotInSubsumptionRelation of displayEnv: DisplayEnv * argTy: TType * paramTy: TType * callRange: range * parameterRange: range exception ConstraintSolverMissingConstraint of displayEnv: DisplayEnv * Typar * TyparConstraint * range * range exception ConstraintSolverError of string * range * range exception ConstraintSolverRelatedInformation of string option * range * exn exception ErrorFromApplyingDefault of tcGlobals: TcGlobals * displayEnv: DisplayEnv * Typar * TType * exn * range -exception ErrorFromAddingTypeEquation of tcGlobals: TcGlobals * displayEnv: DisplayEnv * TType * TType * exn * range -exception ErrorsFromAddingSubsumptionConstraint of tcGlobals: TcGlobals * displayEnv: DisplayEnv * TType * TType * exn * ContextInfo * range +exception ErrorFromAddingTypeEquation of tcGlobals: TcGlobals * displayEnv: DisplayEnv * actualTy: TType * expectedTy: TType * exn * range +exception ErrorsFromAddingSubsumptionConstraint of tcGlobals: TcGlobals * displayEnv: DisplayEnv * actualTy: TType * expectedTy: TType * exn * ContextInfo * parameterRange: range exception ErrorFromAddingConstraint of displayEnv: DisplayEnv * exn * range exception UnresolvedConversionOperator of displayEnv: DisplayEnv * TType * TType * range -exception PossibleOverload of displayEnv: DisplayEnv * string * exn * range -exception UnresolvedOverloading of displayEnv: DisplayEnv * exn list * string * range +exception UnresolvedOverloading of displayEnv: DisplayEnv * callerArgs: CallerArgs * failure: OverloadResolutionFailure * range exception NonRigidTypar of displayEnv: DisplayEnv * string option * range * TType * TType * range +exception ArgDoesNotMatchError of error: ErrorsFromAddingSubsumptionConstraint * calledMeth: CalledMeth * calledArg: CalledArg * callerArg: CallerArg /// A function that denotes captured tcVal, Used in constraint solver and elsewhere to get appropriate expressions for a ValRef. type TcValF = (ValRef -> ValUseFlag -> TType list -> range -> Expr * TType) @@ -125,7 +142,7 @@ type OptionalTrace = val SimplifyMeasuresInTypeScheme: TcGlobals -> bool -> Typars -> TType -> TyparConstraint list -> Typars -val ResolveOverloadingForCall: DisplayEnv -> ConstraintSolverState -> range -> string -> ndeep: int -> TraitConstraintInfo option -> int * int -> AccessorDomain -> CalledMeth list -> bool -> TType option -> CalledMeth option * OperationResult +val ResolveOverloadingForCall: DisplayEnv -> ConstraintSolverState -> range -> methodName: string -> ndeep: int -> cx: TraitConstraintInfo option -> callerArgs: CallerArgs -> AccessorDomain -> calledMethGroup: CalledMeth list -> permitOptArgs: bool -> reqdRetTyOpt: TType option -> CalledMeth option * OperationResult val UnifyUniqueOverloading: DisplayEnv -> ConstraintSolverState -> range -> int * int -> string -> AccessorDomain -> CalledMeth list -> TType -> OperationResult diff --git a/src/fsharp/FSComp.txt b/src/fsharp/FSComp.txt index 7428aefce49..2f26477c612 100644 --- a/src/fsharp/FSComp.txt +++ b/src/fsharp/FSComp.txt @@ -1,6 +1,6 @@ -# ----------------------------------------------------------------------------- -# use a completely new error number and add new messages at the end of the file -# ----------------------------------------------------------------------------- +# ------------------------------------------------------------------------------- +# use a completely new error number and keep messages in their surrounding groups +# ------------------------------------------------------------------------------- undefinedNameNamespace,"The namespace '%s' is not defined." undefinedNameNamespaceOrModule,"The namespace or module '%s' is not defined." undefinedNameFieldConstructorOrMember,"The field, constructor or member '%s' is not defined." @@ -362,9 +362,16 @@ csCtorHasNoArgumentOrReturnProperty,"The object constructor '%s' has no argument 508,csNoMemberTakesTheseArguments3,"No %s member or object constructor named '%s' takes %d arguments. The named argument '%s' doesn't correspond to any argument or settable return property for any overload." 509,csMethodNotFound,"Method or object constructor '%s' not found" csNoOverloadsFound,"No overloads match for method '%s'." +csNoOverloadsFoundArgumentsPrefixSingular,"Known type of argument: %s" +csNoOverloadsFoundArgumentsPrefixPlural,"Known types of arguments: %s" +csNoOverloadsFoundTypeParametersPrefixSingular,"Known type parameter: %s" +csNoOverloadsFoundTypeParametersPrefixPlural,"Known type parameters: %s" +csNoOverloadsFoundReturnType,"Known return type: %s" csMethodIsOverloaded,"A unique overload for method '%s' could not be determined based on type information prior to this program point. A type annotation may be needed." -csCandidates,"Candidates: %s" -csSeeAvailableOverloads,"The available overloads are shown below." +csCandidates,"Candidates:\n%s" +csAvailableOverloads,"Available overloads:\n%s" +csOverloadCandidateNamedArgumentTypeMismatch,"Argument '%s' doesn't match" +csOverloadCandidateIndexedArgumentTypeMismatch,"Argument at index %d doesn't match" 512,parsDoCannotHaveVisibilityDeclarations,"Accessibility modifiers are not permitted on 'do' bindings, but '%s' was given." 513,parsEofInHashIf,"End of file in #if section begun at or after here" 514,parsEofInString,"End of file in string begun at or before here" @@ -1485,3 +1492,4 @@ optsLangVersion,"Display the allowed values for language version, specify langua optsSupportedLangVersions,"Supported language versions:" nativeResourceFormatError,"Stream does not begin with a null resource and is not in '.RES' format." nativeResourceHeaderMalformed,"Resource header beginning at offset %s is malformed." +formatDashItem," - %s" diff --git a/src/fsharp/FSStrings.resx b/src/fsharp/FSStrings.resx index a56e6f14219..e755b590b49 100644 --- a/src/fsharp/FSStrings.resx +++ b/src/fsharp/FSStrings.resx @@ -159,9 +159,6 @@ Discriminated union cases and exception labels must be uppercase identifiers - - Possible overload: '{0}'. {1}. - This function takes too many arguments, or is used in a context where a function is not expected diff --git a/src/fsharp/MethodCalls.fs b/src/fsharp/MethodCalls.fs index 09441aa6e65..341664d8738 100644 --- a/src/fsharp/MethodCalls.fs +++ b/src/fsharp/MethodCalls.fs @@ -45,16 +45,11 @@ open FSharp.Compiler.ExtensionTyping /// /// The bool indicates if named using a '?', making the caller argument explicit-optional type CallerArg<'T> = - /// CallerArg(ty, range, isOpt, exprInfo) - | CallerArg of TType * range * bool * 'T - + | CallerArg of ty: TType * range: range * isOpt: bool * exprInfo: 'T member x.CallerArgumentType = (let (CallerArg(ty, _, _, _)) = x in ty) - member x.Range = (let (CallerArg(_, m, _, _)) = x in m) - member x.IsExplicitOptional = (let (CallerArg(_, _, isOpt, _)) = x in isOpt) - member x.Expr = (let (CallerArg(_, _, _, expr)) = x in expr) /// Represents the information about an argument in the method being called @@ -113,6 +108,22 @@ type CallerNamedArg<'T> = member x.CallerArg = (let (CallerNamedArg(_, a)) = x in a) +/// Represents the list of unnamed / named arguments at method call site +/// remark: The usage of list list is due to tupling and currying of arguments, +/// stemming from SynValInfo in the AST. +[] +type CallerArgs<'T> = + { + Unnamed: CallerArg<'T> list list + Named: CallerNamedArg<'T> list list + } + static member Empty : CallerArgs<'T> = { Unnamed = []; Named = [] } + member x.CallerArgCounts = (List.length x.Unnamed, List.length x.Named) + member x.CurriedCallerArgs = List.zip x.Unnamed x.Named + member x.ArgumentNamesAndTypes = + [ (x.Unnamed |> List.map (List.map (fun i -> None, i.CallerArgumentType))) |> List.concat + (x.Named |> List.map (List.map (fun i -> Some i.Name, i.CallerArg.CallerArgumentType))) |> List.concat ] + |> List.concat //------------------------------------------------------------------------- // Callsite conversions //------------------------------------------------------------------------- @@ -303,18 +314,31 @@ type CalledMeth<'T> (infoReader: InfoReader, nameEnv: NameResolutionEnv option, isCheckingAttributeCall, - freshenMethInfo, // a function to help generate fresh type variables the property setters methods in generic classes + /// a function to help generate fresh type variables the property setters methods in generic classes + freshenMethInfo, + /// range m, - ad, // the access domain of the place where the call is taking place - minfo: MethInfo, // the method we're attempting to call - calledTyArgs, // the 'called type arguments', i.e. the fresh generic instantiation of the method we're attempting to call - callerTyArgs: TType list, // the 'caller type arguments', i.e. user-given generic instantiation of the method we're attempting to call - pinfoOpt: PropInfo option, // the property related to the method we're attempting to call, if any - callerObjArgTys: TType list, // the types of the actual object argument, if any - curriedCallerArgs: (CallerArg<'T> list * CallerNamedArg<'T> list) list, // the data about any arguments supplied by the caller - allowParamArgs: bool, // do we allow the use of a param args method in its "expanded" form? - allowOutAndOptArgs: bool, // do we allow the use of the transformation that converts out arguments as tuple returns? - tyargsOpt : TType option) // method parameters + /// the access domain of the place where the call is taking place + ad, + /// the method we're attempting to call + minfo: MethInfo, + /// the 'called type arguments', i.e. the fresh generic instantiation of the method we're attempting to call + calledTyArgs, + /// the 'caller type arguments', i.e. user-given generic instantiation of the method we're attempting to call + // todo: consider CallerTypeArgs record + callerTyArgs: TType list, + /// the property related to the method we're attempting to call, if any + pinfoOpt: PropInfo option, + /// the types of the actual object argument, if any + callerObjArgTys: TType list, + /// the 'caller method arguments', i.e. a list of user-given parameter expressions, split between unnamed and named arguments + callerArgs: CallerArgs<'T>, + /// do we allow the use of a param args method in its "expanded" form? + allowParamArgs: bool, + /// do we allow the use of the transformation that converts out arguments as tuple returns? + allowOutAndOptArgs: bool, + /// method parameters + tyargsOpt : TType option) = let g = infoReader.g let methodRetTy = minfo.GetFSharpReturnTy(infoReader.amap, m, calledTyArgs) @@ -323,7 +347,7 @@ type CalledMeth<'T> do assert (fullCurriedCalledArgs.Length = fullCurriedCalledArgs.Length) let argSetInfos = - (curriedCallerArgs, fullCurriedCalledArgs) ||> List.map2 (fun (unnamedCallerArgs, namedCallerArgs) fullCalledArgs -> + (callerArgs.CurriedCallerArgs, fullCurriedCalledArgs) ||> List.map2 (fun (unnamedCallerArgs, namedCallerArgs) fullCalledArgs -> // Find the arguments not given by name let unnamedCalledArgs = fullCalledArgs |> List.filter (fun calledArg -> @@ -514,7 +538,8 @@ type CalledMeth<'T> member x.ParamArrayCallerArgs = x.ArgSets |> List.tryPick (fun argSet -> if Option.isSome argSet.ParamArrayCalledArgOpt then Some argSet.ParamArrayCallerArgs else None ) - member x.GetParamArrayElementType() = + member x.GetParamArrayElementType() = + // turned as a method to avoid assert in variable inspector assert (x.UsesParamArrayConversion) x.ParamArrayCalledArgOpt.Value.CalledArgumentType |> destArrayTy x.amap.g @@ -977,7 +1002,6 @@ let CoerceFromFSharpFuncToDelegate g amap infoReader ad callerArgTy m callerArgE // Handle adhoc argument conversions let AdjustCallerArgExprForCoercions (g: TcGlobals) amap infoReader ad isOutArg calledArgTy (reflArgInfo: ReflectedArgInfo) callerArgTy m callerArgExpr = - if isByrefTy g calledArgTy && isRefCellTy g callerArgTy then None, Expr.Op (TOp.RefAddrGet false, [destRefCellTy g callerArgTy], [callerArgExpr], m) diff --git a/src/fsharp/NicePrint.fs b/src/fsharp/NicePrint.fs index 6479d6c6729..c49d8922009 100644 --- a/src/fsharp/NicePrint.fs +++ b/src/fsharp/NicePrint.fs @@ -988,43 +988,64 @@ module private PrintTypes = and layoutType denv ty = layoutTypeWithInfo denv SimplifyTypes.typeSimplificationInfo0 ty + + let layoutArgInfos denv env argInfos = + + // Format each argument, including its name and type + let argL (ty, argInfo: ArgReprInfo) = + + // Detect an optional argument + let isOptionalArg = HasFSharpAttribute denv.g denv.g.attrib_OptionalArgumentAttribute argInfo.Attribs + let isParamArray = HasFSharpAttribute denv.g denv.g.attrib_ParamArrayAttribute argInfo.Attribs + match argInfo.Name, isOptionalArg, isParamArray, tryDestOptionTy denv.g ty with + // Layout an optional argument + | Some(id), true, _, ValueSome ty -> + leftL (tagPunctuation "?") ^^ sepL (tagParameter id.idText) ^^ SepL.colon ^^ layoutTypeWithInfoAndPrec denv env 2 ty + // Layout an unnamed argument + | None, _, _, _ -> + layoutTypeWithInfoAndPrec denv env 2 ty + // Layout a named argument + | Some id, _, isParamArray, _ -> + let prefix = + if isParamArray then + layoutBuiltinAttribute denv denv.g.attrib_ParamArrayAttribute ^^ leftL (tagParameter id.idText) + else + leftL (tagParameter id.idText) + prefix ^^ SepL.colon ^^ layoutTypeWithInfoAndPrec denv env 2 ty + + let allArgsL = + argInfos + |> List.mapSquared argL + |> List.map (sepListL (wordL (tagPunctuation "*"))) + allArgsL + + let layoutReturnType denv env rty = layoutTypeWithInfoAndPrec denv env 4 rty + + let layoutGenericParameterTypes denv env = + function + | [] -> emptyL + | genParamTys -> + (wordL (tagPunctuation "<")) + ^^ + ( + genParamTys + |> List.map (layoutTypeWithInfoAndPrec denv env 4) + |> sepListL (wordL (tagPunctuation ",")) + ) + ^^ + (wordL (tagPunctuation ">")) + /// Layout a single type used as the type of a member or value let layoutTopType denv env argInfos rty cxs = // Parenthesize the return type to match the topValInfo - let rtyL = layoutTypeWithInfoAndPrec denv env 4 rty + let rtyL = layoutReturnType denv env rty let cxsL = layoutConstraintsWithInfo denv env cxs match argInfos with | [] -> rtyL --- cxsL | _ -> - - // Format each argument, including its name and type - let argL (ty, argInfo: ArgReprInfo) = - - // Detect an optional argument - let isOptionalArg = HasFSharpAttribute denv.g denv.g.attrib_OptionalArgumentAttribute argInfo.Attribs - let isParamArray = HasFSharpAttribute denv.g denv.g.attrib_ParamArrayAttribute argInfo.Attribs - match argInfo.Name, isOptionalArg, isParamArray, tryDestOptionTy denv.g ty with - // Layout an optional argument - | Some(id), true, _, ValueSome ty -> - leftL (tagPunctuation "?") ^^ sepL (tagParameter id.idText) ^^ SepL.colon ^^ layoutTypeWithInfoAndPrec denv env 2 ty - // Layout an unnamed argument - | None, _, _, _ -> - layoutTypeWithInfoAndPrec denv env 2 ty - // Layout a named argument - | Some id, _, isParamArray, _ -> - let prefix = - if isParamArray then - layoutBuiltinAttribute denv denv.g.attrib_ParamArrayAttribute ^^ leftL (tagParameter id.idText) - else - leftL (tagParameter id.idText) - prefix ^^ SepL.colon ^^ layoutTypeWithInfoAndPrec denv env 2 ty - let delimitReturnValue = tagPunctuation (if denv.useColonForReturnType then ":" else "->") - let allArgsL = - argInfos - |> List.mapSquared argL - |> List.map (sepListL (wordL (tagPunctuation "*"))) + layoutArgInfos denv env argInfos |> List.map (fun x -> (x ^^ wordL delimitReturnValue)) (List.foldBack (---) allArgsL rtyL) --- cxsL @@ -1073,6 +1094,12 @@ module private PrintTypes = let cxs = cxs |> List.filter (fun (tp, _) -> not (parentTyparTys |> List.exists (fun ty -> match tryDestTyparTy denv.g ty with ValueSome destTypar -> typarEq tp destTypar | _ -> false))) prettyTyparInst, prettyLayoutOfTopTypeInfoAux denv argInfos retTy cxs + + let private prettyArgInfos denv allTyparInst = + function + | [] -> [(denv.g.unit_ty, ValReprInfo.unnamedTopArg1)] + | infos -> infos |> List.map (map1Of2 (instType allTyparInst)) + // Layout: type spec - class, datatype, record, abbrev let private prettyLayoutOfMemberSigCore denv memberToParentInst (typarInst, methTypars: Typars, argInfos, retTy) = @@ -1081,7 +1108,7 @@ module private PrintTypes = PrettyTypes.NewPrettyTypars memberToParentInst methTypars methTyparNames let retTy = instType allTyparInst retTy - let argInfos = argInfos |> List.map (fun infos -> if isNil infos then [(denv.g.unit_ty, ValReprInfo.unnamedTopArg1)] else infos |> List.map (map1Of2 (instType allTyparInst))) + let argInfos = argInfos |> List.map (prettyArgInfos denv allTyparInst) // Also format dummy types corresponding to any type variables on the container to make sure they // aren't chosen as names for displayed variables. @@ -1107,6 +1134,50 @@ module private PrintTypes = nameL nameL ^^ wordL (tagPunctuation ":") ^^ tauL + /// layouts the elements of an unresolved overloaded method call: + /// argInfos: unammed and named arguments + /// retTy: return type + /// genParamTy: generic parameter types + let prettyLayoutsOfUnresolvedOverloading denv argInfos retTy genParamTys = + let _niceMethodTypars, typarInst = + let memberToParentInst = List.empty + let typars = argInfos |> List.choose (function (TType.TType_var typar,_) -> Some typar | _ -> None) + let methTyparNames = typars |> List.mapi (fun i tp -> if (PrettyTypes.NeedsPrettyTyparName tp) then sprintf "a%d" (List.length memberToParentInst + i) else tp.Name) + PrettyTypes.NewPrettyTypars memberToParentInst typars methTyparNames + let retTy = instType typarInst retTy + let argInfos = prettyArgInfos denv typarInst argInfos + let argInfos,retTy,genParamTys, cxs = + // using 0, 1, 2 as discriminant for return, arguments and generic parameters + // respectively, in order to easily retrieve each of the types with their + // expected quality below. + let typesWithDiscrimants = + [ + yield 0, retTy + for ty,_ in argInfos do + yield 1, ty + for ty in genParamTys do + yield 2, ty + ] + let typesWithDiscrimants,typarsAndCxs = PrettyTypes.PrettifyDiscriminantAndTypePairs denv.g typesWithDiscrimants + let retTy = typesWithDiscrimants |> List.find (function (0, _) -> true | _ -> false) |> snd + let argInfos = + typesWithDiscrimants + |> List.choose (function (1,ty) -> Some ty | _ -> None) + |> List.zip argInfos + |> List.map (fun ((_,argInfo),tTy) -> tTy, argInfo) + let genParamTys = + typesWithDiscrimants + |> List.choose (function (2,ty) -> Some ty | _ -> None) + + argInfos, retTy, genParamTys, typarsAndCxs + + let env = SimplifyTypes.CollectInfo true (List.collect (List.map fst) [argInfos]) cxs + let cxsL = layoutConstraintsWithInfo denv env env.postfixConstraints + + (List.foldBack (---) (layoutArgInfos denv env [argInfos]) cxsL, + layoutReturnType denv env retTy, + layoutGenericParameterTypes denv env genParamTys) + let prettyLayoutOfType denv ty = let ty, cxs = PrettyTypes.PrettifyType denv.g ty let env = SimplifyTypes.CollectInfo true [ty] cxs @@ -1246,6 +1317,7 @@ let layoutConst g ty c = PrintTypes.layoutConst g ty c let prettyLayoutOfMemberSig denv x = x |> PrintTypes.prettyLayoutOfMemberSig denv let prettyLayoutOfUncurriedSig denv argInfos tau = PrintTypes.prettyLayoutOfUncurriedSig denv argInfos tau +let prettyLayoutsOfUnresolvedOverloading denv argInfos retTy genericParameters = PrintTypes.prettyLayoutsOfUnresolvedOverloading denv argInfos retTy genericParameters //------------------------------------------------------------------------- diff --git a/src/fsharp/TastOps.fs b/src/fsharp/TastOps.fs index 8eb6e70cf56..761acf38b89 100644 --- a/src/fsharp/TastOps.fs +++ b/src/fsharp/TastOps.fs @@ -2510,6 +2510,11 @@ module PrettyTypes = let PrettifyType g x = PrettifyThings g id id x let PrettifyTypePair g x = PrettifyThings g (fun f -> foldPair (f, f)) (fun f -> mapPair (f, f)) x let PrettifyTypes g x = PrettifyThings g List.fold List.map x + + let PrettifyDiscriminantAndTypePairs g x = + let tys, cxs = (PrettifyThings g List.fold List.map (x |> List.map snd)) + List.zip (List.map fst x) tys, cxs + let PrettifyCurriedTypes g x = PrettifyThings g (fun f -> List.fold (List.fold f)) List.mapSquared x let PrettifyCurriedSigTypes g x = PrettifyThings g (fun f -> foldPair (List.fold (List.fold f), f)) (fun f -> mapPair (List.mapSquared f, f)) x diff --git a/src/fsharp/TastOps.fsi b/src/fsharp/TastOps.fsi index f57de99fb07..cd89fea5e0e 100755 --- a/src/fsharp/TastOps.fsi +++ b/src/fsharp/TastOps.fsi @@ -931,6 +931,11 @@ module PrettyTypes = val PrettifyTypePair : TcGlobals -> TType * TType -> (TType * TType) * TyparConstraintsWithTypars val PrettifyTypes : TcGlobals -> TTypes -> TTypes * TyparConstraintsWithTypars + + /// same as PrettifyTypes, but allows passing the types along with a discriminant value + /// useful to prettify many types that need to be sorted out after prettifying operation + /// took place. + val PrettifyDiscriminantAndTypePairs : TcGlobals -> ('Discriminant * TType) list -> ('Discriminant * TType) list * TyparConstraintsWithTypars val PrettifyInst : TcGlobals -> TyparInst -> TyparInst * TyparConstraintsWithTypars diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index 07e3e3a5786..2cf45098b99 100755 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -10283,7 +10283,7 @@ and TcMethodApplication let callerArgCounts = (List.sumBy List.length unnamedCurriedCallerArgs, List.sumBy List.length namedCurriedCallerArgs) - let callerArgs = List.zip unnamedCurriedCallerArgs namedCurriedCallerArgs + let callerArgs = { Unnamed = unnamedCurriedCallerArgs; Named = namedCurriedCallerArgs } let makeOneCalledMeth (minfo, pinfoOpt, usesParamArrayConversion) = let minst = FreshenMethInfo mItem minfo @@ -10382,7 +10382,7 @@ and TcMethodApplication /// Select the called method that's the result of overload resolution let finalCalledMeth = - let callerArgs = List.zip unnamedCurriedCallerArgs namedCurriedCallerArgs + let callerArgs = { Unnamed = unnamedCurriedCallerArgs ; Named = namedCurriedCallerArgs } let postArgumentTypeCheckingCalledMethGroup = preArgumentTypeCheckingCalledMethGroup |> List.map (fun (minfo: MethInfo, minst, pinfoOpt, usesParamArrayConversion) -> @@ -10392,8 +10392,6 @@ and TcMethodApplication | None -> minst CalledMeth(cenv.infoReader, Some(env.NameEnv), isCheckingAttributeCall, FreshenMethInfo, mMethExpr, ad, minfo, minst, callerTyArgs, pinfoOpt, callerObjArgTys, callerArgs, usesParamArrayConversion, true, objTyOpt)) - let callerArgCounts = (unnamedCurriedCallerArgs.Length, namedCurriedCallerArgs.Length) - // Commit unassociated constraints prior to member overload resolution where there is ambiguity // about the possible target of the call. if not uniquelyResolved then @@ -10401,7 +10399,7 @@ and TcMethodApplication (//freeInTypeLeftToRight cenv.g false returnTy @ (unnamedCurriedCallerArgs |> List.collectSquared (fun callerArg -> freeInTypeLeftToRight cenv.g false callerArg.CallerArgumentType))) - let result, errors = ResolveOverloadingForCall denv cenv.css mMethExpr methodName 0 None callerArgCounts ad postArgumentTypeCheckingCalledMethGroup true (Some returnTy) + let result, errors = ResolveOverloadingForCall denv cenv.css mMethExpr methodName 0 None callerArgs ad postArgumentTypeCheckingCalledMethGroup true (Some returnTy) match afterResolution, result with | AfterResolution.DoNothing, _ -> () diff --git a/src/fsharp/tast.fs b/src/fsharp/tast.fs index 33da5cd6599..2aeceb3bac9 100644 --- a/src/fsharp/tast.fs +++ b/src/fsharp/tast.fs @@ -2407,11 +2407,9 @@ and [] TraitConstraintInfo = - /// TTrait(tys, nm, memFlags, argtys, rty, solution) - /// /// Indicates the signature of a member constraint. Contains a mutable solution cell /// to store the inferred solution of the constraint. - | TTrait of TTypes * string * MemberFlags * TTypes * TType option * TraitConstraintSln option ref + | TTrait of tys: TTypes * memberName: string * _memFlags: MemberFlags * argTys: TTypes * returnTy: TType option * solution: TraitConstraintSln option ref /// Get the member name associated with the member constraint. member x.MemberName = (let (TTrait(_, nm, _, _, _, _)) = x in nm) diff --git a/tests/fsharp/Compiler/CompilerAssert.fs b/tests/fsharp/Compiler/CompilerAssert.fs index f38a105287d..6eea519afde 100644 --- a/tests/fsharp/Compiler/CompilerAssert.fs +++ b/tests/fsharp/Compiler/CompilerAssert.fs @@ -415,6 +415,37 @@ let main argv = 0""" Assert.IsEmpty(typeCheckResults.Errors, sprintf "Type Check errors: %A" typeCheckResults.Errors) + static member TypeCheckWithErrorsAndOptionsAgainstBaseLine options (sourceFile: string) = + lock gate <| fun () -> + let absoluteSourceFile = System.IO.Path.Combine(__SOURCE_DIRECTORY__, "..", sourceFile) + let parseResults, fileAnswer = + checker.ParseAndCheckFileInProject( + sourceFile, + 0, + SourceText.ofString (File.ReadAllText absoluteSourceFile), + { defaultProjectOptions with OtherOptions = Array.append options defaultProjectOptions.OtherOptions; SourceFiles = [|sourceFile|] }) + |> Async.RunSynchronously + + Assert.IsEmpty(parseResults.Errors, sprintf "Parse errors: %A" parseResults.Errors) + + match fileAnswer with + | FSharpCheckFileAnswer.Aborted _ -> Assert.Fail("Type Checker Aborted") + | FSharpCheckFileAnswer.Succeeded(typeCheckResults) -> + + let errorsExpectedBaseLine = + let bslFile = Path.ChangeExtension(absoluteSourceFile, "bsl") + if not (File.Exists bslFile) then + // new test likely initialized, create empty baseline file + File.WriteAllText(bslFile, "") + File.ReadAllText(Path.ChangeExtension(absoluteSourceFile, "bsl")) + let errorsActual = + typeCheckResults.Errors + |> Array.map (sprintf "%A") + |> String.concat "\n" + File.WriteAllText(Path.ChangeExtension(absoluteSourceFile,"err"), errorsActual) + + Assert.AreEqual(errorsExpectedBaseLine.Replace("\r\n","\n"), errorsActual.Replace("\r\n","\n")) + static member TypeCheckWithErrorsAndOptionsAndAdjust options libAdjust (source: string) expectedTypeErrors = lock gate <| fun () -> let errors = diff --git a/tests/fsharp/Compiler/ConstraintSolver/PrimitiveConstraints.fs b/tests/fsharp/Compiler/ConstraintSolver/PrimitiveConstraints.fs index 0b61ffbb96b..1a77b4431ef 100644 --- a/tests/fsharp/Compiler/ConstraintSolver/PrimitiveConstraints.fs +++ b/tests/fsharp/Compiler/ConstraintSolver/PrimitiveConstraints.fs @@ -91,19 +91,5 @@ runTest /// This suggestion was resolved as by design, /// so the test makes sure, we're emitting error message about 'not being a valid object construction expression' let ``Invalid object constructor``() = // Regression test for FSharp1.0:4189 - CompilerAssert.TypeCheckWithErrorsAndOptions - [| "--test:ErrorRanges" |] - """ -type ImmutableStack<'a> private(items: 'a list) = - - member this.Push item = ImmutableStack(item::items) - member this.Pop = match items with | [] -> failwith "No elements in stack" | x::xs -> x,ImmutableStack(xs) - - // Notice type annotation is commented out, which results in an error - new(col (*: seq<'a>*)) = ImmutableStack(List.ofSeq col) - - """ - [| FSharpErrorSeverity.Error, 41, (4, 29, 4, 56), "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. Candidates: new : col:'b -> ImmutableStack<'a>, private new : items:'a list -> ImmutableStack<'a>" - FSharpErrorSeverity.Error, 41, (5, 93, 5, 111), "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. Candidates: new : col:'b -> ImmutableStack<'a>, private new : items:'a list -> ImmutableStack<'a>" - FSharpErrorSeverity.Error, 41, (8, 30, 8, 60), "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. Candidates: new : col:'b -> ImmutableStack<'a> when 'b :> seq<'c>, private new : items:'a list -> ImmutableStack<'a>" - FSharpErrorSeverity.Error, 696, (8, 30, 8, 60), "This is not a valid object construction expression. Explicit object constructors must either call an alternate constructor or initialize all fields of the object and specify a call to a super class constructor." |] \ No newline at end of file + CompilerAssert.TypeCheckWithErrorsAndOptionsAgainstBaseLine [| "--test:ErrorRanges" |] "typecheck/constructors/neg_invalid_constructor.fs" + \ No newline at end of file diff --git a/tests/fsharp/conformance/expressions/syntacticsugar/E_Slices01.bsl b/tests/fsharp/conformance/expressions/syntacticsugar/E_Slices01.bsl index 5e9fee6f6c1..6cf7778a869 100644 --- a/tests/fsharp/conformance/expressions/syntacticsugar/E_Slices01.bsl +++ b/tests/fsharp/conformance/expressions/syntacticsugar/E_Slices01.bsl @@ -1,14 +1,38 @@ -E_Slices01.fsx(22,9,22,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. 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(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(23,9,23,17): 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. 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 +Known types of arguments: int * int option * 'a option -E_Slices01.fsx(24,9,24,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. Candidates: member Foo.GetSlice : x1:float option * x2:int option * y:int -> unit, member Foo.GetSlice : x1:int option * x2:int option * y:int -> unit +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(25,9,25,17): 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. Candidates: member Foo.GetSlice : x1:float option * x2:int option * y:int -> unit, member Foo.GetSlice : x1:int option * x2:int option * y:int -> unit +E_Slices01.fsx(16,9,16,17): 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(26,9,26,17): typecheck error FS0039: The type 'Foo' does not define the field, constructor or member 'Item'. +Known types of arguments: int * 'a option * 'b option -E_Slices01.fsx(27,9,27,26): typecheck error FS0503: A member or object constructor 'GetSlice' taking 4 arguments is not accessible from this code location. All accessible versions of method 'GetSlice' take 3 arguments. +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(28,9,28,20): typecheck error FS0503: A member or object constructor 'GetSlice' taking 5 arguments is not accessible from this code location. All accessible versions of method 'GetSlice' take 3 arguments. +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 + +Candidates: + - member Foo.GetSlice : x1:float option * x2:int option * y:int -> unit + - member Foo.GetSlice : x1:int option * x2:int option * y:int -> unit + +E_Slices01.fsx(18,9,18,17): 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 * 'b option * int + +Candidates: + - member Foo.GetSlice : x1:float option * x2:int option * y:int -> unit + - member Foo.GetSlice : x1:int option * x2:int option * y:int -> unit + +E_Slices01.fsx(19,9,19,17): typecheck error FS0039: The type 'Foo' does not define the field, constructor or member 'Item'. + +E_Slices01.fsx(20,9,20,26): typecheck error FS0503: A member or object constructor 'GetSlice' taking 4 arguments is not accessible from this code location. All accessible versions of method 'GetSlice' take 3 arguments. + +E_Slices01.fsx(21,9,21,20): typecheck error FS0503: A member or object constructor 'GetSlice' taking 5 arguments is not accessible from this code location. All accessible versions of method 'GetSlice' take 3 arguments. diff --git a/tests/fsharp/conformance/expressions/syntacticsugar/E_Slices01.fsx b/tests/fsharp/conformance/expressions/syntacticsugar/E_Slices01.fsx index 72e00c534e7..3512f1ec0a8 100644 --- a/tests/fsharp/conformance/expressions/syntacticsugar/E_Slices01.fsx +++ b/tests/fsharp/conformance/expressions/syntacticsugar/E_Slices01.fsx @@ -2,13 +2,6 @@ #light // Verify errors related to ambiguous slicing overloads -//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\. 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 -//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\. 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 -//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\. Candidates: member Foo\.GetSlice : x1:float option \* x2:int option \* y:int -> unit, member Foo\.GetSlice : x1:int option \* x2:int option \* y:int -> unit -//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\. Candidates: member Foo\.GetSlice : x1:float option \* x2:int option \* y:int -> unit, member Foo\.GetSlice : x1:int option \* x2:int option \* y:int -> unit -//The field, constructor or member 'Item' is not defined -//A member or object constructor 'GetSlice' taking 4 arguments is not accessible from this code location\. All accessible versions of method 'GetSlice' take 3 arguments\. -//A member or object constructor 'GetSlice' taking 5 arguments is not accessible from this code location\. All accessible versions of method 'GetSlice' take 3 arguments\. type Foo<'a>() = member this.GetSlice(x : int, y1 : int option, y2 : int option) = () diff --git a/tests/fsharp/conformance/expressions/type-relatedexpressions/E_RigidTypeAnnotation03.bsl b/tests/fsharp/conformance/expressions/type-relatedexpressions/E_RigidTypeAnnotation03.bsl new file mode 100644 index 00000000000..050ab182d77 --- /dev/null +++ b/tests/fsharp/conformance/expressions/type-relatedexpressions/E_RigidTypeAnnotation03.bsl @@ -0,0 +1,70 @@ + +E_RigidTypeAnnotation03.fsx(17,13,17,16): typecheck error FS0001: This expression was expected to have type + 'sbyte' +but here has type + 'byte' + +E_RigidTypeAnnotation03.fsx(17,9,17,25): typecheck error FS0041: No overloads match for method 'M'. + +Known type of argument: sbyte + +Available overloads: + - static member T.M : a:byte -> int // Argument 'a' doesn't match + - static member T.M : a:decimal -> int // Argument 'a' doesn't match + - static member T.M : a:float -> int // Argument 'a' doesn't match + - static member T.M : a:float32 -> int // Argument 'a' doesn't match + - static member T.M : a:string -> int // Argument 'a' doesn't match + +E_RigidTypeAnnotation03.fsx(18,13,18,19): typecheck error FS0001: This expression was expected to have type + 'float32' +but here has type + 'float<'u>' + +E_RigidTypeAnnotation03.fsx(18,9,18,30): typecheck error FS0041: No overloads match for method 'M'. + +Known type of argument: float32 + +Available overloads: + - static member T.M : a:byte -> int // Argument 'a' doesn't match + - static member T.M : a:decimal -> int // Argument 'a' doesn't match + - static member T.M : a:float -> int // Argument 'a' doesn't match + - static member T.M : a:float32 -> int // Argument 'a' doesn't match + - static member T.M : a:string -> int // Argument 'a' doesn't match + +E_RigidTypeAnnotation03.fsx(19,13,19,20): typecheck error FS0001: This expression was expected to have type + 'float32<'u>' +but here has type + 'decimal' + +E_RigidTypeAnnotation03.fsx(20,13,20,21): typecheck error FS0001: Type mismatch. Expecting a + 'decimal' +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'. + +Known type of argument: decimal + +Available overloads: + - static member T.M : a:byte -> int // Argument 'a' doesn't match + - static member T.M : a:decimal -> int // Argument 'a' doesn't match + - static member T.M : a:float -> int // Argument 'a' doesn't match + - static member T.M : a:float32 -> int // Argument 'a' doesn't match + - static member T.M : a:string -> int // Argument 'a' doesn't match + +E_RigidTypeAnnotation03.fsx(21,14,21,18): typecheck error FS0001: This expression was expected to have type + 'char' +but here has type + 'string' + +E_RigidTypeAnnotation03.fsx(21,9,21,27): typecheck error FS0041: No overloads match for method 'M'. + +Known type of argument: char + +Available overloads: + - static member T.M : a:byte -> int // Argument 'a' doesn't match + - static member T.M : a:decimal -> int // Argument 'a' doesn't match + - static member T.M : a:float -> int // Argument 'a' doesn't match + - static member T.M : a:float32 -> int // Argument 'a' doesn't match + - static member T.M : a:string -> int // Argument 'a' doesn't match diff --git a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/E_RigidTypeAnnotation03.fsx b/tests/fsharp/conformance/expressions/type-relatedexpressions/E_RigidTypeAnnotation03.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/E_RigidTypeAnnotation03.fsx rename to tests/fsharp/conformance/expressions/type-relatedexpressions/E_RigidTypeAnnotation03.fsx diff --git a/tests/fsharp/conformance/inference/E_LeftToRightOverloadResolution01.bsl b/tests/fsharp/conformance/inference/E_LeftToRightOverloadResolution01.bsl index 640806d814c..af2b7e02805 100644 --- a/tests/fsharp/conformance/inference/E_LeftToRightOverloadResolution01.bsl +++ b/tests/fsharp/conformance/inference/E_LeftToRightOverloadResolution01.bsl @@ -1,4 +1,38 @@ -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. Candidates: System.Console.WriteLine(buffer: char []) : unit, System.Console.WriteLine(format: string, [] arg: obj []) : unit, System.Console.WriteLine(value: bool) : unit, System.Console.WriteLine(value: char) : unit, System.Console.WriteLine(value: decimal) : unit, System.Console.WriteLine(value: float) : unit, System.Console.WriteLine(value: float32) : unit, System.Console.WriteLine(value: int) : unit, System.Console.WriteLine(value: int64) : unit, System.Console.WriteLine(value: obj) : unit, System.Console.WriteLine(value: string) : unit, System.Console.WriteLine(value: uint32) : unit, System.Console.WriteLine(value: uint64) : unit +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(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. Candidates: System.Console.WriteLine(buffer: char []) : unit, System.Console.WriteLine(format: string, [] arg: obj []) : unit, System.Console.WriteLine(value: bool) : unit, System.Console.WriteLine(value: char) : unit, System.Console.WriteLine(value: decimal) : unit, System.Console.WriteLine(value: float) : unit, System.Console.WriteLine(value: float32) : unit, System.Console.WriteLine(value: int) : unit, System.Console.WriteLine(value: int64) : unit, System.Console.WriteLine(value: obj) : unit, System.Console.WriteLine(value: string) : unit, System.Console.WriteLine(value: uint32) : unit, System.Console.WriteLine(value: uint64) : unit +Known type of argument: 'a + +Candidates: + - System.Console.WriteLine(buffer: char []) : unit + - System.Console.WriteLine(format: string, [] arg: obj []) : unit + - System.Console.WriteLine(value: bool) : unit + - System.Console.WriteLine(value: char) : unit + - System.Console.WriteLine(value: decimal) : unit + - System.Console.WriteLine(value: float) : unit + - System.Console.WriteLine(value: float32) : unit + - System.Console.WriteLine(value: int) : unit + - System.Console.WriteLine(value: int64) : unit + - System.Console.WriteLine(value: obj) : unit + - System.Console.WriteLine(value: string) : unit + - 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. + +Known type of argument: 'a + +Candidates: + - System.Console.WriteLine(buffer: char []) : unit + - System.Console.WriteLine(format: string, [] arg: obj []) : unit + - System.Console.WriteLine(value: bool) : unit + - System.Console.WriteLine(value: char) : unit + - System.Console.WriteLine(value: decimal) : unit + - System.Console.WriteLine(value: float) : unit + - System.Console.WriteLine(value: float32) : unit + - System.Console.WriteLine(value: int) : unit + - System.Console.WriteLine(value: int64) : unit + - System.Console.WriteLine(value: obj) : unit + - System.Console.WriteLine(value: string) : unit + - System.Console.WriteLine(value: uint32) : unit + - System.Console.WriteLine(value: uint64) : unit diff --git a/tests/fsharp/conformance/inference/E_OneTypeVariable03.bsl b/tests/fsharp/conformance/inference/E_OneTypeVariable03.bsl index ca730fe7ad2..4bfe7f854e2 100644 --- a/tests/fsharp/conformance/inference/E_OneTypeVariable03.bsl +++ b/tests/fsharp/conformance/inference/E_OneTypeVariable03.bsl @@ -1,4 +1,17 @@ -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. Candidates: static member C23.M : x:'a * y:'b -> Two, static member C23.M : x:'a * y:int -> Three +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(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. Candidates: static member C123.M : x:'a * y:'a -> One, static member C123.M : x:'a * y:'b -> Two, static member C123.M : x:'a * y:int -> Three +Known types of arguments: 'a * int + +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. + +Known types of arguments: 'a * int + +Candidates: + - static member C123.M : x:'a * y:'a -> One + - static member C123.M : x:'a * y:'b -> Two + - static member C123.M : x:'a * y:int -> Three diff --git a/tests/fsharp/conformance/inference/E_OneTypeVariable03rec.bsl b/tests/fsharp/conformance/inference/E_OneTypeVariable03rec.bsl index c3d473b6f8c..ebce435a102 100644 --- a/tests/fsharp/conformance/inference/E_OneTypeVariable03rec.bsl +++ b/tests/fsharp/conformance/inference/E_OneTypeVariable03rec.bsl @@ -1,4 +1,17 @@ -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. Candidates: static member C23.M : x:'a * y:'b -> Two, static member C23.M : x:'a * y:int -> Three +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(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. Candidates: static member C123.M : x:'a * y:'a -> One, static member C123.M : x:'a * y:'b -> Two, static member C123.M : x:'a * y:int -> Three +Known types of arguments: 'a * int + +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. + +Known types of arguments: 'a * int + +Candidates: + - static member C123.M : x:'a * y:'a -> One + - static member C123.M : x:'a * y:'b -> Two + - static member C123.M : x:'a * y:int -> Three diff --git a/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariables01.bsl b/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariables01.bsl index ad9bf2298fc..68f02f0b660 100644 --- a/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariables01.bsl +++ b/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariables01.bsl @@ -1,8 +1,32 @@ -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. Candidates: static member C13.M : x:'a * y:'a -> One, static member C13.M : x:'a * y:int -> Three +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(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. Candidates: static member C24.M : x:'a * y:'b -> Two, static member C24.M : x:'a * y:C -> Four +Known types of arguments: 'a * 'b -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. Candidates: static member C13.M : x:'a * y:'a -> One, static member C13.M : x:'a * y:int -> Three +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. 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. + +Known types of arguments: 'a * 'b + +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. + +Known types of arguments: 'a * 'b + +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. + +Known types of arguments: 'a * 'b + +Candidates: + - static member C13.M : x:'a * y:'a -> One + - static member C13.M : x:'a * y:int -> Three diff --git a/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariables01rec.bsl b/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariables01rec.bsl index 45b7dfd315d..ebce84002e8 100644 --- a/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariables01rec.bsl +++ b/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariables01rec.bsl @@ -1,8 +1,32 @@ -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. Candidates: static member C13.M : x:'a * y:'a -> One, static member C13.M : x:'a * y:int -> Three +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(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. Candidates: static member C24.M : x:'a * y:'b -> Two, static member C24.M : x:'a * y:C -> Four +Known types of arguments: 'a * 'b -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. Candidates: static member C13.M : x:'a * y:'a -> One, static member C13.M : x:'a * y:int -> Three +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. 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. + +Known types of arguments: 'a * 'b + +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. + +Known types of arguments: 'a * 'b + +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. + +Known types of arguments: 'a * 'b + +Candidates: + - static member C13.M : x:'a * y:'a -> One + - static member C13.M : x:'a * y:int -> Three diff --git a/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariablesGen00.bsl b/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariablesGen00.bsl new file mode 100644 index 00000000000..c7e86d6047f --- /dev/null +++ b/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariablesGen00.bsl @@ -0,0 +1,56 @@ + +E_TwoDifferentTypeVariablesGen00.fsx(61,52,61,53): typecheck error FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'a has been constrained to be type ''b'. + +E_TwoDifferentTypeVariablesGen00.fsx(61,18,61,42): typecheck error FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'b has been constrained to be type ''a'. + +E_TwoDifferentTypeVariablesGen00.fsx(61,18,61,42): typecheck error FS0043: The type ''b' does not match the type ''b0' + +E_TwoDifferentTypeVariablesGen00.fsx(62,52,62,53): typecheck error FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'b has been constrained to be type 'int'. + +E_TwoDifferentTypeVariablesGen00.fsx(62,18,62,42): 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. + +Known types of arguments: 'a * 'b + +Candidates: + - static member C13.M : x:'a * y:'a -> One + - static member C13.M : x:'a * y:int -> Three + +E_TwoDifferentTypeVariablesGen00.fsx(64,56,64,57): typecheck error FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'a has been constrained to be type ''b'. + +E_TwoDifferentTypeVariablesGen00.fsx(64,18,64,42): typecheck error FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'b has been constrained to be type ''a'. + +E_TwoDifferentTypeVariablesGen00.fsx(64,18,64,42): typecheck error FS0043: The type ''b' does not match the type ''b0' + +E_TwoDifferentTypeVariablesGen00.fsx(65,54,65,55): typecheck error FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'b has been constrained to be type ''a'. + +E_TwoDifferentTypeVariablesGen00.fsx(65,56,65,57): typecheck error FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'a has been constrained to be type 'int'. + +E_TwoDifferentTypeVariablesGen00.fsx(65,18,65,42): 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. + +Known types of arguments: 'a * 'b + +Candidates: + - static member C13.M : x:'a * y:'a -> One + - static member C13.M : x:'a * y:int -> Three + +E_TwoDifferentTypeVariablesGen00.fsx(67,55,67,56): typecheck error FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'a has been constrained to be type ''b'. + +E_TwoDifferentTypeVariablesGen00.fsx(67,18,67,42): typecheck error FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'b has been constrained to be type ''a'. + +E_TwoDifferentTypeVariablesGen00.fsx(67,18,67,42): 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. + +Known types of arguments: 'a * 'b + +Candidates: + - static member C13.M : x:'a * y:'a -> One + - static member C13.M : x:'a * y:int -> Three + +E_TwoDifferentTypeVariablesGen00.fsx(69,55,69,56): typecheck error FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'b has been constrained to be type 'int'. + +E_TwoDifferentTypeVariablesGen00.fsx(69,18,69,42): typecheck error FS0043: The type ''b' does not match the type 'int' diff --git a/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariablesGen00.fsx b/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariablesGen00.fsx new file mode 100644 index 00000000000..304f6681422 --- /dev/null +++ b/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariablesGen00.fsx @@ -0,0 +1,69 @@ +// #Regression #TypeInference +// Regression test for FSHARP1.0:4758 +// Type Inference +// Check Method Disambiguation When User Generic Variable Get Instantiated By Overload Resolution +module M +// These different return types are used to determine which overload got chosen +type One = | One +type Two = | Two +type Three = | Three +type Four = | Four + +// An unsealed type +type C() = + member x.P = 1 + +type C1 = + static member M<'a>(x:'a,y:'a) = One + +type C2 = + static member M<'a,'b>(x:'a,y:'b) = Two + +type C3 = + static member M<'a>(x:'a,y:int) = Three + +type C4 = + static member M<'a>(x:'a,y:C) = Four + +type C12 = + static member M<'a>(x:'a,y:'a) = One + static member M<'a,'b>(x:'a,y:'b) = Two + +type C23 = + static member M<'a,'b>(x:'a,y:'b) = Two + static member M<'a>(x:'a,y:int) = Three + +type C13 = + static member M<'a>(x:'a,y:'a) = One + static member M<'a>(x:'a,y:int) = Three + +type C14 = + static member M<'a>(x:'a,y:'a) = One + static member M<'a>(x:'a,y:C) = Four + +type C24 = + static member M<'a,'b>(x:'a,y:'b) = Two + static member M<'a>(x:'a,y:C) = Four + +type C123 = + static member M<'a>(x:'a,y:'a) = One + static member M<'a,'b>(x:'a,y:'b) = Two + static member M<'a>(x:'a,y:int) = Three + +type C1234 = + static member M<'a>(x:'a,y:'a) = One + static member M<'a,'b>(x:'a,y:'b) = Two + static member M<'a>(x:'a,y:int) = Three + static member M<'a>(x:'a,y:C) = Four + + +module M0Rec = + let rec gB1<'a,'b> (x:'a) (y:'b) = C1.M(x,y) = One // expect: type error + let rec gB3<'a,'b> (x:'a) (y:'b) = C3.M(x,y) = Three // expect: type error + let rec gB13<'a,'b> (x:'a) (y:'b) = C13.M(x,y) // expect: ambiguity error (and note: both would instantiate 'a or 'b) + let rec gC1<'a,'b> (x:'a) (y:'b) = C1.M<'a>(x,y) = One // expect: error + let rec gC3<'a,'b> (x:'a) (y:'b) = C3.M<'b>(x,y) = Three // expect: error + let rec gC13<'a,'b> (x:'a) (y:'b) = C13.M<'a>(x,y) // expect: ambiguity error + let rec gD1<'a,'b> (x:'a) (y:'b) = C1.M<_>(x,y) = One // expect: type error + let rec gD13<'a,'b> (x:'a) (y:'b) = C13.M<_>(x,y) // expect: ambiguity error (and note: both would instantiate 'a or 'b) + let rec gD3<'a,'b> (x:'a) (y:'b) = C3.M<_>(x,y) = Three // expect: error diff --git a/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariablesGen00rec.bsl b/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariablesGen00rec.bsl index 615200ca5b2..d1d42d2fa4a 100644 --- a/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariablesGen00rec.bsl +++ b/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariablesGen00rec.bsl @@ -9,7 +9,13 @@ E_TwoDifferentTypeVariablesGen00rec.fsx(62,52,62,53): typecheck error FS0064: Th E_TwoDifferentTypeVariablesGen00rec.fsx(62,18,62,42): 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. Candidates: static member C13.M : x:'a * y:'a -> One, static member C13.M : x:'a * y:int -> Three +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. + +Known types of arguments: 'a * 'b + +Candidates: + - static member C13.M : x:'a * y:'a -> One + - static member C13.M : x:'a * y:int -> Three E_TwoDifferentTypeVariablesGen00rec.fsx(64,56,64,57): typecheck error FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'a has been constrained to be type ''b'. @@ -23,7 +29,13 @@ E_TwoDifferentTypeVariablesGen00rec.fsx(65,56,65,57): typecheck error FS0064: Th E_TwoDifferentTypeVariablesGen00rec.fsx(65,18,65,42): 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. Candidates: static member C13.M : x:'a * y:'a -> One, static member C13.M : x:'a * y:int -> Three +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. + +Known types of arguments: 'a * 'b + +Candidates: + - static member C13.M : x:'a * y:'a -> One + - static member C13.M : x:'a * y:int -> Three E_TwoDifferentTypeVariablesGen00rec.fsx(67,55,67,56): typecheck error FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'a has been constrained to be type ''b'. @@ -31,7 +43,13 @@ E_TwoDifferentTypeVariablesGen00rec.fsx(67,18,67,42): typecheck error FS0064: Th E_TwoDifferentTypeVariablesGen00rec.fsx(67,18,67,42): 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. Candidates: static member C13.M : x:'a * y:'a -> One, static member C13.M : x:'a * y:int -> Three +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. + +Known types of arguments: 'a * 'b + +Candidates: + - static member C13.M : x:'a * y:'a -> One + - static member C13.M : x:'a * y:int -> Three E_TwoDifferentTypeVariablesGen00rec.fsx(69,55,69,56): typecheck error FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'b has been constrained to be type 'int'. diff --git a/tests/fsharp/conformance/inference/E_TwoEqualTypeVariables02.bsl b/tests/fsharp/conformance/inference/E_TwoEqualTypeVariables02.bsl index 0e2957d293f..e1ce253e983 100644 --- a/tests/fsharp/conformance/inference/E_TwoEqualTypeVariables02.bsl +++ b/tests/fsharp/conformance/inference/E_TwoEqualTypeVariables02.bsl @@ -1,12 +1,51 @@ -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. Candidates: static member C12.M : x:'a * y:'a -> One, static member C12.M : x:'a * y:'b -> Two +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(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. Candidates: static member C14.M : x:'a * y:'a -> One, static member C14.M : x:'a * y:C -> Four +Known types of arguments: 'a * 'a -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. Candidates: static member C24.M : x:'a * y:'b -> Two, static member C24.M : x:'a * y:C -> Four +Candidates: + - static member C12.M : x:'a * y:'a -> One + - static member C12.M : x:'a * y:'b -> Two -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. Candidates: static member C123.M : x:'a * y:'a -> One, static member C123.M : x:'a * y:'b -> Two, static member C123.M : x:'a * y:int -> Three +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(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. Candidates: static member C1234.M : x:'a * y:'a -> One, static member C1234.M : x:'a * y:'b -> Two, static member C1234.M : x:'a * y:C -> Four, static member C1234.M : x:'a * y:int -> Three +Known types of arguments: 'a * 'a -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. Candidates: static member C14.M : x:'a * y:'a -> One, static member C14.M : x:'a * y:C -> Four +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. + +Known types of arguments: 'a * 'a + +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. + +Known types of arguments: 'a * 'a + +Candidates: + - static member C123.M : x:'a * y:'a -> One + - 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. + +Known types of arguments: 'a * 'a + +Candidates: + - static member C1234.M : x:'a * y:'a -> One + - static member C1234.M : x:'a * y:'b -> Two + - 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. + +Known types of arguments: 'a * 'a + +Candidates: + - static member C14.M : x:'a * y:'a -> One + - static member C14.M : x:'a * y:C -> Four diff --git a/tests/fsharp/conformance/inference/E_TwoEqualYypeVariables02rec.bsl b/tests/fsharp/conformance/inference/E_TwoEqualYypeVariables02rec.bsl index d9974a98abe..d206b5b6625 100644 --- a/tests/fsharp/conformance/inference/E_TwoEqualYypeVariables02rec.bsl +++ b/tests/fsharp/conformance/inference/E_TwoEqualYypeVariables02rec.bsl @@ -1,12 +1,51 @@ -E_TwoEqualYypeVariables02rec.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. Candidates: static member C12.M : x:'a * y:'a -> One, static member C12.M : x:'a * y:'b -> Two +E_TwoEqualYypeVariables02rec.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_TwoEqualYypeVariables02rec.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. Candidates: static member C14.M : x:'a * y:'a -> One, static member C14.M : x:'a * y:C -> Four +Known types of arguments: 'a * 'a -E_TwoEqualYypeVariables02rec.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. Candidates: static member C24.M : x:'a * y:'b -> Two, static member C24.M : x:'a * y:C -> Four +Candidates: + - static member C12.M : x:'a * y:'a -> One + - static member C12.M : x:'a * y:'b -> Two -E_TwoEqualYypeVariables02rec.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. Candidates: static member C123.M : x:'a * y:'a -> One, static member C123.M : x:'a * y:'b -> Two, static member C123.M : x:'a * y:int -> Three +E_TwoEqualYypeVariables02rec.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_TwoEqualYypeVariables02rec.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. Candidates: static member C1234.M : x:'a * y:'a -> One, static member C1234.M : x:'a * y:'b -> Two, static member C1234.M : x:'a * y:C -> Four, static member C1234.M : x:'a * y:int -> Three +Known types of arguments: 'a * 'a -E_TwoEqualYypeVariables02rec.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. Candidates: static member C14.M : x:'a * y:'a -> One, static member C14.M : x:'a * y:C -> Four +Candidates: + - static member C14.M : x:'a * y:'a -> One + - static member C14.M : x:'a * y:C -> Four + +E_TwoEqualYypeVariables02rec.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. + +Known types of arguments: 'a * 'a + +Candidates: + - static member C24.M : x:'a * y:'b -> Two + - static member C24.M : x:'a * y:C -> Four + +E_TwoEqualYypeVariables02rec.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. + +Known types of arguments: 'a * 'a + +Candidates: + - static member C123.M : x:'a * y:'a -> One + - static member C123.M : x:'a * y:'b -> Two + - static member C123.M : x:'a * y:int -> Three + +E_TwoEqualYypeVariables02rec.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. + +Known types of arguments: 'a * 'a + +Candidates: + - static member C1234.M : x:'a * y:'a -> One + - static member C1234.M : x:'a * y:'b -> Two + - static member C1234.M : x:'a * y:C -> Four + - static member C1234.M : x:'a * y:int -> Three + +E_TwoEqualYypeVariables02rec.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. + +Known types of arguments: 'a * 'a + +Candidates: + - static member C14.M : x:'a * y:'a -> One + - static member C14.M : x:'a * y:C -> Four diff --git a/tests/fsharp/conformance/lexicalanalysis/E_LessThanDotOpenParen001.bsl b/tests/fsharp/conformance/lexicalanalysis/E_LessThanDotOpenParen001.bsl new file mode 100644 index 00000000000..bff8ba48cfd --- /dev/null +++ b/tests/fsharp/conformance/lexicalanalysis/E_LessThanDotOpenParen001.bsl @@ -0,0 +1,32 @@ + +E_LessThanDotOpenParen001.fsx(23,12,23,15): typecheck error FS0043: No overloads match for method 'op_PlusPlusPlus'. + +Known return type: ^a + +Known type parameters: < (string -> int) , TestType > + +Available overloads: + - static member TestType.( +++ ) : a:'T * b:TestType<'T,'S> -> 'T // Argument 'a' doesn't match + - static member TestType.( +++ ) : a:TestType<'T,'S> * b:'T -> 'T // Argument 'a' doesn't match + - 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'. + +Known types of arguments: (string -> int) * TestType + +Available overloads: + - static member TestType.( +++ ) : a:'T * b:TestType<'T,'S> -> 'T // Argument 'a' doesn't match + - static member TestType.( +++ ) : a:TestType<'T,'S> * b:'T -> 'T // Argument 'a' doesn't match + - 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'. + +Known types of arguments: (string -> int) * TestType + +Available overloads: + - static member TestType.( +++ ) : a:'T * b:TestType<'T,'S> -> 'T // Argument 'a' doesn't match + - static member TestType.( +++ ) : a:TestType<'T,'S> * b:'T -> 'T // Argument 'a' doesn't match + - 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 diff --git a/tests/fsharp/conformance/lexicalanalysis/E_LessThanDotOpenParen001.fsx b/tests/fsharp/conformance/lexicalanalysis/E_LessThanDotOpenParen001.fsx new file mode 100644 index 00000000000..fa36780197d --- /dev/null +++ b/tests/fsharp/conformance/lexicalanalysis/E_LessThanDotOpenParen001.fsx @@ -0,0 +1,26 @@ +type public TestType<'T,'S>() = + + member public s.Value with get() = Unchecked.defaultof<'T> + static member public (+++) (a : TestType<'T,'S>, b : TestType<'T,'S>) = a.Value + static member public (+++) (a : TestType<'T,'S>, b : 'T) = b + static member public (+++) (a : 'T, b : TestType<'T,'S>) = a + static member public (+++) (a : TestType<'T,'S>, b : 'T -> 'S) = a.Value + + // this is triggering https://github.com/dotnet/fsharp/issues/6725 and make the error reported by compiler flaky + //static member public (+++) (a : 'S -> 'T, b : TestType<'T,'S>) = (a 17) + b.Value + +let inline (+++) (a : ^a) (b : ^b) = ((^a or ^b): (static member (+++): ^a * ^b -> ^c) (a,b) ) + +let tt0 = TestType() +let tt1 = TestType() + +let f (x : string) = 18 + +let a0 = tt0 +++ tt1 +let a1 = tt0 +++ 11 +let a2 = 12 +++ tt1 +let a3 = tt0 +++ (fun x -> "18") +let a4 = f +++ tt0 + +let a5 = TestType.(+++)(f, tt0) +let a6 = TestType.(+++)((fun (x : string) -> 18), tt0) 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 89cb5ac7714..f78afd6271c 100644 --- a/tests/fsharp/conformance/wellformedness/E_Clashing_Values_in_AbstractClass01.bsl +++ b/tests/fsharp/conformance/wellformedness/E_Clashing_Values_in_AbstractClass01.bsl @@ -1,2 +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. Candidates: member Q.X : unit -> decimal, member Q.X : unit -> float +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. +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 76328f65578..d95b136a7c2 100644 --- a/tests/fsharp/conformance/wellformedness/E_Clashing_Values_in_AbstractClass03.bsl +++ b/tests/fsharp/conformance/wellformedness/E_Clashing_Values_in_AbstractClass03.bsl @@ -1,4 +1,16 @@ -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. Candidates: abstract member D.M : 'T -> int, abstract member D.M : 'U -> string +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(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. Candidates: abstract member D.M : 'T -> int, abstract member D.M : 'U -> string +Known type of argument: int + +Candidates: + - abstract member D.M : 'T -> int + - abstract member 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. + +Known type of argument: int + +Candidates: + - abstract member D.M : 'T -> int + - abstract member D.M : 'U -> string 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 af3ee273c49..77e2d6c7e33 100644 --- a/tests/fsharp/conformance/wellformedness/E_Clashing_Values_in_AbstractClass04.bsl +++ b/tests/fsharp/conformance/wellformedness/E_Clashing_Values_in_AbstractClass04.bsl @@ -1,4 +1,16 @@ -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. Candidates: abstract member D.M : 'T -> int, abstract member D.M : 'U -> string +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(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. Candidates: abstract member D.M : 'T -> int, abstract member D.M : 'U -> string +Known type of argument: int + +Candidates: + - abstract member D.M : 'T -> int + - abstract member 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. + +Known type of argument: int + +Candidates: + - abstract member D.M : 'T -> int + - abstract member D.M : 'U -> string diff --git a/tests/fsharp/core/fsfromfsviacs/compilation.errors.output.bsl b/tests/fsharp/core/fsfromfsviacs/compilation.errors.output.bsl index 75c7c59d700..a626954ec3e 100644 --- a/tests/fsharp/core/fsfromfsviacs/compilation.errors.output.bsl +++ b/tests/fsharp/core/fsfromfsviacs/compilation.errors.output.bsl @@ -1,55 +1,202 @@ -test.fsx(186,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. Candidates: SomeClass.OverloadedMethodTakingOptionals(?x: int,?y: string,?d: float) : int, SomeClass.OverloadedMethodTakingOptionals(?x: int,?y: string,?d: float32) : int +test.fsx(186,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. +Candidates: + - SomeClass.OverloadedMethodTakingOptionals(?x: int,?y: string,?d: float) : int + - SomeClass.OverloadedMethodTakingOptionals(?x: int,?y: string,?d: float32) : int -test.fsx(187,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. Candidates: SomeClass.OverloadedMethodTakingOptionals(?x: int,?y: string,?d: float) : int, SomeClass.OverloadedMethodTakingOptionals(?x: int,?y: string,?d: float32) : int +test.fsx(187,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(188,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. Candidates: SomeClass.OverloadedMethodTakingOptionals(?x: int,?y: string,?d: float) : int, SomeClass.OverloadedMethodTakingOptionals(?x: int,?y: string,?d: float32) : int +Known type of argument: x:int -test.fsx(189,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. Candidates: SomeClass.OverloadedMethodTakingOptionals(?x: int,?y: string,?d: float) : int, SomeClass.OverloadedMethodTakingOptionals(?x: int,?y: string,?d: float32) : int +Candidates: + - SomeClass.OverloadedMethodTakingOptionals(?x: int,?y: string,?d: float) : int + - SomeClass.OverloadedMethodTakingOptionals(?x: int,?y: string,?d: float32) : int -test.fsx(190,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. Candidates: SomeClass.OverloadedMethodTakingOptionals(?x: int,?y: string,?d: float) : int, SomeClass.OverloadedMethodTakingOptionals(?x: int,?y: string,?d: float32) : int +test.fsx(188,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(191,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. Candidates: SomeClass.OverloadedMethodTakingOptionals(?x: int,?y: string,?d: float) : int, SomeClass.OverloadedMethodTakingOptionals(?x: int,?y: string,?d: float32) : int +Known type of argument: y:string -test.fsx(192,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. Candidates: SomeClass.OverloadedMethodTakingOptionals(?x: int,?y: string,?d: float) : int, SomeClass.OverloadedMethodTakingOptionals(?x: int,?y: string,?d: float32) : int +Candidates: + - SomeClass.OverloadedMethodTakingOptionals(?x: int,?y: string,?d: float) : int + - SomeClass.OverloadedMethodTakingOptionals(?x: int,?y: string,?d: float32) : int -test.fsx(193,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. Candidates: SomeClass.OverloadedMethodTakingOptionals(?x: int,?y: string,?d: float) : int, SomeClass.OverloadedMethodTakingOptionals(?x: int,?y: string,?d: float32) : int +test.fsx(189,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(196,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. Candidates: SomeClass.OverloadedMethodTakingOptionals(?x: int,?y: string,?d: float) : int, SomeClass.OverloadedMethodTakingOptionals(?x: int,?y: string,?d: float32) : int +Known type of argument: x:int option -test.fsx(198,34): 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 +Candidates: + - SomeClass.OverloadedMethodTakingOptionals(?x: int,?y: string,?d: float) : int + - SomeClass.OverloadedMethodTakingOptionals(?x: int,?y: string,?d: float32) : int -test.fsx(199,34): 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(190,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(200,34): 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 +Known type of argument: y:string option -test.fsx(201,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. Candidates: SomeClass.OverloadedMethodTakingNullableOptionalsWithDefaults(?x: Nullable,?y: string,?d: Nullable) : int, SomeClass.OverloadedMethodTakingNullableOptionalsWithDefaults(?x: Nullable,?y: string,?d: Nullable) : int +Candidates: + - SomeClass.OverloadedMethodTakingOptionals(?x: int,?y: string,?d: float) : int + - SomeClass.OverloadedMethodTakingOptionals(?x: int,?y: string,?d: float32) : int -test.fsx(202,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. Candidates: SomeClass.OverloadedMethodTakingNullableOptionalsWithDefaults(?x: Nullable,?y: string,?d: Nullable) : int, SomeClass.OverloadedMethodTakingNullableOptionalsWithDefaults(?x: Nullable,?y: string,?d: Nullable) : int +test.fsx(191,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(203,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. Candidates: SomeClass.OverloadedMethodTakingNullableOptionalsWithDefaults(?x: Nullable,?y: string,?d: Nullable) : int, SomeClass.OverloadedMethodTakingNullableOptionalsWithDefaults(?x: Nullable,?y: string,?d: Nullable) : int +Known type of argument: x:'a option -test.fsx(204,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. Candidates: SomeClass.OverloadedMethodTakingNullableOptionalsWithDefaults(?x: Nullable,?y: string,?d: Nullable) : int, SomeClass.OverloadedMethodTakingNullableOptionalsWithDefaults(?x: Nullable,?y: string,?d: Nullable) : int +Candidates: + - SomeClass.OverloadedMethodTakingOptionals(?x: int,?y: string,?d: float) : int + - SomeClass.OverloadedMethodTakingOptionals(?x: int,?y: string,?d: float32) : int -test.fsx(206,42): 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(192,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(207,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. Candidates: SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable,?y: string,?d: Nullable) : int, SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable,?y: string,?d: Nullable) : int +Known type of argument: y:'a option -test.fsx(208,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. Candidates: SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable,?y: string,?d: Nullable) : int, SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable,?y: string,?d: Nullable) : int +Candidates: + - SomeClass.OverloadedMethodTakingOptionals(?x: int,?y: string,?d: float) : int + - SomeClass.OverloadedMethodTakingOptionals(?x: int,?y: string,?d: float32) : int -test.fsx(209,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. Candidates: SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable,?y: string,?d: Nullable) : int, SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable,?y: string,?d: Nullable) : int +test.fsx(193,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(210,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. Candidates: SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable,?y: string,?d: Nullable) : int, SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable,?y: string,?d: Nullable) : int +Known type of argument: d:'a option -test.fsx(211,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. Candidates: SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable,?y: string,?d: Nullable) : int, SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable,?y: string,?d: Nullable) : int +Candidates: + - SomeClass.OverloadedMethodTakingOptionals(?x: int,?y: string,?d: float) : int + - SomeClass.OverloadedMethodTakingOptionals(?x: int,?y: string,?d: float32) : int -test.fsx(212,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. Candidates: SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable,?y: string,?d: Nullable) : int, SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable,?y: string,?d: Nullable) : int +test.fsx(196,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(213,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. Candidates: SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable,?y: string,?d: Nullable) : int, SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable,?y: string,?d: Nullable) : int +Known type of argument: 'a0 -test.fsx(214,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. Candidates: SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable,?y: string,?d: Nullable) : int, SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable,?y: string,?d: Nullable) : int +Candidates: + - SomeClass.OverloadedMethodTakingOptionals(?x: int,?y: string,?d: float) : int + - SomeClass.OverloadedMethodTakingOptionals(?x: int,?y: string,?d: float32) : int -test.fsx(215,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. Candidates: SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable,?y: string,?d: Nullable) : int, SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable,?y: string,?d: Nullable) : int +test.fsx(198,34): 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(199,34): 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 + +Candidates: + - SomeClass.OverloadedMethodTakingNullableOptionalsWithDefaults(?x: Nullable,?y: string,?d: Nullable) : int + - SomeClass.OverloadedMethodTakingNullableOptionalsWithDefaults(?x: Nullable,?y: string,?d: Nullable) : int + +test.fsx(200,34): 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 + +Candidates: + - SomeClass.OverloadedMethodTakingNullableOptionalsWithDefaults(?x: Nullable,?y: string,?d: Nullable) : int + - SomeClass.OverloadedMethodTakingNullableOptionalsWithDefaults(?x: Nullable,?y: string,?d: Nullable) : int + +test.fsx(201,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. + +Known type of argument: d:float + +Candidates: + - SomeClass.OverloadedMethodTakingNullableOptionalsWithDefaults(?x: Nullable,?y: string,?d: Nullable) : int + - SomeClass.OverloadedMethodTakingNullableOptionalsWithDefaults(?x: Nullable,?y: string,?d: Nullable) : int + +test.fsx(202,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. + +Known type of argument: d:float option + +Candidates: + - SomeClass.OverloadedMethodTakingNullableOptionalsWithDefaults(?x: Nullable,?y: string,?d: Nullable) : int + - SomeClass.OverloadedMethodTakingNullableOptionalsWithDefaults(?x: Nullable,?y: string,?d: Nullable) : int + +test.fsx(203,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. + +Known type of argument: x:'a option + +Candidates: + - SomeClass.OverloadedMethodTakingNullableOptionalsWithDefaults(?x: Nullable,?y: string,?d: Nullable) : int + - SomeClass.OverloadedMethodTakingNullableOptionalsWithDefaults(?x: Nullable,?y: string,?d: Nullable) : int + +test.fsx(204,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. + +Known type of argument: d:'a option + +Candidates: + - SomeClass.OverloadedMethodTakingNullableOptionalsWithDefaults(?x: Nullable,?y: string,?d: Nullable) : int + - SomeClass.OverloadedMethodTakingNullableOptionalsWithDefaults(?x: Nullable,?y: string,?d: Nullable) : int + +test.fsx(206,42): 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 + +Candidates: + - SomeClass.OverloadedMethodTakingNullableOptionalsWithDefaults(?x: Nullable,?y: string,?d: Nullable) : int + - SomeClass.OverloadedMethodTakingNullableOptionalsWithDefaults(?x: Nullable,?y: string,?d: Nullable) : int + +test.fsx(207,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. +Candidates: + - SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable,?y: string,?d: Nullable) : int + - SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable,?y: string,?d: Nullable) : int + +test.fsx(208,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. + +Known type of argument: y:string + +Candidates: + - SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable,?y: string,?d: Nullable) : int + - SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable,?y: string,?d: Nullable) : int + +test.fsx(209,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. + +Known type of argument: d:float + +Candidates: + - SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable,?y: string,?d: Nullable) : int + - SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable,?y: string,?d: Nullable) : int + +test.fsx(210,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. + +Known type of argument: d:Nullable + +Candidates: + - SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable,?y: string,?d: Nullable) : int + - SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable,?y: string,?d: Nullable) : int + +test.fsx(211,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. + +Known type of argument: d:float + +Candidates: + - SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable,?y: string,?d: Nullable) : int + - SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable,?y: string,?d: Nullable) : int + +test.fsx(212,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. + +Known type of argument: d:float option + +Candidates: + - SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable,?y: string,?d: Nullable) : int + - SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable,?y: string,?d: Nullable) : int + +test.fsx(213,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. + +Known type of argument: x:'a option + +Candidates: + - SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable,?y: string,?d: Nullable) : int + - SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable,?y: string,?d: Nullable) : int + +test.fsx(214,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. + +Known type of argument: d:'a option + +Candidates: + - SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable,?y: string,?d: Nullable) : int + - SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable,?y: string,?d: Nullable) : int + +test.fsx(215,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. + +Known type of argument: 'a0 + +Candidates: + - SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable,?y: string,?d: Nullable) : int + - SomeClass.OverloadedMethodTakingNullableOptionals(?x: Nullable,?y: string,?d: Nullable) : int test.fsx(232,15): warning FS0025: Incomplete pattern matches on this expression. For example, the value 'U2 (_, U1 (_, "a"))' may indicate a case not covered by the pattern(s). diff --git a/tests/fsharp/core/fsfromfsviacs/compilation.langversion.old.output.bsl b/tests/fsharp/core/fsfromfsviacs/compilation.langversion.old.output.bsl index 37bb96b77a3..ac498298de1 100644 --- a/tests/fsharp/core/fsfromfsviacs/compilation.langversion.old.output.bsl +++ b/tests/fsharp/core/fsfromfsviacs/compilation.langversion.old.output.bsl @@ -122,4 +122,7 @@ test.fsx(232,15): warning FS0025: Incomplete pattern matches on this expression. test.fsx(249,15): warning FS0025: Incomplete pattern matches on this expression. For example, the value 'U2 (_, U1 (_, "a"))' may indicate a case not covered by the pattern(s). -test.fsx(383,29): error FS0041: A unique overload for method 'SimpleOverload' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: SomeClass.SimpleOverload(?x: Nullable) : int, SomeClass.SimpleOverload(?x: int) : int +test.fsx(383,29): error FS0041: A unique overload for method 'SimpleOverload' could not be determined based on type information prior to this program point. A type annotation may be needed. +Candidates: + - SomeClass.SimpleOverload(?x: Nullable) : int + - SomeClass.SimpleOverload(?x: int) : int diff --git a/tests/fsharp/readme.md b/tests/fsharp/readme.md index c12bf5a5e44..f4e4af1e49e 100644 --- a/tests/fsharp/readme.md +++ b/tests/fsharp/readme.md @@ -2,7 +2,7 @@ ## Layout -The tests are NUNIT test cases.. They test a very wide range of compiler, interactive and FSharp.Core scenarios. +The tests are NUNIT test cases. They test a very wide range of compiler, interactive and FSharp.Core scenarios. The bulk of the test cases are enumerated in tests.fs, these are the old cambridge test suite. They build on a test-suite ported from windows batch files. They run the compiler and fsi as seperate processes, when built for the coreclr it runs the coreclr versions using dotnet.exe @@ -60,8 +60,6 @@ let changeX() = When a test is run, .err/.vserr output files are created and compared to their matching .bsl files. -When many tests fail due to a change being worked on, the [update.base.line.with.actuals.fsx](update.base.line.with.actuals.fsx) script helps updating the .bsl against the actuals. - -After editing the folder list, evaluating the script should replace the .bsl files with actual .err/.vserr, after which the same test is supposed to pass. +Refer to [Test Guide](../../TESTGUIDE.md#baselines) to know more about how to update them. Tests are organized under modules as functions bearing NUnit `[]` attribute and can be run from an IDE or the command line (see the [Test Guide](../../TESTGUIDE.md)). diff --git a/tests/fsharp/test-framework.fs b/tests/fsharp/test-framework.fs index 15fe1e98bf0..2a10f5bcbb3 100644 --- a/tests/fsharp/test-framework.fs +++ b/tests/fsharp/test-framework.fs @@ -485,7 +485,9 @@ let diff normalize path1 path2 = let append s = result.AppendLine s |> ignore let cwd = Directory.GetCurrentDirectory() - if not <| File.Exists(path1) then failwithf "Invalid path %s" path1 + if not <| File.Exists(path1) then + // creating empty baseline file as this is likely someone initializing a new test + File.WriteAllText(path1, String.Empty) if not <| File.Exists(path2) then failwithf "Invalid path %s" path2 let lines1 = File.ReadAllLines(path1) diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index f382963b765..b909209554a 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -2950,17 +2950,35 @@ module GeneratedSignatureTests = #if !FSHARP_SUITE_DRIVES_CORECLR_TESTS module OverloadResolution = - module FSharpQAMigrated = + module ``fsharpqa migrated tests`` = let [] ``Conformance\Expressions\SyntacticSugar (E_Slices01.fs)`` () = singleNegTest (testConfig "conformance/expressions/syntacticsugar") "E_Slices01" - let [] ``Conformance\InferenceProcedures\TypeInference (E_OneTypeVariable03.fs)`` () = singleNegTest (testConfig "conformance/inference") "E_OneTypeVariable03" - let [] ``Conformance\InferenceProcedures\TypeInference (E_OneTypeVariable03rec.fs)`` () = singleNegTest (testConfig "conformance/inference") "E_OneTypeVariable03rec" - let [] ``Conformance\InferenceProcedures\TypeInference (E_TwoDifferentTypeVariables01.fs)`` () = singleNegTest (testConfig "conformance/inference") "E_TwoDifferentTypeVariables01" - let [] ``Conformance\InferenceProcedures\TypeInference (E_TwoDifferentTypeVariables01rec.fs)`` () = singleNegTest (testConfig "conformance/inference") "E_TwoDifferentTypeVariables01rec" - let [] ``Conformance\InferenceProcedures\TypeInference (E_TwoDifferentTypeVariablesGen00rec.fs)`` () = singleNegTest (testConfig "conformance/inference") "E_TwoDifferentTypeVariablesGen00rec" - let [] ``Conformance\InferenceProcedures\TypeInference (E_TwoEqualTypeVariables02.fs)`` () = singleNegTest (testConfig "conformance/inference") "E_TwoEqualTypeVariables02" - let [] ``Conformance\InferenceProcedures\TypeInference (E_TwoEqualYypeVariables02rec.fs)`` () = singleNegTest (testConfig "conformance/inference") "E_TwoEqualYypeVariables02rec" - let [] ``Conformance\InferenceProcedures\TypeInference (E_LeftToRightOverloadResolution01.fs)`` () = singleNegTest (testConfig "conformance/inference") "E_LeftToRightOverloadResolution01" - let [] ``Conformance\InferenceProcedures\WellFormednessChecking (E_Clashing_Values_in_AbstractClass01.fs) `` () = singleNegTest (testConfig "conformance/wellformedness") "E_Clashing_Values_in_AbstractClass01" - let [] ``Conformance\InferenceProcedures\WellFormednessChecking (E_Clashing_Values_in_AbstractClass03.fs) `` () = singleNegTest (testConfig "conformance/wellformedness") "E_Clashing_Values_in_AbstractClass03" - let [] ``Conformance\InferenceProcedures\WellFormednessChecking (E_Clashing_Values_in_AbstractClass04.fs) `` () = singleNegTest (testConfig "conformance/wellformedness") "E_Clashing_Values_in_AbstractClass04" + let [] ``Conformance\Expressions\Type-relatedExpressions (E_RigidTypeAnnotation03.fsx)`` () = singleNegTest (testConfig "conformance/expressions/type-relatedexpressions") "E_RigidTypeAnnotation03" + let [] ``Conformance\Inference (E_OneTypeVariable03.fs)`` () = singleNegTest (testConfig "conformance/inference") "E_OneTypeVariable03" + let [] ``Conformance\Inference (E_OneTypeVariable03rec.fs)`` () = singleNegTest (testConfig "conformance/inference") "E_OneTypeVariable03rec" + let [] ``Conformance\Inference (E_TwoDifferentTypeVariablesGen00.fs)`` () = singleNegTest (testConfig "conformance/inference") "E_TwoDifferentTypeVariablesGen00" + let [] ``Conformance\Inference (E_TwoDifferentTypeVariables01.fs)`` () = singleNegTest (testConfig "conformance/inference") "E_TwoDifferentTypeVariables01" + let [] ``Conformance\Inference (E_TwoDifferentTypeVariables01rec.fs)`` () = singleNegTest (testConfig "conformance/inference") "E_TwoDifferentTypeVariables01rec" + let [] ``Conformance\Inference (E_TwoDifferentTypeVariablesGen00rec.fs)`` () = singleNegTest (testConfig "conformance/inference") "E_TwoDifferentTypeVariablesGen00rec" + let [] ``Conformance\Inference (E_TwoEqualTypeVariables02.fs)`` () = singleNegTest (testConfig "conformance/inference") "E_TwoEqualTypeVariables02" + let [] ``Conformance\Inference (E_TwoEqualYypeVariables02rec.fs)`` () = singleNegTest (testConfig "conformance/inference") "E_TwoEqualYypeVariables02rec" + let [] ``Conformance\Inference (E_LeftToRightOverloadResolution01.fs)`` () = singleNegTest (testConfig "conformance/inference") "E_LeftToRightOverloadResolution01" + let [] ``Conformance\WellFormedness (E_Clashing_Values_in_AbstractClass01.fs)`` () = singleNegTest (testConfig "conformance/wellformedness") "E_Clashing_Values_in_AbstractClass01" + let [] ``Conformance\WellFormedness (E_Clashing_Values_in_AbstractClass03.fs)`` () = singleNegTest (testConfig "conformance/wellformedness") "E_Clashing_Values_in_AbstractClass03" + let [] ``Conformance\WellFormedness (E_Clashing_Values_in_AbstractClass04.fs)`` () = singleNegTest (testConfig "conformance/wellformedness") "E_Clashing_Values_in_AbstractClass04" + // note: this test still exist in fsharpqa to assert the compiler doesn't crash + // the part of the code generating a flaky error due to https://github.com/dotnet/fsharp/issues/6725 + // is elided here to focus on overload resolution error messages + let [] ``Conformance\LexicalAnalysis\SymbolicOperators (E_LessThanDotOpenParen001.fs)`` () = singleNegTest (testConfig "conformance/lexicalanalysis") "E_LessThanDotOpenParen001" + + module ``error messages using BCL``= + let [] ``neg_System.Convert.ToString.OverloadList``() = singleNegTest (testConfig "typecheck/overloads") "neg_System.Convert.ToString.OverloadList" + let [] ``neg_System.Threading.Tasks.Task.Run.OverloadList``() = singleNegTest (testConfig "typecheck/overloads") "neg_System.Threading.Tasks.Task.Run.OverloadList" + let [] ``neg_System.Drawing.Graphics.DrawRectangleOverloadList.fsx``() = singleNegTest (testConfig "typecheck/overloads") "neg_System.Drawing.Graphics.DrawRectangleOverloadList" + + module ``ad hoc code overload error messages``= + let [] ``neg_many_many_overloads`` () = singleNegTest (testConfig "typecheck/overloads") "neg_many_many_overloads" + let [] ``neg_interface_generics`` () = singleNegTest (testConfig "typecheck/overloads") "neg_interface_generics" + let [] ``neg_known_return_type_and_known_type_arguments`` () = singleNegTest (testConfig "typecheck/overloads") "neg_known_return_type_and_known_type_arguments" + let [] ``neg_generic_known_argument_types`` () = singleNegTest (testConfig "typecheck/overloads") "neg_generic_known_argument_types" + let [] ``neg_tupled_arguments`` () = singleNegTest (testConfig "typecheck/overloads") "neg_tupled_arguments" #endif diff --git a/tests/fsharp/typecheck/constructors/neg_invalid_constructor.bsl b/tests/fsharp/typecheck/constructors/neg_invalid_constructor.bsl new file mode 100644 index 00000000000..3b2777c1504 --- /dev/null +++ b/tests/fsharp/typecheck/constructors/neg_invalid_constructor.bsl @@ -0,0 +1,22 @@ +typecheck/constructors/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. + +Known type of argument: 'a list + +Candidates: + - new : col:'b -> ImmutableStack<'a> + - private new : items:'a list -> ImmutableStack<'a> +typecheck/constructors/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. + +Known type of argument: 'a list + +Candidates: + - new : col:'b -> ImmutableStack<'a> + - private new : items:'a list -> ImmutableStack<'a> +typecheck/constructors/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. + +Known type of argument: 'a list + +Candidates: + - new : col:'b -> ImmutableStack<'a> when 'b :> seq<'c> + - private new : items:'a list -> ImmutableStack<'a> +typecheck/constructors/neg_invalid_constructor.fs (7,30)-(7,60) typecheck error This is not a valid object construction expression. Explicit object constructors must either call an alternate constructor or initialize all fields of the object and specify a call to a super class constructor. \ No newline at end of file diff --git a/tests/fsharp/typecheck/constructors/neg_invalid_constructor.fs b/tests/fsharp/typecheck/constructors/neg_invalid_constructor.fs new file mode 100644 index 00000000000..02be510295d --- /dev/null +++ b/tests/fsharp/typecheck/constructors/neg_invalid_constructor.fs @@ -0,0 +1,7 @@ +type ImmutableStack<'a> private(items: 'a list) = + + member this.Push item = ImmutableStack(item::items) + member this.Pop = match items with | [] -> failwith "No elements in stack" | x::xs -> x,ImmutableStack(xs) + + // Notice type annotation is commented out, which results in an error + new(col (*: seq<'a>*)) = ImmutableStack(List.ofSeq col) diff --git a/tests/fsharp/typecheck/overloads/neg_System.Convert.ToString.OverloadList.bsl b/tests/fsharp/typecheck/overloads/neg_System.Convert.ToString.OverloadList.bsl new file mode 100644 index 00000000000..1eb33e50b6e --- /dev/null +++ b/tests/fsharp/typecheck/overloads/neg_System.Convert.ToString.OverloadList.bsl @@ -0,0 +1,56 @@ + +neg_System.Convert.ToString.OverloadList.fsx(1,1,1,31): typecheck error FS0041: No overloads match for method 'ToString'. + +Known types of arguments: char * int + +Available overloads: + - System.Convert.ToString(value: System.DateTime, provider: System.IFormatProvider) : string // Argument 'value' doesn't match + - System.Convert.ToString(value: bool, provider: System.IFormatProvider) : string // Argument 'value' doesn't match + - System.Convert.ToString(value: byte, provider: System.IFormatProvider) : string // Argument 'value' doesn't match + - System.Convert.ToString(value: byte, toBase: int) : string // Argument 'value' doesn't match + - System.Convert.ToString(value: char, provider: System.IFormatProvider) : string // Argument 'provider' doesn't match + - System.Convert.ToString(value: decimal, provider: System.IFormatProvider) : string // Argument 'value' doesn't match + - System.Convert.ToString(value: float, provider: System.IFormatProvider) : string // Argument 'value' doesn't match + - System.Convert.ToString(value: float32, provider: System.IFormatProvider) : string // Argument 'value' doesn't match + - System.Convert.ToString(value: int, provider: System.IFormatProvider) : string // Argument 'value' doesn't match + - System.Convert.ToString(value: int, toBase: int) : string // Argument 'value' doesn't match + - System.Convert.ToString(value: int16, provider: System.IFormatProvider) : string // Argument 'value' doesn't match + - System.Convert.ToString(value: int16, toBase: int) : string // Argument 'value' doesn't match + - System.Convert.ToString(value: int64, provider: System.IFormatProvider) : string // Argument 'value' doesn't match + - System.Convert.ToString(value: int64, toBase: int) : string // Argument 'value' doesn't match + - System.Convert.ToString(value: obj, provider: System.IFormatProvider) : string // Argument 'provider' doesn't match + - System.Convert.ToString(value: sbyte, provider: System.IFormatProvider) : string // Argument 'value' doesn't match + - System.Convert.ToString(value: string, provider: System.IFormatProvider) : string // Argument 'value' doesn't match + - System.Convert.ToString(value: uint16, provider: System.IFormatProvider) : string // Argument 'value' doesn't match + - 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'. + +Known types of arguments: provider:char * value:int + +Available overloads: + - System.Convert.ToString(value: System.DateTime, provider: System.IFormatProvider) : string // Argument 'value' doesn't match + - System.Convert.ToString(value: bool, provider: System.IFormatProvider) : string // Argument 'value' doesn't match + - System.Convert.ToString(value: byte, provider: System.IFormatProvider) : string // Argument 'value' doesn't match + - System.Convert.ToString(value: char, provider: System.IFormatProvider) : string // Argument 'value' doesn't match + - System.Convert.ToString(value: decimal, provider: System.IFormatProvider) : string // Argument 'value' doesn't match + - System.Convert.ToString(value: float, provider: System.IFormatProvider) : string // Argument 'value' doesn't match + - System.Convert.ToString(value: float32, provider: System.IFormatProvider) : string // Argument 'value' doesn't match + - System.Convert.ToString(value: int, provider: System.IFormatProvider) : string // Argument 'provider' doesn't match + - System.Convert.ToString(value: int16, provider: System.IFormatProvider) : string // Argument 'value' doesn't match + - System.Convert.ToString(value: int64, provider: System.IFormatProvider) : string // Argument 'value' doesn't match + - System.Convert.ToString(value: obj, provider: System.IFormatProvider) : string // Argument 'provider' doesn't match + - System.Convert.ToString(value: sbyte, provider: System.IFormatProvider) : string // Argument 'value' doesn't match + - System.Convert.ToString(value: string, provider: System.IFormatProvider) : string // Argument 'value' doesn't match + - System.Convert.ToString(value: uint16, provider: System.IFormatProvider) : string // Argument 'value' doesn't match + - 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(3,1,3,48): typecheck error FS0041: A unique overload for method 'ToString' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known types of arguments: provider:'a0 * value:int when 'a0 : null + +Candidates: + - System.Convert.ToString(value: int, provider: System.IFormatProvider) : string + - System.Convert.ToString(value: obj, provider: System.IFormatProvider) : string diff --git a/tests/fsharp/typecheck/overloads/neg_System.Convert.ToString.OverloadList.fsx b/tests/fsharp/typecheck/overloads/neg_System.Convert.ToString.OverloadList.fsx new file mode 100644 index 00000000000..be91d10893c --- /dev/null +++ b/tests/fsharp/typecheck/overloads/neg_System.Convert.ToString.OverloadList.fsx @@ -0,0 +1,4 @@ +System.Convert.ToString('a',0) |> ignore +System.Convert.ToString(provider='a', value=0) |> ignore +System.Convert.ToString(provider=null, value=0) |> ignore +;; \ No newline at end of file diff --git a/tests/fsharp/typecheck/overloads/neg_System.Drawing.Graphics.DrawRectangleOverloadList.bsl b/tests/fsharp/typecheck/overloads/neg_System.Drawing.Graphics.DrawRectangleOverloadList.bsl new file mode 100644 index 00000000000..cfa6d36b91b --- /dev/null +++ b/tests/fsharp/typecheck/overloads/neg_System.Drawing.Graphics.DrawRectangleOverloadList.bsl @@ -0,0 +1,16 @@ + +neg_System.Drawing.Graphics.DrawRectangleOverloadList.fsx(9,1,9,31): typecheck error FS0041: No overloads match for method 'DrawRectangle'. + +Known types of arguments: Pen * float32 * float32 * float32 * int + +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'. + +Known types of arguments: Pen * int * float32 * float32 * decimal + +Available overloads: + - Graphics.DrawRectangle(pen: Pen, x: float32, y: float32, width: float32, height: float32) : unit // Argument 'x' doesn't match + - Graphics.DrawRectangle(pen: Pen, x: int, y: int, width: int, height: int) : unit // Argument 'y' doesn't match diff --git a/tests/fsharp/typecheck/overloads/neg_System.Drawing.Graphics.DrawRectangleOverloadList.fsx b/tests/fsharp/typecheck/overloads/neg_System.Drawing.Graphics.DrawRectangleOverloadList.fsx new file mode 100644 index 00000000000..e0069481662 --- /dev/null +++ b/tests/fsharp/typecheck/overloads/neg_System.Drawing.Graphics.DrawRectangleOverloadList.fsx @@ -0,0 +1,10 @@ +open System.Drawing +let g : Graphics = null +let p : Pen = null +let x = 1.f +let y = 1.f +let w = 1.f +let h = 1 + +g.DrawRectangle(p, x, y, w, h) +g.DrawRectangle(p, 4, y, w, 5m) \ No newline at end of file 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 new file mode 100644 index 00000000000..20a96ac2975 --- /dev/null +++ b/tests/fsharp/typecheck/overloads/neg_System.Threading.Tasks.Task.Run.OverloadList.bsl @@ -0,0 +1,48 @@ + +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. + +Known type of argument: (unit -> Task) + +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. + +Known type of argument: Func> + +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. + +Known type of argument: Func> + +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. + +Known type of argument: Func> + +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. + +Known type of argument: Func> + +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. + +Known type of argument: Func> + +Candidates: + - Task.Run<'TResult>(function: Func<'TResult>) : Task<'TResult> + - Task.Run<'TResult>(function: Func>) : Task<'TResult> diff --git a/tests/fsharp/typecheck/overloads/neg_System.Threading.Tasks.Task.Run.OverloadList.fsx b/tests/fsharp/typecheck/overloads/neg_System.Threading.Tasks.Task.Run.OverloadList.fsx new file mode 100644 index 00000000000..0d44ca44b8b --- /dev/null +++ b/tests/fsharp/typecheck/overloads/neg_System.Threading.Tasks.Task.Run.OverloadList.fsx @@ -0,0 +1,14 @@ +open System +open System.Threading.Tasks +let makeTask () = new Task<_>(fun () -> 1) +let task = makeTask() +let rt1 = Task.Run(fun () -> task) +let rt2 = Task.Run(Func<_>(fun () -> task)) +let rt3 = Task.Run<_>(Func<_>(fun () -> task)) +let rt4 : Task<_> = Task.Run<_>(Func<_>(fun () -> task)) +let rt5 = Task.Run(Func>(fun () -> task)) +let rt6 = Task.Run(Func>(fun () -> task)) +let rt7 = Task.Run(Func>(fun () -> task)) +let rt8 = Task.Run(Func>(fun () -> task)) +let rt9 = Task.Run(Func<_>(fun () -> task)) +let rt10 = Task.Run(fun () -> task) diff --git a/tests/fsharp/typecheck/overloads/neg_generic_known_argument_types.bsl b/tests/fsharp/typecheck/overloads/neg_generic_known_argument_types.bsl new file mode 100644 index 00000000000..8567bfa1055 --- /dev/null +++ b/tests/fsharp/typecheck/overloads/neg_generic_known_argument_types.bsl @@ -0,0 +1,8 @@ + +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. + +Known types of arguments: ^fa * 'fb * 'a * argD:'c when ^fa : (member X : ^fa * ^b -> ^b) and ^b : (member BBBB : ^b -> unit) + +Candidates: + - static member A.Foo : argA1:'a * argB1:('a -> 'b) * argC1:('a -> 'b) * argD:('a -> 'b) * argZ1:'zzz -> 'b + - static member A.Foo : argA2:'a * argB2:('a -> 'b) * argC2:('b -> 'c) * argD:('c -> 'd) * argZ2:'zzz -> 'd diff --git a/tests/fsharp/typecheck/overloads/neg_generic_known_argument_types.fsx b/tests/fsharp/typecheck/overloads/neg_generic_known_argument_types.fsx new file mode 100644 index 00000000000..60b76f772ab --- /dev/null +++ b/tests/fsharp/typecheck/overloads/neg_generic_known_argument_types.fsx @@ -0,0 +1,10 @@ +open System.Runtime.InteropServices + +type A<'zzz> = + static member Foo(argA1: 'a, argB1: 'a -> 'b) : 'b = argB1 argA1 + static member Foo(argA1: 'a, argB1: 'a -> 'b, argC1: 'a -> 'b, argD: 'a -> 'b, [] argZ1: 'zzz) : 'b = argB1 argA1 + static member Foo(argA2: 'a, argB2: 'a -> 'b, argC2: 'b -> 'c, argD: 'c -> 'd, [] argZ2: 'zzz) : 'd = argD (argC2( argB2 argA2)) + +let inline f (aa: 'fa) (ab: 'fb) ac ad : 'e when (^fa) : (member X : 'b -> 'b) and (^b) : (member BBBB : unit -> unit) = + let e : 'e = A.Foo(aa, ab, ac, argD = ad) + e \ No newline at end of file diff --git a/tests/fsharp/typecheck/overloads/neg_interface_generics.bsl b/tests/fsharp/typecheck/overloads/neg_interface_generics.bsl new file mode 100644 index 00000000000..98c63216419 --- /dev/null +++ b/tests/fsharp/typecheck/overloads/neg_interface_generics.bsl @@ -0,0 +1,10 @@ + +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'. + +Known types of arguments: string * XmlReader + +Available overloads: + - abstract member IFoo.Foo : t:Type * r:TextReader -> obj * 't // Argument 't' doesn't match + - abstract member IFoo.Foo : t:string * r:TextReader -> obj * 't // Argument 'r' doesn't match diff --git a/tests/fsharp/typecheck/overloads/neg_interface_generics.fsx b/tests/fsharp/typecheck/overloads/neg_interface_generics.fsx new file mode 100644 index 00000000000..694b2de923e --- /dev/null +++ b/tests/fsharp/typecheck/overloads/neg_interface_generics.fsx @@ -0,0 +1,21 @@ +open System +open System.Xml +open System.IO +type IFoo = + abstract member Foo : t:string * r:XmlReader -> obj + abstract member Foo : t:Type * r:TextReader -> obj + abstract member Foo<'t> : t:string * r:TextReader -> obj * 't + abstract member Foo<'t> : t:Type * r:TextReader -> obj * 't + abstract member Foo<'t when 't : struct> : TextReader -> 't + abstract member Foo<'t when 't :> IDisposable > : XmlReader -> 't + +let foo = Unchecked.defaultof +let r = Unchecked.defaultof +foo.Foo<_>(r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,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,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r +) +let a = foo.Foo( "", r) +let b = foo.Foo<_>( "", r) + diff --git a/tests/fsharp/typecheck/overloads/neg_known_return_type_and_known_type_arguments.bsl b/tests/fsharp/typecheck/overloads/neg_known_return_type_and_known_type_arguments.bsl new file mode 100644 index 00000000000..6c9ef4772e2 --- /dev/null +++ b/tests/fsharp/typecheck/overloads/neg_known_return_type_and_known_type_arguments.bsl @@ -0,0 +1,26 @@ + +neg_known_return_type_and_known_type_arguments.fsx(90,24,90,28): typecheck error FS0001: No overloads match for method 'Zero'. + +Known return type: MonoidSample + +Known type parameters: < MonoidSample , Zero > + +Available overloads: + - static member Zero.Zero : ^t * Default1 -> ^t when ^t : (static member get_Zero : -> ^t) // Argument at index 1 doesn't match + - static member Zero.Zero : ^t * Default1 -> ('a1 -> 'a1) when ^t : null and ^t : struct // Argument at index 1 doesn't match + - static member Zero.Zero : ^t * Default2 -> ^t when (FromInt32 or ^t) : (static member FromInt32 : ^t * FromInt32 -> int32 -> ^t) // Argument at index 1 doesn't match + - static member Zero.Zero : ^t * Default2 -> ('a1 -> 'a1) when ^t : null and ^t : struct // Argument at index 1 doesn't match + - static member Zero.Zero : ^t * Default3 -> ^t when ^t : (static member get_Empty : -> ^t) // Argument at index 1 doesn't match + - static member Zero.Zero : 'a array * Zero -> 'a array // Argument at index 1 doesn't match + - static member Zero.Zero : 'a list * Zero -> 'a list // Argument at index 1 doesn't match + - static member Zero.Zero : 'a option * Zero -> 'a option // Argument at index 1 doesn't match + - static member Zero.Zero : ('T -> ^Monoid) * Zero -> ('T -> ^Monoid) when (Zero or ^Monoid) : (static member Zero : ^Monoid * Zero -> ^Monoid) // Argument at index 1 doesn't match + - static member Zero.Zero : Async< ^a> * Zero -> Async< ^a> when (Zero or ^a) : (static member Zero : ^a * Zero -> ^a) // Argument at index 1 doesn't match + - static member Zero.Zero : Lazy< ^a> * Zero -> Lazy< ^a> when (Zero or ^a) : (static member Zero : ^a * Zero -> ^a) // Argument at index 1 doesn't match + - static member Zero.Zero : Map<'a,'b> * Zero -> Map<'a,'b> when 'a : comparison // Argument at index 1 doesn't match + - static member Zero.Zero : ResizeArray<'a> * Zero -> ResizeArray<'a> // Argument at index 1 doesn't match + - static member Zero.Zero : Set<'a> * Zero -> Set<'a> when 'a : comparison // Argument at index 1 doesn't match + - static member Zero.Zero : System.TimeSpan * Zero -> System.TimeSpan // Argument at index 1 doesn't match + - static member Zero.Zero : seq<'a> * Zero -> seq<'a> // Argument at index 1 doesn't match + - static member Zero.Zero : string * Zero -> string // Argument at index 1 doesn't match + - static member Zero.Zero : unit * Zero -> unit // Argument at index 1 doesn't match diff --git a/tests/fsharp/typecheck/overloads/neg_known_return_type_and_known_type_arguments.fsx b/tests/fsharp/typecheck/overloads/neg_known_return_type_and_known_type_arguments.fsx new file mode 100644 index 00000000000..db2b2ae297c --- /dev/null +++ b/tests/fsharp/typecheck/overloads/neg_known_return_type_and_known_type_arguments.fsx @@ -0,0 +1,90 @@ +open System.Runtime.CompilerServices +open System.Runtime.InteropServices +open System.Runtime.InteropServices +type Default6 = class end +type Default5 = class inherit Default6 end +type Default4 = class inherit Default5 end +type Default3 = class inherit Default4 end +type Default2 = class inherit Default3 end +type Default1 = class inherit Default2 end + +[] +type Plus = + inherit Default1 + static member inline ``+`` (x: 'Plus , y: 'Plus , _mthd: Default2) = (^Plus : (static member (<|>) : _*_ -> _) x, y) : ^Plus + static member inline ``+`` (x: 'Plus , y: 'Plus , []_mthd: Default1) = x + y : ^Plus + static member inline ``+`` (_: ^t when ^t: null and ^t: struct, _: ^t , []_mthd: Default1) = id + + static member inline Invoke (x: 'Plus) (y: 'Plus) : 'Plus = + let inline call (mthd : ^M, input1 : ^I, input2 : ^I) = ((^M or ^I) : (static member ``+`` : _*_*_ -> _) input1, input2, mthd) + call (Unchecked.defaultof, x, y) + +type FromInt32 = + inherit Default1 + static member inline FromInt32 (_: ^R , _: Default1 ) = fun (x: int32) -> (^R : (static member FromInt32 : _ -> ^R) x) + static member inline FromInt32 (_: Default1 , _: Default1 ) = fun (x: int32) -> (^R : (static member FromInt32 : _ -> ^R) x) + static member FromInt32 (_: int32 , _: FromInt32) = fun (x: int32) -> x + static member FromInt32 (_: int64 , _: FromInt32) = fun (x: int32) -> int64 x + #if !FABLE_COMPILER + static member FromInt32 (_: nativeint , _: FromInt32) = fun (x: int32) -> nativeint (int x) + static member FromInt32 (_: unativeint, _: FromInt32) = fun (x: int32) -> unativeint (int x) + #endif + static member FromInt32 (_: bigint , _: FromInt32) = fun (x: int32) -> bigint x + static member FromInt32 (_: float , _: FromInt32) = fun (x: int32) -> float x + static member FromInt32 (_: sbyte , _: FromInt32) = fun (x: int32) -> sbyte x + static member FromInt32 (_: int16 , _: FromInt32) = fun (x: int32) -> int16 x + static member FromInt32 (_: byte , _: FromInt32) = fun (x: int32) -> byte x + static member FromInt32 (_: uint16 , _: FromInt32) = fun (x: int32) -> uint16 x + static member FromInt32 (_: uint32 , _: FromInt32) = fun (x: int32) -> uint32 x + static member FromInt32 (_: uint64 , _: FromInt32) = fun (x: int32) -> uint64 x + static member FromInt32 (_: float32 , _: FromInt32) = fun (x: int32) -> float32 x + static member FromInt32 (_: decimal , _: FromInt32) = fun (x: int32) -> decimal x + + static member inline Invoke (x: int32) : 'Num = + let inline call_2 (a: ^a, b: ^b) = ((^a or ^b) : (static member FromInt32 : _*_ -> _) b, a) + let inline call (a: 'a) = fun (x: 'x) -> call_2 (a, Unchecked.defaultof<'r>) x : 'r + call Unchecked.defaultof x + +type Zero = + inherit Default1 + static member inline Zero (_: 't , _: Default3) = (^t : (static member Empty : ^t) ()) : 't + static member inline Zero (_: 't , _: Default2) = FromInt32.Invoke 0 : 't + static member inline Zero (_: ^t when ^t: null and ^t: struct, _: Default2) = id + static member inline Zero (_: 't , _: Default1) = LanguagePrimitives.GenericZero : 't + static member inline Zero (_: ^t when ^t: null and ^t: struct, _: Default1) = id + static member Zero (_: System.TimeSpan , _: Zero ) = System.TimeSpan () + static member Zero (_: list<'a> , _: Zero ) = [] : list<'a> + static member Zero (_: option<'a> , _: Zero ) = None : option<'a> + static member Zero (_: array<'a> , _: Zero ) = [||] : array<'a> + static member Zero (_: string , _: Zero ) = "" + static member Zero (_: unit , _: Zero ) = () + static member Zero (_: Set<'a> , _: Zero ) = Set.empty : Set<'a> + static member Zero (_: Map<'a,'b> , _: Zero ) = Map.empty : Map<'a,'b> + + static member inline Invoke () = + let inline call_2 (a: ^a, b: ^b) = ((^a or ^b) : (static member Zero : _*_ -> _) b, a) + let inline call (a: 'a) = call_2 (a, Unchecked.defaultof<'r>) : 'r + call Unchecked.defaultof + +type Zero with + static member inline Zero (_: 'T->'Monoid , _: Zero) = (fun _ -> Zero.Invoke ()) : 'T->'Monoid + static member inline Zero (_: Async<'a> , _: Zero) = let (v: 'a) = Zero.Invoke () in async.Return v + static member inline Zero (_: Lazy<'a> , _: Zero) = let (v: 'a) = Zero.Invoke () in lazy v + static member Zero (_: ResizeArray<'a> , _: Zero) = ResizeArray () : ResizeArray<'a> + static member Zero (_: seq<'a> , _: Zero) = Seq.empty : seq<'a> + +let inline (++) (x: 'Monoid) (y: 'Monoid) : 'Monoid = Plus.Invoke x y +let inline zero< ^Monoid when (Zero or ^Monoid) : (static member Zero : ^Monoid * Zero -> ^Monoid) > : ^Monoid = Zero.Invoke () + +type MonoidSample = + | MonoidSample of int + + static member getr_Zero () = MonoidSample 0 + //static member (+) (MonoidSample(x), MonoidSample(y)) = MonoidSample (x+y) + static member (+) (MonoidSample(x), y) = MonoidSample (x+y), 1 + static member (+) (x,MonoidSample(y)) = MonoidSample (x+y) + static member (+) (x, y) = MonoidSample (x+y), 3 + +let a = MonoidSample 1 +let b = MonoidSample 2 +let c : MonoidSample = zero diff --git a/tests/fsharp/typecheck/overloads/neg_many_many_overloads.bsl b/tests/fsharp/typecheck/overloads/neg_many_many_overloads.bsl new file mode 100644 index 00000000000..d9e944906eb --- /dev/null +++ b/tests/fsharp/typecheck/overloads/neg_many_many_overloads.bsl @@ -0,0 +1,348 @@ + +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. + +Known type of argument: 'a0 when 'a0 : null + +Candidates: + - static member Class.A : a:Dictionary -> Dictionary + - static member Class.A : a:Dictionary -> Dictionary + - static member Class.A : a:Dictionary -> Dictionary + - static member Class.A : a:Dictionary -> Dictionary + - static member Class.A : a:Dictionary -> Dictionary + - static member Class.A : a:Dictionary -> Dictionary + - static member Class.A : a:Dictionary -> Dictionary + - static member Class.A : a:Dictionary -> Dictionary + - static member Class.A : a:Dictionary -> Dictionary + - static member Class.A : a:Dictionary -> Dictionary + - static member Class.A : a:Dictionary -> Dictionary + - static member Class.A : a:Dictionary -> Dictionary + - static member Class.A : a:Dictionary -> Dictionary + - static member Class.A : a:Dictionary -> Dictionary + - static member Class.A : a:HashSet -> HashSet + - static member Class.A : a:HashSet -> HashSet + - static member Class.A : a:HashSet -> HashSet + - static member Class.A : a:HashSet -> HashSet + - static member Class.A : a:HashSet -> HashSet + - static member Class.A : a:HashSet -> HashSet + - static member Class.A : a:HashSet -> HashSet + - static member Class.A : a:HashSet -> HashSet + - static member Class.A : a:HashSet -> HashSet + - static member Class.A : a:HashSet -> HashSet + - static member Class.A : a:HashSet -> HashSet + - static member Class.A : a:HashSet -> HashSet + - static member Class.A : a:HashSet -> HashSet + - static member Class.A : a:HashSet -> HashSet + - static member Class.A : a:List -> List + - static member Class.A : a:List -> List + - static member Class.A : a:List -> List + - static member Class.A : a:List -> List + - static member Class.A : a:List -> List + - static member Class.A : a:List -> List + - static member Class.A : a:List -> List + - static member Class.A : a:List -> List + - static member Class.A : a:List -> List + - static member Class.A : a:List -> List + - static member Class.A : a:List -> List + - static member Class.A : a:List -> List + - static member Class.A : a:List -> List + - static member Class.A : a:List -> List + - static member Class.A : a:Queue -> Queue + - static member Class.A : a:Queue -> Queue + - static member Class.A : a:Queue -> Queue + - static member Class.A : a:Queue -> Queue + - static member Class.A : a:Queue -> Queue + - static member Class.A : a:Queue -> Queue + - static member Class.A : a:Queue -> Queue + - static member Class.A : a:Queue -> Queue + - static member Class.A : a:Queue -> Queue + - static member Class.A : a:Queue -> Queue + - static member Class.A : a:Queue -> Queue + - static member Class.A : a:Queue -> Queue + - static member Class.A : a:Queue -> Queue + - static member Class.A : a:Queue -> Queue + - static member Class.A : a:Task -> Task + - static member Class.A : a:Task -> Task + - static member Class.A : a:Task -> Task + - static member Class.A : a:Task -> Task + - static member Class.A : a:Task -> Task + - static member Class.A : a:Task -> Task + - static member Class.A : a:Task -> Task + - static member Class.A : a:Task -> Task + - static member Class.A : a:Task -> Task + - static member Class.A : a:Task -> Task + - static member Class.A : a:Task -> Task + - static member Class.A : a:Task -> Task + - static member Class.A : a:Task -> Task + - static member Class.A : a:Task -> Task + - 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'. + +Known type of argument: Type + +Available overloads: + - static member Class.A : a:DateTime -> DateTime // Argument 'a' doesn't match + - static member Class.A : a:Dictionary -> Dictionary // Argument 'a' doesn't match + - static member Class.A : a:Dictionary -> Dictionary // Argument 'a' doesn't match + - static member Class.A : a:Dictionary -> Dictionary // Argument 'a' doesn't match + - static member Class.A : a:Dictionary -> Dictionary // Argument 'a' doesn't match + - static member Class.A : a:Dictionary -> Dictionary // Argument 'a' doesn't match + - static member Class.A : a:Dictionary -> Dictionary // Argument 'a' doesn't match + - static member Class.A : a:Dictionary -> Dictionary // Argument 'a' doesn't match + - static member Class.A : a:Dictionary -> Dictionary // Argument 'a' doesn't match + - static member Class.A : a:Dictionary -> Dictionary // Argument 'a' doesn't match + - static member Class.A : a:Dictionary -> Dictionary // Argument 'a' doesn't match + - static member Class.A : a:Dictionary -> Dictionary // Argument 'a' doesn't match + - static member Class.A : a:Dictionary -> Dictionary // Argument 'a' doesn't match + - static member Class.A : a:Dictionary -> Dictionary // Argument 'a' doesn't match + - static member Class.A : a:Dictionary -> Dictionary // Argument 'a' doesn't match + - static member Class.A : a:HashSet -> HashSet // Argument 'a' doesn't match + - static member Class.A : a:HashSet -> HashSet // Argument 'a' doesn't match + - static member Class.A : a:HashSet -> HashSet // Argument 'a' doesn't match + - static member Class.A : a:HashSet -> HashSet // Argument 'a' doesn't match + - static member Class.A : a:HashSet -> HashSet // Argument 'a' doesn't match + - static member Class.A : a:HashSet -> HashSet // Argument 'a' doesn't match + - static member Class.A : a:HashSet -> HashSet // Argument 'a' doesn't match + - static member Class.A : a:HashSet -> HashSet // Argument 'a' doesn't match + - static member Class.A : a:HashSet -> HashSet // Argument 'a' doesn't match + - static member Class.A : a:HashSet -> HashSet // Argument 'a' doesn't match + - static member Class.A : a:HashSet -> HashSet // Argument 'a' doesn't match + - static member Class.A : a:HashSet -> HashSet // Argument 'a' doesn't match + - static member Class.A : a:HashSet -> HashSet // Argument 'a' doesn't match + - static member Class.A : a:HashSet -> HashSet // Argument 'a' doesn't match + - static member Class.A : a:List -> List // Argument 'a' doesn't match + - static member Class.A : a:List -> List // Argument 'a' doesn't match + - static member Class.A : a:List -> List // Argument 'a' doesn't match + - static member Class.A : a:List -> List // Argument 'a' doesn't match + - static member Class.A : a:List -> List // Argument 'a' doesn't match + - static member Class.A : a:List -> List // Argument 'a' doesn't match + - static member Class.A : a:List -> List // Argument 'a' doesn't match + - static member Class.A : a:List -> List // Argument 'a' doesn't match + - static member Class.A : a:List -> List // Argument 'a' doesn't match + - static member Class.A : a:List -> List // Argument 'a' doesn't match + - static member Class.A : a:List -> List // Argument 'a' doesn't match + - static member Class.A : a:List -> List // Argument 'a' doesn't match + - static member Class.A : a:List -> List // Argument 'a' doesn't match + - static member Class.A : a:List -> List // Argument 'a' doesn't match + - static member Class.A : a:Queue -> Queue // Argument 'a' doesn't match + - static member Class.A : a:Queue -> Queue // Argument 'a' doesn't match + - static member Class.A : a:Queue -> Queue // Argument 'a' doesn't match + - static member Class.A : a:Queue -> Queue // Argument 'a' doesn't match + - static member Class.A : a:Queue -> Queue // Argument 'a' doesn't match + - static member Class.A : a:Queue -> Queue // Argument 'a' doesn't match + - static member Class.A : a:Queue -> Queue // Argument 'a' doesn't match + - static member Class.A : a:Queue -> Queue // Argument 'a' doesn't match + - static member Class.A : a:Queue -> Queue // Argument 'a' doesn't match + - static member Class.A : a:Queue -> Queue // Argument 'a' doesn't match + - static member Class.A : a:Queue -> Queue // Argument 'a' doesn't match + - static member Class.A : a:Queue -> Queue // Argument 'a' doesn't match + - static member Class.A : a:Queue -> Queue // Argument 'a' doesn't match + - static member Class.A : a:Queue -> Queue // Argument 'a' doesn't match + - static member Class.A : a:Task -> Task // Argument 'a' doesn't match + - static member Class.A : a:Task -> Task // Argument 'a' doesn't match + - static member Class.A : a:Task -> Task // Argument 'a' doesn't match + - static member Class.A : a:Task -> Task // Argument 'a' doesn't match + - static member Class.A : a:Task -> Task // Argument 'a' doesn't match + - static member Class.A : a:Task -> Task // Argument 'a' doesn't match + - static member Class.A : a:Task -> Task // Argument 'a' doesn't match + - static member Class.A : a:Task -> Task // Argument 'a' doesn't match + - static member Class.A : a:Task -> Task // Argument 'a' doesn't match + - static member Class.A : a:Task -> Task // Argument 'a' doesn't match + - static member Class.A : a:Task -> Task // Argument 'a' doesn't match + - static member Class.A : a:Task -> Task // Argument 'a' doesn't match + - static member Class.A : a:Task -> Task // Argument 'a' doesn't match + - static member Class.A : a:Task -> Task // Argument 'a' doesn't match + - static member Class.A : a:Task -> Task // Argument 'a' doesn't match + - static member Class.A : a:decimal -> decimal // Argument 'a' doesn't match + - static member Class.A : a:float -> float // Argument 'a' doesn't match + - static member Class.A : a:float32 -> float32 // Argument 'a' doesn't match + - static member Class.A : a:int16 -> int16 // Argument 'a' doesn't match + - static member Class.A : a:int32 -> int32 // Argument 'a' doesn't match + - static member Class.A : a:int64 -> int64 // Argument 'a' doesn't match + - static member Class.A : a:int8 -> int8 // Argument 'a' doesn't match + - static member Class.A : a:string -> string // Argument 'a' doesn't match + - static member Class.A : a:uint16 -> uint16 // Argument 'a' doesn't match + - static member Class.A : a:uint32 -> uint32 // Argument 'a' doesn't match + - 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'. + +Known type of argument: Guid + +Available overloads: + - static member Class.A : a:DateTime -> DateTime // Argument 'a' doesn't match + - static member Class.A : a:Dictionary -> Dictionary // Argument 'a' doesn't match + - static member Class.A : a:Dictionary -> Dictionary // Argument 'a' doesn't match + - static member Class.A : a:Dictionary -> Dictionary // Argument 'a' doesn't match + - static member Class.A : a:Dictionary -> Dictionary // Argument 'a' doesn't match + - static member Class.A : a:Dictionary -> Dictionary // Argument 'a' doesn't match + - static member Class.A : a:Dictionary -> Dictionary // Argument 'a' doesn't match + - static member Class.A : a:Dictionary -> Dictionary // Argument 'a' doesn't match + - static member Class.A : a:Dictionary -> Dictionary // Argument 'a' doesn't match + - static member Class.A : a:Dictionary -> Dictionary // Argument 'a' doesn't match + - static member Class.A : a:Dictionary -> Dictionary // Argument 'a' doesn't match + - static member Class.A : a:Dictionary -> Dictionary // Argument 'a' doesn't match + - static member Class.A : a:Dictionary -> Dictionary // Argument 'a' doesn't match + - static member Class.A : a:Dictionary -> Dictionary // Argument 'a' doesn't match + - static member Class.A : a:Dictionary -> Dictionary // Argument 'a' doesn't match + - static member Class.A : a:HashSet -> HashSet // Argument 'a' doesn't match + - static member Class.A : a:HashSet -> HashSet // Argument 'a' doesn't match + - static member Class.A : a:HashSet -> HashSet // Argument 'a' doesn't match + - static member Class.A : a:HashSet -> HashSet // Argument 'a' doesn't match + - static member Class.A : a:HashSet -> HashSet // Argument 'a' doesn't match + - static member Class.A : a:HashSet -> HashSet // Argument 'a' doesn't match + - static member Class.A : a:HashSet -> HashSet // Argument 'a' doesn't match + - static member Class.A : a:HashSet -> HashSet // Argument 'a' doesn't match + - static member Class.A : a:HashSet -> HashSet // Argument 'a' doesn't match + - static member Class.A : a:HashSet -> HashSet // Argument 'a' doesn't match + - static member Class.A : a:HashSet -> HashSet // Argument 'a' doesn't match + - static member Class.A : a:HashSet -> HashSet // Argument 'a' doesn't match + - static member Class.A : a:HashSet -> HashSet // Argument 'a' doesn't match + - static member Class.A : a:HashSet -> HashSet // Argument 'a' doesn't match + - static member Class.A : a:List -> List // Argument 'a' doesn't match + - static member Class.A : a:List -> List // Argument 'a' doesn't match + - static member Class.A : a:List -> List // Argument 'a' doesn't match + - static member Class.A : a:List -> List // Argument 'a' doesn't match + - static member Class.A : a:List -> List // Argument 'a' doesn't match + - static member Class.A : a:List -> List // Argument 'a' doesn't match + - static member Class.A : a:List -> List // Argument 'a' doesn't match + - static member Class.A : a:List -> List // Argument 'a' doesn't match + - static member Class.A : a:List -> List // Argument 'a' doesn't match + - static member Class.A : a:List -> List // Argument 'a' doesn't match + - static member Class.A : a:List -> List // Argument 'a' doesn't match + - static member Class.A : a:List -> List // Argument 'a' doesn't match + - static member Class.A : a:List -> List // Argument 'a' doesn't match + - static member Class.A : a:List -> List // Argument 'a' doesn't match + - static member Class.A : a:Queue -> Queue // Argument 'a' doesn't match + - static member Class.A : a:Queue -> Queue // Argument 'a' doesn't match + - static member Class.A : a:Queue -> Queue // Argument 'a' doesn't match + - static member Class.A : a:Queue -> Queue // Argument 'a' doesn't match + - static member Class.A : a:Queue -> Queue // Argument 'a' doesn't match + - static member Class.A : a:Queue -> Queue // Argument 'a' doesn't match + - static member Class.A : a:Queue -> Queue // Argument 'a' doesn't match + - static member Class.A : a:Queue -> Queue // Argument 'a' doesn't match + - static member Class.A : a:Queue -> Queue // Argument 'a' doesn't match + - static member Class.A : a:Queue -> Queue // Argument 'a' doesn't match + - static member Class.A : a:Queue -> Queue // Argument 'a' doesn't match + - static member Class.A : a:Queue -> Queue // Argument 'a' doesn't match + - static member Class.A : a:Queue -> Queue // Argument 'a' doesn't match + - static member Class.A : a:Queue -> Queue // Argument 'a' doesn't match + - static member Class.A : a:Task -> Task // Argument 'a' doesn't match + - static member Class.A : a:Task -> Task // Argument 'a' doesn't match + - static member Class.A : a:Task -> Task // Argument 'a' doesn't match + - static member Class.A : a:Task -> Task // Argument 'a' doesn't match + - static member Class.A : a:Task -> Task // Argument 'a' doesn't match + - static member Class.A : a:Task -> Task // Argument 'a' doesn't match + - static member Class.A : a:Task -> Task // Argument 'a' doesn't match + - static member Class.A : a:Task -> Task // Argument 'a' doesn't match + - static member Class.A : a:Task -> Task // Argument 'a' doesn't match + - static member Class.A : a:Task -> Task // Argument 'a' doesn't match + - static member Class.A : a:Task -> Task // Argument 'a' doesn't match + - static member Class.A : a:Task -> Task // Argument 'a' doesn't match + - static member Class.A : a:Task -> Task // Argument 'a' doesn't match + - static member Class.A : a:Task -> Task // Argument 'a' doesn't match + - static member Class.A : a:Task -> Task // Argument 'a' doesn't match + - static member Class.A : a:decimal -> decimal // Argument 'a' doesn't match + - static member Class.A : a:float -> float // Argument 'a' doesn't match + - static member Class.A : a:float32 -> float32 // Argument 'a' doesn't match + - static member Class.A : a:int16 -> int16 // Argument 'a' doesn't match + - static member Class.A : a:int32 -> int32 // Argument 'a' doesn't match + - static member Class.A : a:int64 -> int64 // Argument 'a' doesn't match + - static member Class.A : a:int8 -> int8 // Argument 'a' doesn't match + - static member Class.A : a:string -> string // Argument 'a' doesn't match + - static member Class.A : a:uint16 -> uint16 // Argument 'a' doesn't match + - static member Class.A : a:uint32 -> uint32 // Argument 'a' doesn't match + - 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'. + +Known type of argument: DayOfWeek + +Available overloads: + - static member Class.A : a:DateTime -> DateTime // Argument 'a' doesn't match + - static member Class.A : a:Dictionary -> Dictionary // Argument 'a' doesn't match + - static member Class.A : a:Dictionary -> Dictionary // Argument 'a' doesn't match + - static member Class.A : a:Dictionary -> Dictionary // Argument 'a' doesn't match + - static member Class.A : a:Dictionary -> Dictionary // Argument 'a' doesn't match + - static member Class.A : a:Dictionary -> Dictionary // Argument 'a' doesn't match + - static member Class.A : a:Dictionary -> Dictionary // Argument 'a' doesn't match + - static member Class.A : a:Dictionary -> Dictionary // Argument 'a' doesn't match + - static member Class.A : a:Dictionary -> Dictionary // Argument 'a' doesn't match + - static member Class.A : a:Dictionary -> Dictionary // Argument 'a' doesn't match + - static member Class.A : a:Dictionary -> Dictionary // Argument 'a' doesn't match + - static member Class.A : a:Dictionary -> Dictionary // Argument 'a' doesn't match + - static member Class.A : a:Dictionary -> Dictionary // Argument 'a' doesn't match + - static member Class.A : a:Dictionary -> Dictionary // Argument 'a' doesn't match + - static member Class.A : a:Dictionary -> Dictionary // Argument 'a' doesn't match + - static member Class.A : a:HashSet -> HashSet // Argument 'a' doesn't match + - static member Class.A : a:HashSet -> HashSet // Argument 'a' doesn't match + - static member Class.A : a:HashSet -> HashSet // Argument 'a' doesn't match + - static member Class.A : a:HashSet -> HashSet // Argument 'a' doesn't match + - static member Class.A : a:HashSet -> HashSet // Argument 'a' doesn't match + - static member Class.A : a:HashSet -> HashSet // Argument 'a' doesn't match + - static member Class.A : a:HashSet -> HashSet // Argument 'a' doesn't match + - static member Class.A : a:HashSet -> HashSet // Argument 'a' doesn't match + - static member Class.A : a:HashSet -> HashSet // Argument 'a' doesn't match + - static member Class.A : a:HashSet -> HashSet // Argument 'a' doesn't match + - static member Class.A : a:HashSet -> HashSet // Argument 'a' doesn't match + - static member Class.A : a:HashSet -> HashSet // Argument 'a' doesn't match + - static member Class.A : a:HashSet -> HashSet // Argument 'a' doesn't match + - static member Class.A : a:HashSet -> HashSet // Argument 'a' doesn't match + - static member Class.A : a:List -> List // Argument 'a' doesn't match + - static member Class.A : a:List -> List // Argument 'a' doesn't match + - static member Class.A : a:List -> List // Argument 'a' doesn't match + - static member Class.A : a:List -> List // Argument 'a' doesn't match + - static member Class.A : a:List -> List // Argument 'a' doesn't match + - static member Class.A : a:List -> List // Argument 'a' doesn't match + - static member Class.A : a:List -> List // Argument 'a' doesn't match + - static member Class.A : a:List -> List // Argument 'a' doesn't match + - static member Class.A : a:List -> List // Argument 'a' doesn't match + - static member Class.A : a:List -> List // Argument 'a' doesn't match + - static member Class.A : a:List -> List // Argument 'a' doesn't match + - static member Class.A : a:List -> List // Argument 'a' doesn't match + - static member Class.A : a:List -> List // Argument 'a' doesn't match + - static member Class.A : a:List -> List // Argument 'a' doesn't match + - static member Class.A : a:Queue -> Queue // Argument 'a' doesn't match + - static member Class.A : a:Queue -> Queue // Argument 'a' doesn't match + - static member Class.A : a:Queue -> Queue // Argument 'a' doesn't match + - static member Class.A : a:Queue -> Queue // Argument 'a' doesn't match + - static member Class.A : a:Queue -> Queue // Argument 'a' doesn't match + - static member Class.A : a:Queue -> Queue // Argument 'a' doesn't match + - static member Class.A : a:Queue -> Queue // Argument 'a' doesn't match + - static member Class.A : a:Queue -> Queue // Argument 'a' doesn't match + - static member Class.A : a:Queue -> Queue // Argument 'a' doesn't match + - static member Class.A : a:Queue -> Queue // Argument 'a' doesn't match + - static member Class.A : a:Queue -> Queue // Argument 'a' doesn't match + - static member Class.A : a:Queue -> Queue // Argument 'a' doesn't match + - static member Class.A : a:Queue -> Queue // Argument 'a' doesn't match + - static member Class.A : a:Queue -> Queue // Argument 'a' doesn't match + - static member Class.A : a:Task -> Task // Argument 'a' doesn't match + - static member Class.A : a:Task -> Task // Argument 'a' doesn't match + - static member Class.A : a:Task -> Task // Argument 'a' doesn't match + - static member Class.A : a:Task -> Task // Argument 'a' doesn't match + - static member Class.A : a:Task -> Task // Argument 'a' doesn't match + - static member Class.A : a:Task -> Task // Argument 'a' doesn't match + - static member Class.A : a:Task -> Task // Argument 'a' doesn't match + - static member Class.A : a:Task -> Task // Argument 'a' doesn't match + - static member Class.A : a:Task -> Task // Argument 'a' doesn't match + - static member Class.A : a:Task -> Task // Argument 'a' doesn't match + - static member Class.A : a:Task -> Task // Argument 'a' doesn't match + - static member Class.A : a:Task -> Task // Argument 'a' doesn't match + - static member Class.A : a:Task -> Task // Argument 'a' doesn't match + - static member Class.A : a:Task -> Task // Argument 'a' doesn't match + - static member Class.A : a:Task -> Task // Argument 'a' doesn't match + - static member Class.A : a:decimal -> decimal // Argument 'a' doesn't match + - static member Class.A : a:float -> float // Argument 'a' doesn't match + - static member Class.A : a:float32 -> float32 // Argument 'a' doesn't match + - static member Class.A : a:int16 -> int16 // Argument 'a' doesn't match + - static member Class.A : a:int32 -> int32 // Argument 'a' doesn't match + - static member Class.A : a:int64 -> int64 // Argument 'a' doesn't match + - static member Class.A : a:int8 -> int8 // Argument 'a' doesn't match + - static member Class.A : a:string -> string // Argument 'a' doesn't match + - static member Class.A : a:uint16 -> uint16 // Argument 'a' doesn't match + - static member Class.A : a:uint32 -> uint32 // Argument 'a' doesn't match + - static member Class.A : a:uint64 -> uint64 // Argument 'a' doesn't match + - static member Class.A : a:uint8 -> uint8 // Argument 'a' doesn't match diff --git a/tests/fsharp/typecheck/overloads/neg_many_many_overloads.fsx b/tests/fsharp/typecheck/overloads/neg_many_many_overloads.fsx new file mode 100644 index 00000000000..9a32383821d --- /dev/null +++ b/tests/fsharp/typecheck/overloads/neg_many_many_overloads.fsx @@ -0,0 +1,126 @@ +(**) +let types0 = [ + "int8" + "int16" + "int32" + "int64" + "uint8" + "uint16" + "uint32" + "uint64" + "string" + "decimal" + "float" + "float32" + "DateTime" + "Task" + +] + +let types = [ + yield! types0 + for t in types0 do + yield sprintf "Task<%s>" t + yield sprintf "Dictionary<%s,%s>" t t + yield sprintf "HashSet<%s>" t + yield sprintf "List<%s>" t + yield sprintf "Queue<%s>" t +] + +let generate () = + [ for t in types -> sprintf " static member A (a:%s) = a" t ] + |> String.concat "\n" +printfn "%s" (generate ()) +(**) +open System +open System.Collections.Generic +open System.Threading.Tasks +type Class() = + static member A (a:int8) = a + static member A (a:int16) = a + static member A (a:int32) = a + static member A (a:int64) = a + static member A (a:uint8) = a + static member A (a:uint16) = a + static member A (a:uint32) = a + static member A (a:uint64) = a + static member A (a:string) = a + static member A (a:decimal) = a + static member A (a:float) = a + static member A (a:float32) = a + static member A (a:DateTime) = a + static member A (a:Task) = a + static member A (a:Task) = a + static member A (a:Dictionary) = a + static member A (a:HashSet) = a + static member A (a:List) = a + static member A (a:Queue) = a + static member A (a:Task) = a + static member A (a:Dictionary) = a + static member A (a:HashSet) = a + static member A (a:List) = a + static member A (a:Queue) = a + static member A (a:Task) = a + static member A (a:Dictionary) = a + static member A (a:HashSet) = a + static member A (a:List) = a + static member A (a:Queue) = a + static member A (a:Task) = a + static member A (a:Dictionary) = a + static member A (a:HashSet) = a + static member A (a:List) = a + static member A (a:Queue) = a + static member A (a:Task) = a + static member A (a:Dictionary) = a + static member A (a:HashSet) = a + static member A (a:List) = a + static member A (a:Queue) = a + static member A (a:Task) = a + static member A (a:Dictionary) = a + static member A (a:HashSet) = a + static member A (a:List) = a + static member A (a:Queue) = a + static member A (a:Task) = a + static member A (a:Dictionary) = a + static member A (a:HashSet) = a + static member A (a:List) = a + static member A (a:Queue) = a + static member A (a:Task) = a + static member A (a:Dictionary) = a + static member A (a:HashSet) = a + static member A (a:List) = a + static member A (a:Queue) = a + static member A (a:Task) = a + static member A (a:Dictionary) = a + static member A (a:HashSet) = a + static member A (a:List) = a + static member A (a:Queue) = a + static member A (a:Task) = a + static member A (a:Dictionary) = a + static member A (a:HashSet) = a + static member A (a:List) = a + static member A (a:Queue) = a + static member A (a:Task) = a + static member A (a:Dictionary) = a + static member A (a:HashSet) = a + static member A (a:List) = a + static member A (a:Queue) = a + static member A (a:Task) = a + static member A (a:Dictionary) = a + static member A (a:HashSet) = a + static member A (a:List) = a + static member A (a:Queue) = a + static member A (a:Task) = a + static member A (a:Dictionary) = a + static member A (a:HashSet) = a + static member A (a:List) = a + static member A (a:Queue) = a + static member A (a:Task) = a + static member A (a:Dictionary) = a + static member A (a:HashSet) = a + static member A (a:List) = a + static member A (a:Queue) = a +Class.A null // does filter only reference type +Class.A typedefof> +Class.A (Guid.NewGuid()) +Class.A (Unchecked.defaultof) diff --git a/tests/fsharp/typecheck/overloads/neg_tupled_arguments.bsl b/tests/fsharp/typecheck/overloads/neg_tupled_arguments.bsl new file mode 100644 index 00000000000..363c182bf3a --- /dev/null +++ b/tests/fsharp/typecheck/overloads/neg_tupled_arguments.bsl @@ -0,0 +1,18 @@ + +neg_tupled_arguments.fsx(6,9,6,31): typecheck error FS0041: No overloads match for method 'A'. + +Known types of arguments: (int * (int * string) * int) * int + +Available overloads: + - static member A.A : ('a0 * ('a1 * int) * 'a2) * ('a3 * ('a4 * 'a5)) -> 'a0 * 'a1 * int * 'a2 * 'a3 * 'a4 * 'a5 // Argument at index 1 doesn't match + - static member A.A : ('a0 * ('a1 * int) * 'a2) * e:'a3 -> 'a0 * 'a1 * int * 'a2 * 'a3 // Argument at index 1 doesn't match + +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'. + +Known types of arguments: int * int * (int * (int * int * int * (int * int))) * int * int + +Available overloads: + - static member B.B : a:'a0 * b:'a1 * ('a2 * ('a3 * 'a4 * 'a5 * ('a6 * decimal))) * i:'a7 * j:'a8 -> 'a0 * 'a1 * 'a2 * 'a3 * 'a4 * 'a5 * 'a6 * decimal * 'a7 * 'a8 // Argument at index 3 doesn't match + - static member B.B : a:'a0 * b:'a1 * ('a2 * ('a3 * 'a4 * 'a5 * ('a6 * string))) * i:'a7 * j:'a8 -> 'a0 * 'a1 * 'a2 * 'a3 * 'a4 * 'a5 * 'a6 * string * 'a7 * 'a8 // Argument at index 3 doesn't match diff --git a/tests/fsharp/typecheck/overloads/neg_tupled_arguments.fsx b/tests/fsharp/typecheck/overloads/neg_tupled_arguments.fsx new file mode 100644 index 00000000000..53fc7e76d78 --- /dev/null +++ b/tests/fsharp/typecheck/overloads/neg_tupled_arguments.fsx @@ -0,0 +1,14 @@ +type A() = + static member A ((a,(b,(c:int)),d),e) = a,b,c,d,e + static member A ((a,(b,(c:int)),d),(e,(f,g))) = a,b,c,d,e,f,g + ;; + +let a = A.A ((1,(2,("")),4),5);; +let a = A.A("a",("",1),1,1);; + + +type B = + static member B (a,b,(c,(d,e,f,(g,h:string))),i,j) = a,b,c,d,e,f,g,h,i,j + static member B (a,b,(c,(d,e,f,(g,h:decimal))),i,j) = a,b,c,d,e,f,g,h,i,j +;; +let b = B.B(1,2,(3,(4,5,6,(7,8))),9,10);; diff --git a/tests/fsharp/typecheck/sigs/neg06.bsl b/tests/fsharp/typecheck/sigs/neg06.bsl index 431398803d5..59553cc99b5 100644 --- a/tests/fsharp/typecheck/sigs/neg06.bsl +++ b/tests/fsharp/typecheck/sigs/neg06.bsl @@ -138,6 +138,12 @@ neg06.fs(350,13,350,21): typecheck error FS0039: The value or constructor 'BadTy 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. Candidates: static member C.M1 : x:int -> int, static member C.M1 : x:string -> int +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. + +Known type of argument: 'a + +Candidates: + - static member C.M1 : x:int -> int + - static member C.M1 : x:string -> int neg06.fs(398,13,398,14): typecheck error FS0025: Incomplete pattern matches on this expression. For example, the value '0' may indicate a case not covered by the pattern(s). Unmatched elements will be ignored. diff --git a/tests/fsharp/typecheck/sigs/neg106.bsl b/tests/fsharp/typecheck/sigs/neg106.bsl index e07dd731fbb..373bf01fe9d 100644 --- a/tests/fsharp/typecheck/sigs/neg106.bsl +++ b/tests/fsharp/typecheck/sigs/neg106.bsl @@ -1,81 +1,33 @@ 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'. The available overloads are shown below. -neg106.fs(13,18,13,72): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: int, comparand: int) : int'. Type constraint mismatch. The type - 'inref' -is not compatible with type - 'byref' -. -neg106.fs(13,18,13,72): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: int64, comparand: int64) : int64'. Type constraint mismatch. The type - 'inref' -is not compatible with type - 'byref' -. -neg106.fs(13,18,13,72): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: float32, comparand: float32) : float32'. Type constraint mismatch. The type - 'inref' -is not compatible with type - 'byref' -. -neg106.fs(13,18,13,72): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: float, comparand: float) : float'. Type constraint mismatch. The type - 'inref' -is not compatible with type - 'byref' -. -neg106.fs(13,18,13,72): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: obj, comparand: obj) : obj'. Type constraint mismatch. The type - 'inref' -is not compatible with type - 'byref' -. -neg106.fs(13,18,13,72): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: nativeint, comparand: nativeint) : nativeint'. Type constraint mismatch. The type - 'inref' -is not compatible with type - 'byref' -. -neg106.fs(13,18,13,72): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange<'T when 'T : not struct>(location1: byref<'T>, value: 'T, comparand: 'T) : 'T'. Type constraint mismatch. The type - 'inref' -is not compatible with type - 'byref<'a>' -. +neg106.fs(13,18,13,72): typecheck error FS0041: No overloads match for method 'CompareExchange'. + +Known types of arguments: inref * int * int + +Available overloads: + - System.Threading.Interlocked.CompareExchange(location1: byref, value: float32, comparand: float32) : float32 // Argument 'location1' doesn't match + - System.Threading.Interlocked.CompareExchange(location1: byref, value: float, comparand: float) : float // Argument 'location1' doesn't match + - System.Threading.Interlocked.CompareExchange(location1: byref, value: int64, comparand: int64) : int64 // Argument 'location1' doesn't match + - System.Threading.Interlocked.CompareExchange(location1: byref, value: int, comparand: int) : int // Argument 'location1' doesn't match + - System.Threading.Interlocked.CompareExchange(location1: byref, value: nativeint, comparand: nativeint) : nativeint // Argument 'location1' doesn't match + - System.Threading.Interlocked.CompareExchange(location1: byref, value: obj, comparand: obj) : obj // Argument 'location1' doesn't match + - System.Threading.Interlocked.CompareExchange<'T when 'T : not struct>(location1: byref<'T>, value: 'T, comparand: 'T) : 'T // Argument 'location1' doesn't match 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'. The available overloads are shown below. -neg106.fs(17,14,17,68): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: int, comparand: int) : int'. Type constraint mismatch. The type - 'inref' -is not compatible with type - 'byref' -. -neg106.fs(17,14,17,68): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: int64, comparand: int64) : int64'. Type constraint mismatch. The type - 'inref' -is not compatible with type - 'byref' -. -neg106.fs(17,14,17,68): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: float32, comparand: float32) : float32'. Type constraint mismatch. The type - 'inref' -is not compatible with type - 'byref' -. -neg106.fs(17,14,17,68): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: float, comparand: float) : float'. Type constraint mismatch. The type - 'inref' -is not compatible with type - 'byref' -. -neg106.fs(17,14,17,68): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: obj, comparand: obj) : obj'. Type constraint mismatch. The type - 'inref' -is not compatible with type - 'byref' -. -neg106.fs(17,14,17,68): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: nativeint, comparand: nativeint) : nativeint'. Type constraint mismatch. The type - 'inref' -is not compatible with type - 'byref' -. -neg106.fs(17,14,17,68): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange<'T when 'T : not struct>(location1: byref<'T>, value: 'T, comparand: 'T) : 'T'. Type constraint mismatch. The type - 'inref' -is not compatible with type - 'byref<'a>' -. +neg106.fs(17,14,17,68): typecheck error FS0041: No overloads match for method 'CompareExchange'. + +Known types of arguments: inref * int * int + +Available overloads: + - System.Threading.Interlocked.CompareExchange(location1: byref, value: float32, comparand: float32) : float32 // Argument 'location1' doesn't match + - System.Threading.Interlocked.CompareExchange(location1: byref, value: float, comparand: float) : float // Argument 'location1' doesn't match + - System.Threading.Interlocked.CompareExchange(location1: byref, value: int64, comparand: int64) : int64 // Argument 'location1' doesn't match + - System.Threading.Interlocked.CompareExchange(location1: byref, value: int, comparand: int) : int // Argument 'location1' doesn't match + - System.Threading.Interlocked.CompareExchange(location1: byref, value: nativeint, comparand: nativeint) : nativeint // Argument 'location1' doesn't match + - System.Threading.Interlocked.CompareExchange(location1: byref, value: obj, comparand: obj) : obj // Argument 'location1' doesn't match + - System.Threading.Interlocked.CompareExchange<'T when 'T : not struct>(location1: byref<'T>, value: 'T, comparand: 'T) : 'T // Argument 'location1' doesn't match neg106.fs(23,35,23,39): typecheck error FS0001: Type mismatch. Expecting a 'byref' @@ -89,29 +41,21 @@ 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'. The available overloads are shown below. -neg106.fs(40,18,40,32): typecheck error FS0041: Possible overload: 'static member C.M : a:string * x:byref -> unit'. Type constraint mismatch. The type - 'inref' -is not compatible with type - 'byref' -. -neg106.fs(40,18,40,32): typecheck error FS0041: Possible overload: 'static member C.M : a:int * x:byref -> unit'. Type constraint mismatch. The type - 'string' -is not compatible with type - 'int' -. - -neg106.fs(41,19,41,31): typecheck error FS0041: No overloads match for method 'M'. The available overloads are shown below. -neg106.fs(41,19,41,31): typecheck error FS0041: Possible overload: 'static member C.M : a:string * x:byref -> unit'. Type constraint mismatch. The type - 'int' -is not compatible with type - 'string' -. -neg106.fs(41,19,41,31): typecheck error FS0041: Possible overload: 'static member C.M : a:int * x:byref -> unit'. Type constraint mismatch. The type - 'inref' -is not compatible with type - 'byref' -. +neg106.fs(40,18,40,32): typecheck error FS0041: No overloads match for method 'M'. + +Known types of arguments: string * inref + +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'. + +Known types of arguments: int * inref + +Available overloads: + - static member C.M : a:int * x:byref -> unit // Argument 'x' doesn't match + - static member C.M : a:string * x:byref -> unit // Argument 'a' doesn't match neg106.fs(49,22,49,26): typecheck error FS0001: Type mismatch. Expecting a 'byref' diff --git a/tests/fsharp/typecheck/sigs/neg106.vsbsl b/tests/fsharp/typecheck/sigs/neg106.vsbsl index e07dd731fbb..373bf01fe9d 100644 --- a/tests/fsharp/typecheck/sigs/neg106.vsbsl +++ b/tests/fsharp/typecheck/sigs/neg106.vsbsl @@ -1,81 +1,33 @@ 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'. The available overloads are shown below. -neg106.fs(13,18,13,72): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: int, comparand: int) : int'. Type constraint mismatch. The type - 'inref' -is not compatible with type - 'byref' -. -neg106.fs(13,18,13,72): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: int64, comparand: int64) : int64'. Type constraint mismatch. The type - 'inref' -is not compatible with type - 'byref' -. -neg106.fs(13,18,13,72): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: float32, comparand: float32) : float32'. Type constraint mismatch. The type - 'inref' -is not compatible with type - 'byref' -. -neg106.fs(13,18,13,72): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: float, comparand: float) : float'. Type constraint mismatch. The type - 'inref' -is not compatible with type - 'byref' -. -neg106.fs(13,18,13,72): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: obj, comparand: obj) : obj'. Type constraint mismatch. The type - 'inref' -is not compatible with type - 'byref' -. -neg106.fs(13,18,13,72): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: nativeint, comparand: nativeint) : nativeint'. Type constraint mismatch. The type - 'inref' -is not compatible with type - 'byref' -. -neg106.fs(13,18,13,72): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange<'T when 'T : not struct>(location1: byref<'T>, value: 'T, comparand: 'T) : 'T'. Type constraint mismatch. The type - 'inref' -is not compatible with type - 'byref<'a>' -. +neg106.fs(13,18,13,72): typecheck error FS0041: No overloads match for method 'CompareExchange'. + +Known types of arguments: inref * int * int + +Available overloads: + - System.Threading.Interlocked.CompareExchange(location1: byref, value: float32, comparand: float32) : float32 // Argument 'location1' doesn't match + - System.Threading.Interlocked.CompareExchange(location1: byref, value: float, comparand: float) : float // Argument 'location1' doesn't match + - System.Threading.Interlocked.CompareExchange(location1: byref, value: int64, comparand: int64) : int64 // Argument 'location1' doesn't match + - System.Threading.Interlocked.CompareExchange(location1: byref, value: int, comparand: int) : int // Argument 'location1' doesn't match + - System.Threading.Interlocked.CompareExchange(location1: byref, value: nativeint, comparand: nativeint) : nativeint // Argument 'location1' doesn't match + - System.Threading.Interlocked.CompareExchange(location1: byref, value: obj, comparand: obj) : obj // Argument 'location1' doesn't match + - System.Threading.Interlocked.CompareExchange<'T when 'T : not struct>(location1: byref<'T>, value: 'T, comparand: 'T) : 'T // Argument 'location1' doesn't match 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'. The available overloads are shown below. -neg106.fs(17,14,17,68): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: int, comparand: int) : int'. Type constraint mismatch. The type - 'inref' -is not compatible with type - 'byref' -. -neg106.fs(17,14,17,68): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: int64, comparand: int64) : int64'. Type constraint mismatch. The type - 'inref' -is not compatible with type - 'byref' -. -neg106.fs(17,14,17,68): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: float32, comparand: float32) : float32'. Type constraint mismatch. The type - 'inref' -is not compatible with type - 'byref' -. -neg106.fs(17,14,17,68): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: float, comparand: float) : float'. Type constraint mismatch. The type - 'inref' -is not compatible with type - 'byref' -. -neg106.fs(17,14,17,68): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: obj, comparand: obj) : obj'. Type constraint mismatch. The type - 'inref' -is not compatible with type - 'byref' -. -neg106.fs(17,14,17,68): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: nativeint, comparand: nativeint) : nativeint'. Type constraint mismatch. The type - 'inref' -is not compatible with type - 'byref' -. -neg106.fs(17,14,17,68): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange<'T when 'T : not struct>(location1: byref<'T>, value: 'T, comparand: 'T) : 'T'. Type constraint mismatch. The type - 'inref' -is not compatible with type - 'byref<'a>' -. +neg106.fs(17,14,17,68): typecheck error FS0041: No overloads match for method 'CompareExchange'. + +Known types of arguments: inref * int * int + +Available overloads: + - System.Threading.Interlocked.CompareExchange(location1: byref, value: float32, comparand: float32) : float32 // Argument 'location1' doesn't match + - System.Threading.Interlocked.CompareExchange(location1: byref, value: float, comparand: float) : float // Argument 'location1' doesn't match + - System.Threading.Interlocked.CompareExchange(location1: byref, value: int64, comparand: int64) : int64 // Argument 'location1' doesn't match + - System.Threading.Interlocked.CompareExchange(location1: byref, value: int, comparand: int) : int // Argument 'location1' doesn't match + - System.Threading.Interlocked.CompareExchange(location1: byref, value: nativeint, comparand: nativeint) : nativeint // Argument 'location1' doesn't match + - System.Threading.Interlocked.CompareExchange(location1: byref, value: obj, comparand: obj) : obj // Argument 'location1' doesn't match + - System.Threading.Interlocked.CompareExchange<'T when 'T : not struct>(location1: byref<'T>, value: 'T, comparand: 'T) : 'T // Argument 'location1' doesn't match neg106.fs(23,35,23,39): typecheck error FS0001: Type mismatch. Expecting a 'byref' @@ -89,29 +41,21 @@ 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'. The available overloads are shown below. -neg106.fs(40,18,40,32): typecheck error FS0041: Possible overload: 'static member C.M : a:string * x:byref -> unit'. Type constraint mismatch. The type - 'inref' -is not compatible with type - 'byref' -. -neg106.fs(40,18,40,32): typecheck error FS0041: Possible overload: 'static member C.M : a:int * x:byref -> unit'. Type constraint mismatch. The type - 'string' -is not compatible with type - 'int' -. - -neg106.fs(41,19,41,31): typecheck error FS0041: No overloads match for method 'M'. The available overloads are shown below. -neg106.fs(41,19,41,31): typecheck error FS0041: Possible overload: 'static member C.M : a:string * x:byref -> unit'. Type constraint mismatch. The type - 'int' -is not compatible with type - 'string' -. -neg106.fs(41,19,41,31): typecheck error FS0041: Possible overload: 'static member C.M : a:int * x:byref -> unit'. Type constraint mismatch. The type - 'inref' -is not compatible with type - 'byref' -. +neg106.fs(40,18,40,32): typecheck error FS0041: No overloads match for method 'M'. + +Known types of arguments: string * inref + +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'. + +Known types of arguments: int * inref + +Available overloads: + - static member C.M : a:int * x:byref -> unit // Argument 'x' doesn't match + - static member C.M : a:string * x:byref -> unit // Argument 'a' doesn't match neg106.fs(49,22,49,26): typecheck error FS0001: Type mismatch. Expecting a 'byref' diff --git a/tests/fsharp/typecheck/sigs/neg116.bsl b/tests/fsharp/typecheck/sigs/neg116.bsl index 8bd4930a304..8613d44041c 100644 --- a/tests/fsharp/typecheck/sigs/neg116.bsl +++ b/tests/fsharp/typecheck/sigs/neg116.bsl @@ -1,12 +1,10 @@ -neg116.fs(10,44,10,45): typecheck error FS0043: No overloads match for method 'op_Multiply'. The available overloads are shown below. -neg116.fs(10,44,10,45): typecheck error FS0043: Possible overload: 'static member Polynomial.( * ) : s:Complex * p:Polynomial -> Polynomial'. Type constraint mismatch. The type - 'float' -is not compatible with type - 'Complex' -. -neg116.fs(10,44,10,45): typecheck error FS0043: Possible overload: 'static member Polynomial.( * ) : s:decimal * p:Polynomial -> Polynomial'. Type constraint mismatch. The type - 'float' -is not compatible with type - 'decimal' -. +neg116.fs(10,44,10,45): typecheck error FS0043: No overloads match for method 'op_Multiply'. + +Known return type: ^a + +Known type parameters: < float , Polynomial > + +Available overloads: + - static member Polynomial.( * ) : s:Complex * p:Polynomial -> Polynomial // Argument 's' doesn't match + - static member Polynomial.( * ) : s:decimal * p:Polynomial -> Polynomial // Argument 's' doesn't match diff --git a/tests/fsharp/typecheck/sigs/neg117.bsl b/tests/fsharp/typecheck/sigs/neg117.bsl index 49c2665190b..9d0fdfb84ec 100644 --- a/tests/fsharp/typecheck/sigs/neg117.bsl +++ b/tests/fsharp/typecheck/sigs/neg117.bsl @@ -1,12 +1,10 @@ -neg117.fs(79,18,79,59): ilxgen error FS0041: No overloads match for method 'Transform'. The available overloads are shown below. -neg117.fs(79,18,79,59): ilxgen error FS0041: Possible overload: 'static member Neg117.Superpower.Transformer.Transform : ^r * Neg117.TargetA.TargetA * Neg117.Superpower.Transformer -> (Neg117.TargetA.TransformerKind -> ^r) when (Neg117.TargetA.TargetA or ^r) : (static member Transform : ^r * Neg117.TargetA.TargetA -> Neg117.TargetA.TransformerKind -> ^r)'. Type constraint mismatch. The type - 'Neg117.TargetA.M1 Microsoft.FSharp.Core.[]' -is not compatible with type - ''a' -. -neg117.fs(79,18,79,59): ilxgen error FS0041: Possible overload: 'static member Neg117.Superpower.Transformer.Transform : ^f * Neg117.TargetB.TargetB * Neg117.Superpower.Transformer -> (Neg117.TargetB.TransformerKind -> ^f) when (Neg117.TargetB.TargetB or ^f) : (static member Transform : ^f * Neg117.TargetB.TargetB -> Neg117.TargetB.TransformerKind -> ^f)'. Type constraint mismatch. The type - 'Neg117.TargetA.M1 Microsoft.FSharp.Core.[]' -is not compatible with type - ''a' -. +neg117.fs(79,18,79,59): ilxgen error FS0041: No overloads match for method 'Transform'. + +Known return type: ('a -> Neg117.TargetA.M1 Microsoft.FSharp.Core.[]) + +Known type parameters: < Neg117.TargetA.M1 Microsoft.FSharp.Core.[] , Microsoft.FSharp.Core.obj , Neg117.Superpower.Transformer > + +Available overloads: + - static member Neg117.Superpower.Transformer.Transform : ^f * Neg117.TargetB.TargetB * Neg117.Superpower.Transformer -> (Neg117.TargetB.TransformerKind -> ^f) when (Neg117.TargetB.TargetB or ^f) : (static member Transform : ^f * Neg117.TargetB.TargetB -> Neg117.TargetB.TransformerKind -> ^f) // Argument at index 1 doesn't match + - static member Neg117.Superpower.Transformer.Transform : ^r * Neg117.TargetA.TargetA * Neg117.Superpower.Transformer -> (Neg117.TargetA.TransformerKind -> ^r) when (Neg117.TargetA.TargetA or ^r) : (static member Transform : ^r * Neg117.TargetA.TargetA -> Neg117.TargetA.TransformerKind -> ^r) // Argument at index 1 doesn't match diff --git a/tests/fsharp/typecheck/sigs/neg119.bsl b/tests/fsharp/typecheck/sigs/neg119.bsl index 9f13a88643a..975fc46185a 100644 --- a/tests/fsharp/typecheck/sigs/neg119.bsl +++ b/tests/fsharp/typecheck/sigs/neg119.bsl @@ -1,22 +1,12 @@ -neg119.fs(40,20,40,22): typecheck error FS0071: Type constraint mismatch when applying the default type 'obj' for a type inference variable. No overloads match for method 'Return'. The available overloads are shown below. Consider adding further type constraints -neg119.fs(40,20,40,22): typecheck error FS0071: Possible overload: 'static member Applicatives.Ap.Return : ('r -> 'a) * Ap:Applicatives.Ap -> (('a -> 'r -> 'a2) -> 'a3 -> 'a -> 'r -> 'a2)'. Type constraint mismatch. The type - 'obj' -is not compatible with type - ''a -> 'b' -. -neg119.fs(40,20,40,22): typecheck error FS0071: Possible overload: 'static member Applicatives.Ap.Return : System.Tuple<'a> * Ap:Applicatives.Ap -> ('a -> System.Tuple<'a>)'. Type constraint mismatch. The type - 'obj' -is not compatible with type - 'System.Tuple<'a>' -. -neg119.fs(40,20,40,22): typecheck error FS0071: Possible overload: 'static member Applicatives.Ap.Return : seq<'a> * Ap:Applicatives.Ap -> ('a -> seq<'a>)'. Type constraint mismatch. The type - 'obj' -is not compatible with type - 'seq<'a>' -. -neg119.fs(40,20,40,22): typecheck error FS0071: Possible overload: 'static member Applicatives.Ap.Return : r: ^R * obj -> ('a1 -> ^R) when ^R : (static member Return : 'a1 -> ^R)'. Type constraint mismatch. The type - 'obj' -is not compatible with type - ''a' -. +neg119.fs(40,20,40,22): typecheck error FS0071: Type constraint mismatch when applying the default type 'obj' for a type inference variable. No overloads match for method 'Return'. + +Known return type: ((int -> int -> int) -> obj) + +Known type parameters: < obj , Applicatives.Ap > + +Available overloads: + - static member Applicatives.Ap.Return : ('r -> 'a) * Ap:Applicatives.Ap -> (('a -> 'r -> 'a2) -> 'a3 -> 'a -> 'r -> 'a2) // Argument at index 1 doesn't match + - static member Applicatives.Ap.Return : System.Tuple<'a> * Ap:Applicatives.Ap -> ('a -> System.Tuple<'a>) // Argument at index 1 doesn't match + - static member Applicatives.Ap.Return : r: ^R * obj -> ('a1 -> ^R) when ^R : (static member Return : 'a1 -> ^R) // Argument 'r' doesn't match + - static member Applicatives.Ap.Return : seq<'a> * Ap:Applicatives.Ap -> ('a -> seq<'a>) // Argument at index 1 doesn't match Consider adding further type constraints diff --git a/tests/fsharp/typecheck/sigs/neg120.bsl b/tests/fsharp/typecheck/sigs/neg120.bsl index 1d7137c417f..315d92239b0 100644 --- a/tests/fsharp/typecheck/sigs/neg120.bsl +++ b/tests/fsharp/typecheck/sigs/neg120.bsl @@ -1,27 +1,13 @@ -neg120.fs(95,18,95,21): typecheck error FS0071: Type constraint mismatch when applying the default type 'obj' for a type inference variable. No overloads match for method 'op_GreaterGreaterEquals'. The available overloads are shown below. Consider adding further type constraints -neg120.fs(95,18,95,21): typecheck error FS0071: Possible overload: 'static member Bind.( >>= ) : source:Id<'T> * f:('T -> Id<'U>) -> Id<'U>'. Type constraint mismatch. The type - 'int -> obj' -is not compatible with type - ''a -> Id<'b>' -. -neg120.fs(95,18,95,21): typecheck error FS0071: Possible overload: 'static member Bind.( >>= ) : source:Async<'T> * f:('T -> Async<'a1>) -> Async<'a1>'. Type constraint mismatch. The type - 'Id' -is not compatible with type - 'Async<'a>' -. -neg120.fs(95,18,95,21): typecheck error FS0071: Possible overload: 'static member Bind.( >>= ) : source:'T option * f:('T -> 'U option) -> 'U option'. Type constraint mismatch. The type - 'Id' -is not compatible with type - ''a option' -. -neg120.fs(95,18,95,21): typecheck error FS0071: Possible overload: 'static member Bind.( >>= ) : source:Task<'T> * f:('T -> Task<'U>) -> Task<'U>'. Type constraint mismatch. The type - 'Id' -is not compatible with type - 'Task<'a>' -. -neg120.fs(95,18,95,21): typecheck error FS0071: Possible overload: 'static member Bind.( >>= ) : source:Lazy<'T> * f:('T -> Lazy<'U>) -> Lazy<'U>'. Type constraint mismatch. The type - 'Id' -is not compatible with type - 'Lazy<'a>' -. +neg120.fs(95,18,95,21): typecheck error FS0071: Type constraint mismatch when applying the default type 'obj' for a type inference variable. No overloads match for method 'op_GreaterGreaterEquals'. + +Known return type: obj + +Known type parameters: < Id , (int -> obj) > + +Available overloads: + - static member Bind.( >>= ) : source:'T option * f:('T -> 'U option) -> 'U option // Argument 'source' doesn't match + - static member Bind.( >>= ) : source:Async<'T> * f:('T -> Async<'a1>) -> Async<'a1> // Argument 'source' doesn't match + - static member Bind.( >>= ) : source:Id<'T> * f:('T -> Id<'U>) -> Id<'U> // Argument 'f' doesn't match + - static member Bind.( >>= ) : source:Lazy<'T> * f:('T -> Lazy<'U>) -> Lazy<'U> // Argument 'source' doesn't match + - static member Bind.( >>= ) : source:Task<'T> * f:('T -> Task<'U>) -> Task<'U> // Argument 'source' doesn't match Consider adding further type constraints diff --git a/tests/fsharp/typecheck/sigs/neg124.bsl b/tests/fsharp/typecheck/sigs/neg124.bsl index b9c55eba735..356440c6eff 100644 --- a/tests/fsharp/typecheck/sigs/neg124.bsl +++ b/tests/fsharp/typecheck/sigs/neg124.bsl @@ -1,42 +1,16 @@ -neg124.fs(39,27,39,35): typecheck error FS0071: Type constraint mismatch when applying the default type 'obj' for a type inference variable. No overloads match for method 'unsigned_witness'. The available overloads are shown below. Consider adding further type constraints -neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:uint64 -> uint64'. Type constraint mismatch. The type - 'obj' -is not compatible with type - 'uint64' -. -neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:int64 -> uint64'. Type constraint mismatch. The type - 'obj' -is not compatible with type - 'int64' -. -neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:uint32 -> uint32'. Type constraint mismatch. The type - 'obj' -is not compatible with type - 'uint32' -. -neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:int32 -> uint32'. Type constraint mismatch. The type - 'obj' -is not compatible with type - 'int32' -. -neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:uint16 -> uint16'. Type constraint mismatch. The type - 'obj' -is not compatible with type - 'uint16' -. -neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:int16 -> uint16'. Type constraint mismatch. The type - 'obj' -is not compatible with type - 'int16' -. -neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:byte -> byte'. Type constraint mismatch. The type - 'obj' -is not compatible with type - 'byte' -. -neg124.fs(39,27,39,35): typecheck error FS0071: Possible overload: 'static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:sbyte -> uint8'. Type constraint mismatch. The type - 'obj' -is not compatible with type - 'sbyte' -. +neg124.fs(39,27,39,35): typecheck error FS0071: Type constraint mismatch when applying the default type 'obj' for a type inference variable. No overloads match for method 'unsigned_witness'. + +Known return type: uint8 + +Known type parameter: < obj > + +Available overloads: + - static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:byte -> byte // Argument 'x' doesn't match + - static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:int16 -> uint16 // Argument 'x' doesn't match + - static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:int32 -> uint32 // Argument 'x' doesn't match + - static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:int64 -> uint64 // Argument 'x' doesn't match + - static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:sbyte -> uint8 // Argument 'x' doesn't match + - static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:uint16 -> uint16 // Argument 'x' doesn't match + - static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:uint32 -> uint32 // Argument 'x' doesn't match + - static member Negative_SelectOverloadedWitnessBasedOnInputAndReturnTypeWithoutOutputTypeSelector.witnesses.unsigned_witness : x:uint64 -> uint64 // Argument 'x' doesn't match Consider adding further type constraints diff --git a/tests/fsharp/typecheck/sigs/neg125.bsl b/tests/fsharp/typecheck/sigs/neg125.bsl index 4c96bbcc15e..5c26683981b 100644 --- a/tests/fsharp/typecheck/sigs/neg125.bsl +++ b/tests/fsharp/typecheck/sigs/neg125.bsl @@ -1,26 +1,273 @@ -neg125.fs(39,30,39,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +neg125.fs(39,30,39,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. -neg125.fs(40,30,40,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +Known return type: int32 -neg125.fs(41,31,41,33): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +Known type parameter: < BigInteger > -neg125.fs(42,30,42,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 -neg125.fs(43,30,43,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +neg125.fs(40,30,40,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. -neg125.fs(44,30,44,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +Known return type: int64 -neg125.fs(45,29,45,31): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +Known type parameter: < BigInteger > -neg125.fs(46,31,46,33): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 -neg125.fs(47,31,47,33): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +neg125.fs(41,31,41,33): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. -neg125.fs(48,32,48,34): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +Known return type: bigint -neg125.fs(49,33,49,35): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +Known type parameter: < BigInteger > -neg125.fs(50,33,50,35): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 -neg125.fs(51,33,51,35): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +neg125.fs(42,30,42,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known return type: float + +Known type parameter: < BigInteger > + +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 + +neg125.fs(43,30,43,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known return type: sbyte + +Known type parameter: < BigInteger > + +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 + +neg125.fs(44,30,44,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known return type: int16 + +Known type parameter: < BigInteger > + +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 + +neg125.fs(45,29,45,31): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known return type: byte + +Known type parameter: < BigInteger > + +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 + +neg125.fs(46,31,46,33): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known return type: uint16 + +Known type parameter: < BigInteger > + +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 + +neg125.fs(47,31,47,33): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known return type: uint32 + +Known type parameter: < BigInteger > + +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 + +neg125.fs(48,32,48,34): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known return type: uint64 + +Known type parameter: < BigInteger > + +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 + +neg125.fs(49,33,49,35): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known return type: float32 + +Known type parameter: < BigInteger > + +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 + +neg125.fs(50,33,50,35): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known return type: decimal + +Known type parameter: < BigInteger > + +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 + +neg125.fs(51,33,51,35): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known return type: Complex + +Known type parameter: < BigInteger > + +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 diff --git a/tests/fsharp/typecheck/sigs/neg127.bsl b/tests/fsharp/typecheck/sigs/neg127.bsl index 0ab9e8c5348..39c91a61d5b 100644 --- a/tests/fsharp/typecheck/sigs/neg127.bsl +++ b/tests/fsharp/typecheck/sigs/neg127.bsl @@ -1,26 +1,273 @@ -neg127.fs(47,30,47,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +neg127.fs(47,30,47,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. -neg127.fs(48,30,48,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +Known return type: int32 -neg127.fs(49,31,49,33): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +Known type parameter: < BigInteger > -neg127.fs(50,30,50,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 -neg127.fs(51,30,51,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +neg127.fs(48,30,48,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. -neg127.fs(52,30,52,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +Known return type: int64 -neg127.fs(53,29,53,31): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +Known type parameter: < BigInteger > -neg127.fs(54,31,54,33): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 -neg127.fs(55,31,55,33): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +neg127.fs(49,31,49,33): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. -neg127.fs(56,32,56,34): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +Known return type: bigint -neg127.fs(57,33,57,35): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +Known type parameter: < BigInteger > -neg127.fs(58,33,58,35): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 -neg127.fs(59,33,59,35): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint -> Complex, static member witnesses.convert_witness : x:bigint -> bigint, static member witnesses.convert_witness : x:bigint -> byte, static member witnesses.convert_witness : x:bigint -> decimal, static member witnesses.convert_witness : x:bigint -> float, static member witnesses.convert_witness : x:bigint -> float32, static member witnesses.convert_witness : x:bigint -> int, static member witnesses.convert_witness : x:bigint -> int16, static member witnesses.convert_witness : x:bigint -> int64, static member witnesses.convert_witness : x:bigint -> sbyte, static member witnesses.convert_witness : x:bigint -> uint16, static member witnesses.convert_witness : x:bigint -> uint32, static member witnesses.convert_witness : x:bigint -> uint64 +neg127.fs(50,30,50,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known return type: float + +Known type parameter: < BigInteger > + +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 + +neg127.fs(51,30,51,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known return type: sbyte + +Known type parameter: < BigInteger > + +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 + +neg127.fs(52,30,52,32): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known return type: int16 + +Known type parameter: < BigInteger > + +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 + +neg127.fs(53,29,53,31): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known return type: byte + +Known type parameter: < BigInteger > + +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 + +neg127.fs(54,31,54,33): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known return type: uint16 + +Known type parameter: < BigInteger > + +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 + +neg127.fs(55,31,55,33): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known return type: uint32 + +Known type parameter: < BigInteger > + +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 + +neg127.fs(56,32,56,34): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known return type: uint64 + +Known type parameter: < BigInteger > + +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 + +neg127.fs(57,33,57,35): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known return type: float32 + +Known type parameter: < BigInteger > + +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 + +neg127.fs(58,33,58,35): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known return type: decimal + +Known type parameter: < BigInteger > + +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 + +neg127.fs(59,33,59,35): typecheck error FS0001: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known return type: Complex + +Known type parameter: < BigInteger > + +Candidates: + - static member witnesses.convert_witness : x:bigint -> Complex + - static member witnesses.convert_witness : x:bigint -> bigint + - static member witnesses.convert_witness : x:bigint -> byte + - static member witnesses.convert_witness : x:bigint -> decimal + - static member witnesses.convert_witness : x:bigint -> float + - static member witnesses.convert_witness : x:bigint -> float32 + - static member witnesses.convert_witness : x:bigint -> int + - static member witnesses.convert_witness : x:bigint -> int16 + - static member witnesses.convert_witness : x:bigint -> int64 + - static member witnesses.convert_witness : x:bigint -> sbyte + - static member witnesses.convert_witness : x:bigint -> uint16 + - static member witnesses.convert_witness : x:bigint -> uint32 + - static member witnesses.convert_witness : x:bigint -> uint64 diff --git a/tests/fsharp/typecheck/sigs/neg128.bsl b/tests/fsharp/typecheck/sigs/neg128.bsl index 3d91ad25b52..5d41804b731 100644 --- a/tests/fsharp/typecheck/sigs/neg128.bsl +++ b/tests/fsharp/typecheck/sigs/neg128.bsl @@ -1,2 +1,21 @@ -neg128.fs(36,47,36,54): typecheck error FS0043: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint * _output:Complex -> Complex, static member witnesses.convert_witness : x:bigint * _output:bigint -> bigint, static member witnesses.convert_witness : x:bigint * _output:byte -> byte, static member witnesses.convert_witness : x:bigint * _output:decimal -> decimal, static member witnesses.convert_witness : x:bigint * _output:float -> float, static member witnesses.convert_witness : x:bigint * _output:float32 -> float32, static member witnesses.convert_witness : x:bigint * _output:int16 -> int16, static member witnesses.convert_witness : x:bigint * _output:int32 -> int, static member witnesses.convert_witness : x:bigint * _output:int64 -> int64, static member witnesses.convert_witness : x:bigint * _output:sbyte -> sbyte, static member witnesses.convert_witness : x:bigint * _output:uint16 -> uint16, static member witnesses.convert_witness : x:bigint * _output:uint32 -> uint32, static member witnesses.convert_witness : x:bigint * _output:uint64 -> uint64 +neg128.fs(36,47,36,54): typecheck error FS0043: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known return type: 'output + +Known type parameters: < bigint , 'output > + +Candidates: + - static member witnesses.convert_witness : x:bigint * _output:Complex -> Complex + - static member witnesses.convert_witness : x:bigint * _output:bigint -> bigint + - static member witnesses.convert_witness : x:bigint * _output:byte -> byte + - static member witnesses.convert_witness : x:bigint * _output:decimal -> decimal + - static member witnesses.convert_witness : x:bigint * _output:float -> float + - static member witnesses.convert_witness : x:bigint * _output:float32 -> float32 + - static member witnesses.convert_witness : x:bigint * _output:int16 -> int16 + - static member witnesses.convert_witness : x:bigint * _output:int32 -> int + - static member witnesses.convert_witness : x:bigint * _output:int64 -> int64 + - static member witnesses.convert_witness : x:bigint * _output:sbyte -> sbyte + - static member witnesses.convert_witness : x:bigint * _output:uint16 -> uint16 + - static member witnesses.convert_witness : x:bigint * _output:uint32 -> uint32 + - static member witnesses.convert_witness : x:bigint * _output:uint64 -> uint64 diff --git a/tests/fsharp/typecheck/sigs/neg129.bsl b/tests/fsharp/typecheck/sigs/neg129.bsl index 8e34cc5331d..23bcf36815b 100644 --- a/tests/fsharp/typecheck/sigs/neg129.bsl +++ b/tests/fsharp/typecheck/sigs/neg129.bsl @@ -1,2 +1,21 @@ -neg129.fs(67,47,67,54): typecheck error FS0043: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member witnesses.convert_witness : x:bigint * _output:Complex -> Complex, static member witnesses.convert_witness : x:bigint * _output:bigint -> bigint, static member witnesses.convert_witness : x:bigint * _output:byte -> byte, static member witnesses.convert_witness : x:bigint * _output:decimal -> decimal, static member witnesses.convert_witness : x:bigint * _output:float -> float, static member witnesses.convert_witness : x:bigint * _output:float32 -> float32, static member witnesses.convert_witness : x:bigint * _output:int16 -> int16, static member witnesses.convert_witness : x:bigint * _output:int32 -> int, static member witnesses.convert_witness : x:bigint * _output:int64 -> int64, static member witnesses.convert_witness : x:bigint * _output:sbyte -> sbyte, static member witnesses.convert_witness : x:bigint * _output:uint16 -> uint16, static member witnesses.convert_witness : x:bigint * _output:uint32 -> uint32, static member witnesses.convert_witness : x:bigint * _output:uint64 -> uint64 +neg129.fs(67,47,67,54): typecheck error FS0043: A unique overload for method 'convert_witness' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known return type: ^output + +Known type parameters: < bigint , ^output > + +Candidates: + - static member witnesses.convert_witness : x:bigint * _output:Complex -> Complex + - static member witnesses.convert_witness : x:bigint * _output:bigint -> bigint + - static member witnesses.convert_witness : x:bigint * _output:byte -> byte + - static member witnesses.convert_witness : x:bigint * _output:decimal -> decimal + - static member witnesses.convert_witness : x:bigint * _output:float -> float + - static member witnesses.convert_witness : x:bigint * _output:float32 -> float32 + - static member witnesses.convert_witness : x:bigint * _output:int16 -> int16 + - static member witnesses.convert_witness : x:bigint * _output:int32 -> int + - static member witnesses.convert_witness : x:bigint * _output:int64 -> int64 + - static member witnesses.convert_witness : x:bigint * _output:sbyte -> sbyte + - static member witnesses.convert_witness : x:bigint * _output:uint16 -> uint16 + - static member witnesses.convert_witness : x:bigint * _output:uint32 -> uint32 + - static member witnesses.convert_witness : x:bigint * _output:uint64 -> uint64 diff --git a/tests/fsharp/typecheck/sigs/neg20.bsl b/tests/fsharp/typecheck/sigs/neg20.bsl index 7e95a4e098a..4227ab07193 100644 --- a/tests/fsharp/typecheck/sigs/neg20.bsl +++ b/tests/fsharp/typecheck/sigs/neg20.bsl @@ -159,17 +159,13 @@ neg20.fs(129,19,129,22): typecheck error FS0001: This expression was expected to but here has type 'string' -neg20.fs(131,5,131,24): typecheck error FS0041: No overloads match for method 'OM3'. The available overloads are shown below. -neg20.fs(131,5,131,24): typecheck error FS0041: Possible overload: 'static member C.OM3 : x:'b * y:int -> int'. Type constraint mismatch. The type - 'obj' -is not compatible with type - 'int' -. -neg20.fs(131,5,131,24): typecheck error FS0041: Possible overload: 'static member C.OM3 : x:'b * y:'b -> int'. Type constraint mismatch. The type - 'obj' -is not compatible with type - ''a' -. +neg20.fs(131,5,131,24): typecheck error FS0041: No overloads match for method 'OM3'. + +Known types of arguments: string * obj + +Available overloads: + - static member C.OM3 : x:'b * y:'b -> int // Argument 'y' doesn't match + - static member C.OM3 : x:'b * y:int -> int // Argument 'y' doesn't match neg20.fs(152,13,152,23): typecheck error FS0033: The type 'Test.BadNumberOfGenericParameters.C<_>' expects 1 type argument(s) but is given 2 @@ -199,17 +195,13 @@ 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 : y:'a * z:'b -> int'. -neg20.fs(182,14,182,31): typecheck error FS0041: No overloads match for method 'M'. The available overloads are shown below. -neg20.fs(182,14,182,31): typecheck error FS0041: Possible overload: 'static member C2.M : fmt:string * [] args:int [] -> string'. Type constraint mismatch. The type - 'obj' -is not compatible with type - 'int' -. -neg20.fs(182,14,182,31): typecheck error FS0041: Possible overload: 'static member C2.M : fmt:string * [] args:int [] -> string'. Type constraint mismatch. The type - 'obj' -is not compatible with type - 'int []' -. +neg20.fs(182,14,182,31): typecheck error FS0041: No overloads match for method 'M'. + +Known types of arguments: string * obj + +Available overloads: + - static member C2.M : fmt:string * [] args:int [] -> string // Argument 'args' doesn't match + - static member C2.M : fmt:string * [] args:int [] -> string // Argument at index 1 doesn't match neg20.fs(183,29,183,34): typecheck error FS0001: This expression was expected to have type 'int' @@ -256,17 +248,13 @@ neg20.fs(184,34,184,39): typecheck error FS0001: This expression was expected to but here has type 'obj' -neg20.fs(188,14,188,31): typecheck error FS0041: No overloads match for method 'M'. The available overloads are shown below. -neg20.fs(188,14,188,31): typecheck error FS0041: Possible overload: 'static member C3.M : fmt:string * [] args:string [] -> string'. Type constraint mismatch. The type - 'obj' -is not compatible with type - 'string' -. -neg20.fs(188,14,188,31): typecheck error FS0041: Possible overload: 'static member C3.M : fmt:string * [] args:string [] -> string'. Type constraint mismatch. The type - 'obj' -is not compatible with type - 'string []' -. +neg20.fs(188,14,188,31): typecheck error FS0041: No overloads match for method 'M'. + +Known types of arguments: string * obj + +Available overloads: + - static member C3.M : fmt:string * [] args:string [] -> string // Argument 'args' doesn't match + - static member C3.M : fmt:string * [] args:string [] -> string // Argument at index 1 doesn't match neg20.fs(189,29,189,34): typecheck error FS0001: This expression was expected to have type 'string' @@ -389,9 +377,22 @@ 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. Candidates: System.String(value: char []) : System.String, System.String(value: nativeptr) : System.String, System.String(value: nativeptr) : System.String +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. + +Known type of argument: 'a0 + +Candidates: + - System.String(value: char []) : System.String + - 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. + +Known type of argument: 'a0 -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. Candidates: System.Guid(b: byte []) : System.Guid, System.Guid(g: string) : System.Guid +Candidates: + - System.Guid(b: byte []) : System.Guid + - System.Guid(g: string) : System.Guid neg20.fs(355,19,355,38): typecheck error FS1124: Multiple types exist called 'OverloadedClassName', taking different numbers of generic parameters. Provide a type instantiation to disambiguate the type resolution, e.g. 'OverloadedClassName<_>'. diff --git a/tests/fsharp/typecheck/sigs/neg45.bsl b/tests/fsharp/typecheck/sigs/neg45.bsl index 272cca13a01..a7bf6e9454e 100644 --- a/tests/fsharp/typecheck/sigs/neg45.bsl +++ b/tests/fsharp/typecheck/sigs/neg45.bsl @@ -53,11 +53,29 @@ 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. Candidates: member D.M : 'a -> 'b, member D.M : 'a -> 'b +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(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. Candidates: member D.M : 'a -> 'b, member D.M : 'a -> 'b +Known type of argument: R1 -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. Candidates: member D.M : 'a -> 'b, member D.M : 'a -> 'b +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. + +Known type of argument: (R1 * R1) + +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. + +Known type of argument: int + +Candidates: + - member D.M : 'a -> 'b + - member D.M : 'a -> 'b neg45.fs(105,24,105,25): typecheck error FS0025: Incomplete pattern matches on this expression. For example, the value '0' may indicate a case not covered by the pattern(s). diff --git a/tests/fsharp/typecheck/sigs/neg61.bsl b/tests/fsharp/typecheck/sigs/neg61.bsl index b513bb46a9c..2811c3198e5 100644 --- a/tests/fsharp/typecheck/sigs/neg61.bsl +++ b/tests/fsharp/typecheck/sigs/neg61.bsl @@ -83,17 +83,13 @@ neg61.fs(156,21,156,22): typecheck error FS3147: This 'let' definition may not b neg61.fs(171,13,171,18): typecheck error FS3099: 'sumBy' is used with an incorrect number of arguments. This is a custom operation in this query or computation expression. Expected 1 argument(s), but given 0. -neg61.fs(174,22,174,23): typecheck error FS0041: No overloads match for method 'Source'. The available overloads are shown below. -neg61.fs(174,22,174,23): typecheck error FS0041: Possible overload: 'member Linq.QueryBuilder.Source : source:System.Linq.IQueryable<'T> -> Linq.QuerySource<'T,'Q>'. Type constraint mismatch. The type - 'int' -is not compatible with type - 'System.Linq.IQueryable<'a>' -. -neg61.fs(174,22,174,23): typecheck error FS0041: Possible overload: 'member Linq.QueryBuilder.Source : source:System.Collections.Generic.IEnumerable<'T> -> Linq.QuerySource<'T,System.Collections.IEnumerable>'. Type constraint mismatch. The type - 'int' -is not compatible with type - 'System.Collections.Generic.IEnumerable<'a>' -. +neg61.fs(174,22,174,23): typecheck error FS0041: No overloads match for method 'Source'. + +Known type of argument: int + +Available overloads: + - member Linq.QueryBuilder.Source : source:System.Collections.Generic.IEnumerable<'T> -> Linq.QuerySource<'T,System.Collections.IEnumerable> // Argument 'source' doesn't match + - member Linq.QueryBuilder.Source : source:System.Linq.IQueryable<'T> -> Linq.QuerySource<'T,'Q> // Argument 'source' doesn't match neg61.fs(180,19,180,31): typecheck error FS3153: Arguments to query operators may require parentheses, e.g. 'where (x > y)' or 'groupBy (x.Length / 10)' diff --git a/tests/fsharp/typecheck/sigs/neg_byref_13.bsl b/tests/fsharp/typecheck/sigs/neg_byref_13.bsl index 985177e9793..af1356864f5 100644 --- a/tests/fsharp/typecheck/sigs/neg_byref_13.bsl +++ b/tests/fsharp/typecheck/sigs/neg_byref_13.bsl @@ -5,4 +5,4 @@ neg_byref_13.fs(3,12,3,13): typecheck error FS3300: The parameter 'x' has an inv neg_byref_13.fs(3,5,3,10): typecheck error FS3301: The function or method has an invalid return type 'M5'. This is not permitted by the rules of Common IL. -neg_byref_13.fs(3,20,3,21): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. \ No newline at end of file +neg_byref_13.fs(3,20,3,21): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. diff --git a/tests/fsharp/update.base.line.with.actuals.fsx b/tests/fsharp/update.base.line.with.actuals.fsx deleted file mode 100644 index 8b391a2f459..00000000000 --- a/tests/fsharp/update.base.line.with.actuals.fsx +++ /dev/null @@ -1,27 +0,0 @@ -open System.IO - -// this script is usefull for tests using a .bsl file (baseline) containing expected compiler output -// which is matched against .vserr or .err file aside once the test has run -// the script replaces all the .bsl/.bslpp with either .err or .vserr - -let directories = - [ - "typecheck/sigs" - "typeProviders/negTests" - ] - |> List.map (fun d -> Path.Combine(__SOURCE_DIRECTORY__, d) |> DirectoryInfo) - -let extensionPatterns = ["*.err"; "*.vserr"] -for d in directories do - for p in extensionPatterns do - for errFile in d.GetFiles p do - let baseLineFile = FileInfo(Path.ChangeExtension(errFile.FullName, "bsl")) - let baseLineFilePreProcess = FileInfo(Path.ChangeExtension(errFile.FullName, "bslpp")) - - if File.ReadAllText(errFile.FullName) <> File.ReadAllText(baseLineFile.FullName) then - let expectedFile = - if baseLineFilePreProcess.Exists then baseLineFilePreProcess - else baseLineFile - - printfn "%s not matching, replacing with %s" expectedFile.FullName errFile.FullName - errFile.CopyTo(expectedFile.FullName, true) |> ignore diff --git a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/env.lst b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/env.lst index 53addca20e6..2e667f03622 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/env.lst +++ b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/env.lst @@ -16,7 +16,6 @@ SOURCE=E_RigidTypeAnnotation01.fsx SCFLAGS="--test:ErrorRanges --flaterrors" # E_RigidTypeAnnotation01.fsx SOURCE=E_RigidTypeAnnotation02.fsx SCFLAGS="--test:ErrorRanges --flaterrors" # E_RigidTypeAnnotation02.fsx - SOURCE=E_RigidTypeAnnotation03.fsx SCFLAGS="--test:ErrorRanges --flaterrors" # E_RigidTypeAnnotation03.fsx SOURCE=E_rigidtypeannotation02.fs COMPILE_ONLY=1 SCFLAGS="--test:ErrorRanges --flaterrors" # E_rigidtypeannotation02.fs SOURCE=E_rigidtypeannotation02b.fs COMPILE_ONLY=1 SCFLAGS="--test:ErrorRanges --flaterrors" # E_rigidtypeannotation02b.fs SOURCE=E_RigidTypeAnnotation03.fs SCFLAGS="--test:ErrorRanges --flaterrors" # E_RigidTypeAnnotation03.fs diff --git a/tests/fsharpqa/Source/Conformance/InferenceProcedures/TypeInference/E_TwoDifferentTypeVariablesGen00.fs b/tests/fsharpqa/Source/Conformance/InferenceProcedures/TypeInference/E_TwoDifferentTypeVariablesGen00.fs deleted file mode 100644 index a567c6e395d..00000000000 --- a/tests/fsharpqa/Source/Conformance/InferenceProcedures/TypeInference/E_TwoDifferentTypeVariablesGen00.fs +++ /dev/null @@ -1,120 +0,0 @@ -// #Regression #TypeInference -// Regression test for FSHARP1.0:4758 -// Type Inference -// Check Method Disambiguation When User Generic Variable Get Instantiated By Overload Resolution - -//This expression was expected to have type. ''a' .but here has type. ''b' -//This expression was expected to have type. 'int' .but here has type. ''b' -//A type parameter is missing a constraint 'when 'b :> C' -//Type constraint mismatch. The type.+''b'.+is not compatible with type -//No overloads match for method 'M'\. The available overloads are shown below\. - - - -//No overloads match for method 'M'\. The available overloads are shown below\. - - - -//This expression was expected to have type. ''a' .but here has type. ''b' -//This expression was expected to have type. ''b' .but here has type. ''a' -//This expression was expected to have type. 'int' .but here has type. ''b' -//A type parameter is missing a constraint 'when 'b :> C' -//Type constraint mismatch. The type.+''b'.+is not compatible with type -//No overloads match for method 'M'\. The available overloads are shown below\. - - - - -//No overloads match for method 'M'\. The available overloads are shown below\. - - - - -//This expression was expected to have type. ''a' .but here has type. ''b' -//This expression was expected to have type. 'int' .but here has type. ''b' -//A type parameter is missing a constraint 'when 'b :> C' -//Type constraint mismatch. The type.+''b'.+is not compatible with type -//No overloads match for method 'M'\. The available overloads are shown below\. - - - - -//No overloads match for method 'M'\. The available overloads are shown below\. - - - - -//A type parameter is missing a constraint 'when 'b :> C' -//Type constraint mismatch. The type.+''b'.+is not compatible with type - -// These different return types are used to determine which overload got chosen -type One = | One -type Two = | Two -type Three = | Three -type Four = | Four - -// An unsealed type -type C() = - member x.P = 1 - -type C1 = - static member M<'a>(x:'a,y:'a) = One - -type C2 = - static member M<'a,'b>(x:'a,y:'b) = Two - -type C3 = - static member M<'a>(x:'a,y:int) = Three - -type C4 = - static member M<'a>(x:'a,y:C) = Four - -type C12 = - static member M<'a>(x:'a,y:'a) = One - static member M<'a,'b>(x:'a,y:'b) = Two - -type C23 = - static member M<'a,'b>(x:'a,y:'b) = Two - static member M<'a>(x:'a,y:int) = Three - -type C13 = - static member M<'a>(x:'a,y:'a) = One - static member M<'a>(x:'a,y:int) = Three - -type C14 = - static member M<'a>(x:'a,y:'a) = One - static member M<'a>(x:'a,y:C) = Four - -type C24 = - static member M<'a,'b>(x:'a,y:'b) = Two - static member M<'a>(x:'a,y:C) = Four - -type C123 = - static member M<'a>(x:'a,y:'a) = One - static member M<'a,'b>(x:'a,y:'b) = Two - static member M<'a>(x:'a,y:int) = Three - -type C1234 = - static member M<'a>(x:'a,y:'a) = One - static member M<'a,'b>(x:'a,y:'b) = Two - static member M<'a>(x:'a,y:int) = Three - static member M<'a>(x:'a,y:C) = Four - -module M0 = - let gB1 <'a,'b> (x:'a) (y:'b) = C1.M(x,y) = One // expect: type error - let gB3 <'a,'b> (x:'a) (y:'b) = C3.M(x,y) = Three // expect: type error - let gB4 <'a,'b> (x:'a) (y:'b) = C4.M(x,y) = Four // expect: type error - let gB13 <'a,'b> (x:'a) (y:'b) = C13.M(x,y) // expect: ambiguity error (and note: both would instantiate 'a or 'b) - let gB14 <'a,'b> (x:'a) (y:'b) = C14.M(x,y) = Four // expect: ambiguity error - let gC1 <'a,'b> (x:'a) (y:'b) = C1.M<'a>(x,y) = One // expect: type error - let gC3 <'a,'b> (x:'a) (y:'b) = C3.M<'b>(x,y) = Three // expect: type error - let gC4 <'a,'b> (x:'a) (y:'b) = C4.M<'a>(x,y) = Four // expect: type error - let gC13 <'a,'b> (x:'a) (y:'b) = C13.M<'a>(x,y) // expect: ambiguity error - let gC14 <'a,'b> (x:'a) (y:'b) = C14.M<'a>(x,y) // expect: ambiguity error - let gD1 <'a,'b> (x:'a) (y:'b) = C1.M<_>(x,y) = One // expect: type error - let gD3 <'a,'b> (x:'a) (y:'b) = C3.M<_>(x,y) = Three // expect: type error - let gD4 <'a,'b> (x:'a) (y:'b) = C4.M<_>(x,y) = Four // expect: type error - let gD13 <'a,'b> (x:'a) (y:'b) = C13.M<_>(x,y) // expect: ambiguity error (and note: both would instantiate 'a or 'b) - let gD14 <'a,'b> (x:'a) (y:'b) = C14.M<_>(x,y) // expect: type error - let gD24 <'a,'b> (x:'a) (y:'b) = C24.M<_>(x,y) // expect: type error - diff --git a/tests/fsharpqa/Source/Conformance/InferenceProcedures/TypeInference/env.lst b/tests/fsharpqa/Source/Conformance/InferenceProcedures/TypeInference/env.lst index 72da539ce69..b11e575c473 100644 --- a/tests/fsharpqa/Source/Conformance/InferenceProcedures/TypeInference/env.lst +++ b/tests/fsharpqa/Source/Conformance/InferenceProcedures/TypeInference/env.lst @@ -16,7 +16,6 @@ SOURCE=OneTypeVariable03.fs SCFLAGS="-a --test:ErrorRanges --warnaserror+" # OneTypeVariable03.fs SOURCE=OneTypeVariable03rec.fs SCFLAGS="-a --test:ErrorRanges --warnaserror+" # OneTypeVariable03rec.fs - SOURCE=E_TwoDifferentTypeVariablesGen00.fs SCFLAGS="--test:ErrorRanges --flaterrors" # E_TwoDifferentTypeVariablesGen00.fs SOURCE=E_TwoDifferentTypeVariablesGen01rec.fs SCFLAGS="-a --test:ErrorRanges --flaterrors" # E_TwoDifferentTypeVariablesGen01rec.fs SOURCE=W_OneTypeVariable03.fs SCFLAGS="-a --test:ErrorRanges" # W_OneTypeVariable03.fs SOURCE=W_OneTypeVariable03rec.fs SCFLAGS="-a --test:ErrorRanges" # W_OneTypeVariable03rec.fs diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicOperators/E_LessThanDotOpenParen001.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicOperators/E_LessThanDotOpenParen001.fs index b7c161c5620..a8cf50ea24b 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicOperators/E_LessThanDotOpenParen001.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicOperators/E_LessThanDotOpenParen001.fs @@ -4,10 +4,7 @@ // want to verify we do not crash! //This construct causes code to be less generic than indicated by the type annotations\. The type variable 'S has been constrained to be type 'int' //This code is not sufficiently generic\. The type variable \^T when \^T : \(static member \( \+ \) : \^T \* \^T -> \^a\) could not be generalized because it would escape its scope -//No overloads match for method 'op_PlusPlusPlus'\. The available overloads are shown below\. -//No overloads match for method 'op_PlusPlusPlus'\. The available overloads are shown below\. -//No overloads match for method 'op_PlusPlusPlus'\. The available overloads are shown below\. - + type public TestType<'T,'S>() = member public s.Value with get() = Unchecked.defaultof<'T> diff --git a/tests/scripts/update-baselines.fsx b/tests/scripts/update-baselines.fsx index 389517a9c3e..06e9c13ef80 100644 --- a/tests/scripts/update-baselines.fsx +++ b/tests/scripts/update-baselines.fsx @@ -53,11 +53,11 @@ let fsdiff actualFile expectedFile = let directories = [ - "../fsharp/typecheck/sigs" - "../fsharp/typeProviders/negTests" - "../fsharpqa/Source" + "fsharp/typecheck/sigs" + "fsharp/typecheck/overloads" + "fsharpqa/Source" ] - |> List.map (fun d -> Path.Combine(__SOURCE_DIRECTORY__, d) |> DirectoryInfo) + |> List.map (fun d -> Path.Combine(__SOURCE_DIRECTORY__, ".." , d) |> DirectoryInfo) let extensionPatterns = ["*.bsl"; "*.vsbsl"; "*.il.bsl"] for d in directories do diff --git a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ErrorList.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ErrorList.fs index be8401a6135..a308bec56aa 100644 --- a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ErrorList.fs +++ b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ErrorList.fs @@ -57,6 +57,23 @@ type UsingMSBuild() as this = let ok = errors |> List.exists (fun err -> err.Message = text) Assert.IsTrue(ok, sprintf "Error list should contain '%s' message" text) + let assertExpectedErrorMessages expected (actual: list) = + let normalizeCR input = System.Text.RegularExpressions.Regex.Replace(input, @"\r\n|\n\r|\n|\r", "\r\n") + let actual = + actual + |> Seq.map (fun e -> e.Message) + |> String.concat Environment.NewLine + |> normalizeCR + let expected = expected |> String.concat Environment.NewLine |> normalizeCR + + let message = + sprintf """ +=[ expected ]============ +%s +=[ actual ]============== +%s +=========================""" expected actual + Assert.AreEqual(expected, actual, message) //verify the error list Count member private this.VerifyErrorListCountAtOpenProject(fileContents : string, num : int) = @@ -190,18 +207,16 @@ let g (t : T) = t.Count() X(1.0) """ - let expectedMessages = - [ "Possible overload: 'new : bool -> X'." - "Possible overload: 'new : int -> X'." ] + let expectedMessages = [ """No overloads match for method 'X'. - CheckErrorList content <| - fun errors -> - Assert.AreEqual(3, List.length errors) - assertContains errors "No overloads match for method 'X'. The available overloads are shown below." - for expected in expectedMessages do - errors - |> List.exists (fun e -> e.Message.StartsWith expected) - |> Assert.IsTrue +Known type of argument: float + +Available overloads: + - new : bool -> X // Argument at index 1 doesn't match + - new : int -> X // Argument at index 1 doesn't match""" ] + + CheckErrorList content (assertExpectedErrorMessages expectedMessages) + [] member public this.``Query.InvalidJoinRelation.GroupJoin``() = @@ -277,10 +292,16 @@ let x = let content = """ System.Console.WriteLine(null) """ - CheckErrorList content <| - fun errors -> - Assert.AreEqual(1, List.length errors) - assertContains errors "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. Candidates: System.Console.WriteLine(buffer: char []) : unit, System.Console.WriteLine(format: string, [] arg: obj []) : unit, System.Console.WriteLine(value: obj) : unit, System.Console.WriteLine(value: string) : unit" + let expectedMessages = [ """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: 'a0 when 'a0 : null + +Candidates: + - System.Console.WriteLine(buffer: char []) : unit + - System.Console.WriteLine(format: string, [] arg: obj []) : unit + - System.Console.WriteLine(value: obj) : unit + - System.Console.WriteLine(value: string) : unit""" ] + CheckErrorList content (assertExpectedErrorMessages expectedMessages) [] member public this.``InvalidMethodOverload2``() = @@ -294,10 +315,14 @@ type B() = let b = B() b.Do(1, 1) """ - CheckErrorList content <| - fun errors -> - Assert.AreEqual(1, List.length errors) - assertContains errors "A unique overload for method 'Do' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: member A.Do : a:int * b:'T -> unit, member A.Do : a:int * b:int -> unit" + let expectedMessages = [ """A unique overload for method 'Do' 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 + +Candidates: + - member A.Do : a:int * b:'T -> unit + - member A.Do : a:int * b:int -> unit""" ] + CheckErrorList content (assertExpectedErrorMessages expectedMessages) [] member public this.``NoErrorInErrList``() =