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.87k stars 779 forks source link

FSharp.Core 6.0.2 and 6.0.3 creates a warning for uint32 with measures #13117

Closed bratfizyk closed 2 years ago

bratfizyk commented 2 years ago

Please provide a succinct description of the issue.

Updating FSharp.Core from 6.0.1 to 6.0.2 or 6.0.3 generates a warning that doesn't exist in 6.0.1.

Provide the steps required to reproduce the problem:

  1. Create an F# empty console project.
  2. In fsproj file specify FSharp.Core version to 6.0.1 (<PackageReference Update="FSharp.Core" Version="6.0.1" />).
  3. In Program.fs add a line: let measureUint = LanguagePrimitives.UInt32WithMeasure<1> 54u
  4. Run the project (dotnet run). No warning.
  5. Change FSharp.Core version to 6.0.2 or 6.0.3.
  6. Run the project (dotnet run) once again. There's a warning: FS0057: Experimental library feature, requires '--langversion:preview'. This warning can be disabled using '--nowarn:57' or '#nowarn "57"'.

Provide any related information:

My question:

Why does this warning not occur for 6.0.1?

dsyme commented 2 years ago

These experimental attributes should indeed have been removed as part of the F# 6.0 release process.

dsyme commented 2 years ago

Why does this warning not occur for 6.0.1?

I don't know, sorry - did you check if the attributes are present in that FSharp.Core?

bratfizyk commented 2 years ago

Hi Don! Thanks for the response.

Why does this warning not occur for 6.0.1?

I don't know, sorry - did you check if the attributes are present in that FSharp.Core?

No problem at all. I've briefly reviewed history and these tags were added in September last year. My best guess is that FSharp.Core 6.0.1 had been created using an earlier version.

Thanks for fixing this. For now I'll add a #nowarn to my project and once there is a new version of FSharp.Core I'll consider a migration.