Граф коммитов

7723 Коммитов

Автор SHA1 Сообщение Дата
Gauthier Segay acd7cfd251
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<Expr> * 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
2020-02-18 16:40:22 -08:00
Kevin Ransom (msft) e95cdd16ea
Merge pull request #8572 from dotnet/darc-master-8c0009a0-7f5d-49fe-b1e7-af16a5498bf1
[master] Update dependencies from dotnet/arcade
2020-02-13 21:44:32 -08:00
Will Smith 53f29118b8
Optimized find all references and reduced memory usage in VS (#8339)
* Added ItemKey.fsi/fsi. Added blank SemanticClassification.fs/fsi.

* Raise disposed exception

* Re-worked semantic classification. Renamed ItemKeyReader to ItemKeyStore. Exposing ItemKeyStore/Builder

* Fixing build

* Storing semantic classification

* Caching semantic classification

* Wiring it up

* Need to fix lexing

* Added experimental lexing API to handle find all refs syntactic classification from allocating a lot

* Added System.Memory

* Using Span to check equality without allocating

* Allocate less

* Fixing build. Reducing more allocations and not using lex filter on lexing tokens.

* Remove langversion

* Fixed record find all refs

* Fixing test

* Partial match for active pattern

* Feedback changes

* Added comment on TcResolutionsExtensions

* Creating view accessor when needed in ItemKey. Fixed UnionCase find all refs.

* Added comment on warning

* Added Range.comparer. Moving opens to top of file

* More feedback changes

* Added comment on sliding expiration
2020-02-13 16:43:09 -08:00
dotnet-maestro[bot] 139ad47411 Update dependencies from https://github.com/dotnet/arcade build 20200213.5
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.20113.5
2020-02-14 00:13:37 +00:00
Kevin Ransom (msft) 9b29c43085
Merge pull request #8561 from dotnet/darc-master-19e00c9d-f7b6-44cb-84df-cc43be15f720
[master] Update dependencies from dotnet/arcade
2020-02-13 10:36:23 -08:00
dotnet-maestro[bot] 4ac660f689 Update dependencies from https://github.com/dotnet/arcade build 20200212.6
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.20112.6
2020-02-13 13:19:53 +00:00
Dave Shaw 8de5b79548
Make Log*FunctionId types internal (#8556)
As per the FIXME comments, the types can be internal now that #4821 has
been fixed.
2020-02-12 15:18:01 -08:00
Kevin Ransom (msft) d42edc99bb
Add probing for netcoreapp3.1 tools and tps (#8543) 2020-02-11 09:35:44 -08:00
Kevin Ransom (msft) 02311b526c
Remove pointless nuspec (#8542) 2020-02-11 07:51:38 -08:00
Brett V. Forsgren fdbb3d885a
re-enable end-to-end type provider tests (#8539) 2020-02-10 19:54:29 -08:00
Kevin Ransom (msft) f686f4065a
Merge pull request #8535 from KevinRansom/usedotnettypes
Use IEnumerable<string> rather than list string
2020-02-10 18:50:34 -08:00
Kevin Ransom dd57d503e6 Use IEnumerable<string> rather than list string 2020-02-10 15:45:56 -08:00
Kevin Ransom (msft) 134962b043
Even more refactoring of DependencyManagerIntegration (#8518)
* add references

* Add references, also support legacy Package Manager APIs, Change scope of PM APIs

* Return values from reflection

* return values

* Rename FSharp.DependencyManager.Nuget

* sigfile
2020-02-10 13:27:41 -08:00
Saul Rennison eee5768394
Improve fsi printing/%A formatting (#7710)
* Improved printing

* Fix SynAccess ToString

* Fixup tests

* Disable tests that depend on updated fsharp.core

Co-authored-by: Kevin Ransom (msft) <codecutter.fsharp@hotmail.com>
2020-02-08 09:11:35 -08:00
Kevin Ransom (msft) 5d28cc505d
Merge pull request #8498 from KevinRansom/michalmocarski
Michal mocarski's fix
2020-02-07 19:13:14 -08:00
Kevin Ransom 54ff908aab Put back proper match 2020-02-07 16:39:11 -08:00
Kevin Ransom a2f99e59cc Feedback 2020-02-07 14:51:16 -08:00
Kevin Ransom (msft) 95d8977703
Phillips original PR --- Add type name to error, if it's known, to undefined name error (#8346)
* Add type name to error, if it's known, to undefined name error

* generic args too

* Update tests round 1

* update the tests that aren't those dang baselines that I hate

* some fsharpqa updates I guess

* More test updates

* updates lol

* more updates

* more fsharpqa updates

* More fsharpqa updates

* hope this 'n works

* jojo

* fsharpqa tests

* fsharpqa tests

* Update FixedIndexSliceTests.fs

Co-authored-by: Phillip Carter <pcarter@fastmail.com>
2020-02-07 11:01:02 -08:00
Don Syme b814ad9ab8
cleanup and pre-prep for https://github.com/dotnet/fsharp/pull/6810 (#8503) 2020-02-07 17:06:18 +00:00
Kevin Ransom 1b6aecfd30 FSharpSuite tests 2020-02-06 23:00:16 -08:00
Brett V. Forsgren c648e2af25
skip flaky tests in official builds (#8497)
* skip flaky tests in official builds

* also filter tests on linux
2020-02-06 18:01:25 -08:00
Kevin Ransom 29a8d0e24e A bunch of tests were incorrect 2020-02-06 17:40:54 -08:00
Kevin Ransom 8fd8da2424 Handle git beta indicators 2020-02-06 17:18:10 -08:00
Kevin Ransom 0d5618191f Remove test 2020-02-06 15:04:56 -08:00
michalmocarski 423d1d0205 Product version logic and checks are overzealous 2020-02-06 15:04:26 -08:00
michalmocarski 275aa94738 Remove redundant takeWhile
It cancels significant version numbers if they're preceeded by zeros and can lead to inconsistency between product version and file version.
2020-02-06 15:02:39 -08:00
Chet Husk 19fbfc41ab
Update fallback .Net Core TFM for script resolution to netcoreapp3.1 (#8492)
since 3.1 is the LTS this seems like a fine default to me.
2020-02-06 00:39:19 -08:00
Don Syme 0f2bc13a16
[RFC FS-1075] Improve interop to C# nullable-typed optionals (#7989)
* add test cases we need to make work

* cleanup method call argument processing

* update for new cases

* update tests

* compat Nullable allowed

* reduce diff

* fix mistake with byrefs

* update error message

* trigger CI

* add version tests

* mnimize diff

* mnimize diff

* remove assert

* minor updates for code review

* fix overloading change of behaviour

Co-authored-by: Phillip Carter <pcarter@fastmail.com>
2020-02-05 15:35:15 -08:00
Kevin Ransom (msft) 3af8959b6f
Remove AppHostRuntimeIdentifier from DM script (#8471)
* Remove AppHostRuntimeIdentifier from DM script

* temp
2020-02-05 15:11:34 -08:00
Kevin Ransom (msft) d7018737ca
Merge pull request #8479 from dotnet/feature/and-bang
Merge feature/and-bang to master
2020-02-05 12:50:01 -08:00
Kevin Ransom (msft) 49fd9d7e72
Merge pull request #8469 from dotnet/merges/master-to-feature/and-bang
Merge master to feature/and-bang
2020-02-05 11:27:51 -08:00
Chet Husk ff20f70d4d
cross-platform wrapper around memory-backed memorymappedfile creation (#8403)
* cross-platform wrapper around memory-backed memorymappedfile creation

* reenable FCS tests on non-windows platforms

* publish test results on non-windows platforms

* ensure correct .net sdk versions are installed regardless of VM image preloads

* simple workaround for missing mscorlib versions to TFMs

* publish per-framework xml results and report them in AZDO

* rework mono fixes to use ByteArrayMemory directly

* move runningOnMono call to bytes.fs and patch up callsites

* revert to build-only on mono-containing platforms

another MR will be required to fix the underlying logic before those can be changed to run tests again

* trigger ci
2020-02-05 07:44:55 -08:00
Kevin Ransom (msft) e71fd0365e
Update dependency notification (#8455)
* Rework dependency notifications

* rework Dependency events
2020-02-04 16:36:55 -08:00
Kevin Ransom (msft) 3cefbba59d
Reattach comment (#8445) 2020-02-03 14:26:28 -08:00
Kevin Ransom (msft) 3b9f82baed
Enable language preview option for fsi in the ide (#8443) 2020-02-03 12:15:24 -08:00
Kevin Ransom (msft) 83f6808c6a
Merge pull request #8452 from dotnet/merges/master-to-feature/and-bang
Merge master to feature/and-bang
2020-02-03 12:13:32 -08:00
Don Syme 7f14ea0d7f
add more tests for SRTP variations (#8435)
* add more tests for SRTP variations

* teak names of tests

* fix baseline
2020-02-03 17:13:40 +00:00
Kevin Ransom (msft) aefbb45f48
Merge pull request #8441 from dotnet/merges/master-to-feature/and-bang
Merge master to feature/and-bang
2020-02-01 09:53:17 -08:00
Kevin Ransom (msft) de0637f902
Refactor dependency manager for notebooks and C# (#8415)
* Refactor dependency manager

* name change
2020-01-31 13:30:20 -08:00
Kevin Ransom (msft) 792f15bc68
Merge pull request #8430 from dotnet/merges/master-to-feature/and-bang
Merge master to feature/and-bang
2020-01-31 11:22:57 -08:00
Kevin Ransom (msft) 007205aad6
Merge pull request #8422 from dotnet/merges/master-to-feature/and-bang
Merge master to feature/and-bang
2020-01-30 23:40:38 -08:00
Kevin Ransom (msft) 3016aeaffb
Remove add include event notification (#8416) 2020-01-30 22:03:00 -08:00
Brett V. Forsgren fe29cc4115
always run mac tests on latest os (#8405) 2020-01-31 09:31:42 +09:00
Kevin Ransom (msft) c2e19893b1
Merge pull request #8411 from dotnet/merges/master-to-feature/and-bang
Merge master to feature/and-bang
2020-01-30 16:27:05 -08:00
Kevin Ransom (msft) 59d61e52fb
Merge pull request #8399 from dotnet/merges/master-to-feature/and-bang
Merge master to feature/and-bang
2020-01-30 11:09:34 -08:00
Kevin Ransom (msft) b32124df9e
Remove unnecessary diagnostics (#8401) 2020-01-30 10:16:22 -08:00
Kevin Ransom (msft) c8517d9b7c
Remove assembly load notification (#8393)
* Remove assembly addednotification from fsievaluation session

* Remove AssemblyReferenceAdded notification

* Update FSharpScriptTests.fs
2020-01-29 18:02:38 -08:00
Kevin Ransom (msft) 23650e3ffc
Merge pull request #8390 from dotnet/merges/master-to-feature/and-bang
Merge master to feature/and-bang
2020-01-28 18:17:52 -08:00
Kevin Ransom (msft) 42211a4cc2
Merge pull request #8384 from dotnet/merges/master-to-feature/and-bang
Merge master to feature/and-bang
2020-01-28 15:02:00 -08:00
Kevin Ransom (msft) 9eeaa25ae7
Do it properly (#8373) 2020-01-28 13:47:22 -08:00