In the latest SDK (6.0.400), I'm receiving a FS3511 warning with for...in loops in task when building for Release. This warning wasn't present in previous SDKs (e.g. 6.0.302)
Repro steps
- In a new console application, replace Program.fs with the following code:
let v =
task {
for value in [1;2;3] do
printfn $"{value}"
}
printfn "Hello from F#"
dotnet build -c Release
Can repro with https://github.com/sasmithjr/FS3511-repro-for..in
Expected behavior
Builds without warning
Actual behavior
Receive the warning warning FS3511: This state machine is not statically compilable. A resumable code invocation at '(2,4--2,8)' could not be reduced. An alternative dynamic implementation will be used, which may be slower. Consider adjusting your code to ensure this state machine is statically compilable, or else suppress this warning.
Known workarounds
Suppressing the warning or using collection iter functions.
Related information
- Operating system: macOS 12.5 on an M1 MBP
- .NET Runtime kind (.NET Core, .NET Framework, Mono) .NET Core, SDK 6.0.400
Thanks for the help, and please let me know if I can provide anymore info.
In the latest SDK (6.0.400), I'm receiving a FS3511 warning with
for...inloops intaskwhen building for Release. This warning wasn't present in previous SDKs (e.g. 6.0.302)Repro steps
dotnet build -c ReleaseCan repro with https://github.com/sasmithjr/FS3511-repro-for..in
Expected behavior
Builds without warning
Actual behavior
Receive the warning
warning FS3511: This state machine is not statically compilable. A resumable code invocation at '(2,4--2,8)' could not be reduced. An alternative dynamic implementation will be used, which may be slower. Consider adjusting your code to ensure this state machine is statically compilable, or else suppress this warning.Known workarounds
Suppressing the warning or using collection
iterfunctions.Related information
Thanks for the help, and please let me know if I can provide anymore info.