VisualFSharp v4.5 Release Notes
-
π We introduced the F# language version 4.5 with this release. This also corresponds with the new 4.5.x family of FSharp.Core (the F# core library). You can read the specs for each of these changes in the F# RFC repository. There are also many improvements to F# tools for Visual Studio with this release.
π Releases
- β‘οΈ Visual Studio 2017 update 15.8
- .NET Core SDK version 2.1.400 or higher
Language features
- π Support for
voidptr
- π
NativePtr.ofVoidPtr
andNativePtr.toVoidPtr
support - π New types:
inref<'T>
,outref<'T>
to represent read-only and write-onlybyref
s - π Support for
IsByRefLike
structs - π Support for
IsReadOnly
structs - π Full support for production and consumption of
byref
returns - π Support for extension methods for
byref
/inref
/outref
- π Support for
match!
in computation expressions - π Relaxed upcast requirements for
yield
in sequence, list, and array expressions - π Relaxed indentation requirements for list and array expressions
- Enumeration cases emitted as public
- π Various bug fixes with
byref
programming
FSharp.Core features
- π Version aligned to 4.5.x for the NuGet package and 4.5.0.0 for the binary
- π Improved strack traces for
async { }
so that user code can now be seen - π Support for
ValueOption<'T>
- π Support for
TryGetValue
on Map
Compiler improvements
π Improvements to the F# compiler in addition to the previously-mentioned language features are in F# 4.5. These include:
- βͺ Restored ability to inherit from
FSharpFunc
- β Removed ~2.2% of all allocations in the F# compiler
- π F# reference normalization support for user control of transitive assembly references written to an output file
- β Respecting
WarningsNotAsErrors
- Error message improvement when branches of a pattern match do not return the same type
- Respecting
#nowarn "2003"
- π Other smaller performance improvements and many bug fixes
Tooling improvements
π Significant improvements in the F# tools, such as performance enhancements and some new editor features are included this release. As always, with a large number of contributions from the F# open source community. Here are the highlights:
- π We improved IntelliSense performance for .NET SDK-style projects of all forms, including those that use multi-targeting.
- π A community-driven effort to analyze and improve IntelliSense performance for very large files was contributed by Vasily Kirichenko, Steffen Forkmann, and Gauthier Segay. IntelliSense in very large files (10k+ lines of code) is roughly twice as fast now.
- π The warning for an outdated FSharp.Core (despite the package being installed) is no longer present in .NET SDK-style projects.
- π The description tooltip that displays XML documentation for a member after . in IntelliSense no longer times out after 10 seconds.
- π A bug where you could not set breakpoints in object constructor arguments has been fixed.
- π A bug where a renamed symbol would be duplicated when it is a generic parameter has been fixed.
- π¦ Templates for .NET Framework (classic F# templates) now consume FSharp.Core from a NuGet package, to align with .NET SDK F# templates.
- Automatic, transactional brace completion is now available for
()
,[]
,{}
,[||]
, and[<>]
brace pairs. We did this work in collaboration with Gibran Rosa. - You can now go to definition with Ctrl + Click on an F# symbol. The settings for this gesture are also respected in the Tools > Options window.
- π The IntelliSense performance UI has been modified to allow configuration of stale typecheck information for various IDE features. Explanations for each option are now present in tooltips for the settings.
- Brace match highlighting now correctly highlights braces, completed in collaboration with Vasily Kirichenko.
- Go to definition now navigates correctly when a type is defined recursively, contributed by Vasily Kirichenko.
- π A bug where an auto-imported namespace wasn't opened when the top of a file was empty has been fixed by Vasily Kirichenko.
- π¨ A bug where
printf
specifiers that contained dots were miscolored has been fixed by Vasily Kirichenko. - π A bug where all opens were considered unused inside of a recursive module has been fixed by Vasily Kirichenko.
- Autocompletion for attributes now only suggests options that are actually attributes, contributed by Vasily Kirichenko.
- Signature Help tooltips are now generated for Type Provider static parameters at the constructor call site, contributed byVasily Kirichenko.
- π A bug where value types used as units of measure were colored as reference types has been fixed by Vasily Kirichenko.
- π A bug where semantic colorization could disappear for some files while scrolling has been fixed by Vasily Kirichenko. There is now an experimental CodeLens implementation, contributed by Victor Peter Rouven MΓΌller. You can turn it on in Options > Text Editor > F# > Code Lens.
- π A bug where the F# compiler service would incorrectly elide the module names in XML documentation has been fixed by Sebastian Urban.
- Code that uses
Dictionary
withContainsKey
and subsequentItem
calls has been changed to useTryGetValue
, by Eugene Auduchinok. - Jakob Majoka also contributed in the process of consuming a different API for FSharpToolTip.
Infrastructure, Packaging, and Open Source Improvements
We made the following enhancements to infrastructure, packaging, and our open source contribution experience:
- The F# compiler distributed with Visual Studio no longer installs as a singleton in the F# Compiler SDK location. It is now fully side-by-side with Visual Studio, meaning that side-by-side installations of Visual Studio wil finally have truly side-by-side F# tooling and language experiences.
- π¦ The FSharp.Core NuGet package is now signed.
- π² ETW logging has been added to the F# tools and compiler.
- The very large
control.fs
/control.fsi
files in FSharp.Core have been split intoasync.fs
/async.fsi
,event.fs
/event.fsi
,eventmodule.fs
/eventmodule.fsi
,mailbox.fs
/mailbox.fsi
, andobservable.fs
/observable.fsi
. - π We added .NET SDK-style versions of our project performance stress test artifacts.
- π¦ We removed Newtonsoft.json from our codebase, and you now have one less package downloaded for OSS contributors.
- π We now use the latest versions of System.Collections.Immutable and System.Reflection.Metadata.