dotnet / fsharp

The F# compiler, F# core library, F# language service, and F# tooling integration for Visual Studio
https://dotnet.microsoft.com/languages/fsharp
MIT License
3.93k stars 786 forks source link

Include info about language version into compiled metadata #15467

Open T-Gro opened 1 year ago

T-Gro commented 1 year ago

When an older compiler encounters a .dll built with a newer one, it can happen that newly added language constructs (not understood by the old compiler) are represented in binary-pickle-format in a way the old compiler cannot understand.

As of now, this throws a very generic message, not really giving a sensible action to the user. (the most often applicable one would be "Upgrade your tooling", but the message does not say that).

If each .dll would contain info about the language version used to build it, the error message could be more specific in what's needed in order to make it work.

We should also keep in mind that not every user is capable of updating to latest released versions immediately (e.g. in banking the approval chains take a long time), therefore saying "Tooling must support F#7 or higher" is easier to action then a generic "Update to latest".

abonie commented 2 months ago

The language version info should come from enabled features that impact the pickled data format