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 781 forks source link

warning FS0057: Experimental library feature for use of CompilerServices.StateMachineHelpers #13780

Closed abelbraaksma closed 2 years ago

abelbraaksma commented 2 years ago

Basically, just using anything from FSharp.Core.CompilerServices.StateMachineHelpers throws the FS0057 warning.

I noticed these while experimenting with the taskSeq code from the F# perf tests, i.e.: https://github.com/dotnet/fsharp/blob/d5312aae8aad650f0043f055bb14c3aa8117e12e/tests/benchmarks/CompiledCodeBenchmarks/TaskPerf/TaskPerf/taskSeq.fs

Repro steps

open FSharp.Core.CompilerServices.StateMachineHelpers

// or use something from it:
member inline _.Zero() : TaskSeqCode<'T> = ResumableCode.Zero()

Expected behavior

No warning, as this was introduced for F# 6 as part of task and that RFC has introduced new language features, among which resumable code.

Actual behavior

Warnings are shown when compiling:

warning FS0057: Experimental library feature, requires '--langversion:preview'. This warning can be disabled using '--nowarn:57' or '#nowarn "57"'.

Interestingly, the code compiles just fine. Which suggests to me that indeed, this library feature is part of F# 6 and the warning saying to use --langversion:preview is not needed.

I may be wrong on that, but so far the code performs normally.

KevinRansom commented 2 years ago

@abelbraaksma ... it turns out that we left the experimental attributes in F# Core. Coincidentally I removed them just last week, so can you try to repro with a build from Main.

https://github.com/dotnet/fsharp/pull/13688/files#diff-0570f54b81d22a577cd83100ba455f5dd8ccbf39b50497b6af94d84b4236b2d5R17

vzarytovskii commented 2 years ago

That got fixed