Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

task defined as top-level static value doesn't get statically compiled #12038

Open
dsyme opened this issue Aug 25, 2021 · 0 comments
Open

task defined as top-level static value doesn't get statically compiled #12038

dsyme opened this issue Aug 25, 2021 · 0 comments
Assignees
Labels
Area-Compiler-StateMachines Sequence, list, task and other state machine compilation Bug Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code.
Milestone

Comments

@dsyme
Copy link
Contributor

dsyme commented Aug 25, 2021

Most the time tasks are defined in functions, e.g.

let f() = task { return 1 }

That's fine, however if you define a task as a top-level value (e.g. in F# Interactive) you get a warning that a dynamic task implementation is used:

> task { return 1 };;

  task { return 1 };;
  ^^^^

stdin(2,1): warning FS3511: This state machine is not statically compilable. A resumable code invocation at '(2,0--2,4)' 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.

It's not a super-critical show-stopping bug because

  1. the task still runs correctly
  2. it's rare to define tasks like this in project code (however it may happen a lot in notebooks)
  3. tasks at the top-level like this are never perf-critical
@dsyme dsyme changed the title task defined as top-level static value doesn't ger statically compiled task defined as top-level static value doesn't get statically compiled Aug 25, 2021
@dsyme dsyme added Bug Area-Compiler Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code. labels Aug 25, 2021
@dsyme dsyme mentioned this issue Sep 7, 2021
15 tasks
@dsyme dsyme added Area-Compiler-StateMachines Sequence, list, task and other state machine compilation and removed Area-Compiler labels Mar 31, 2022
@dsyme dsyme self-assigned this Aug 16, 2022
@vzarytovskii vzarytovskii added this to the Backlog milestone Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compiler-StateMachines Sequence, list, task and other state machine compilation Bug Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code.
Projects
Status: New
Development

No branches or pull requests

2 participants