Repository navigation
Conversation
…suspending handlers A try/with handler or try/finally compensation that suspends is moved out of its exception-handling region. The rewrite recorded the body's outcome in a Choice<'T, exn>, allocated on every run including success, and rethrew a pending exception with a plain throw, which reset its stack trace. This affected a suspending finally (including use of an IAsyncDisposable), reraise () after a suspension, and an unmatched handler pattern. * Record the body's result and the pending exception in two locals; the exception stays null when the body succeeds, so nothing is allocated. * Rethrow with ExceptionDispatchInfo.Capture(exn).Throw(). The helper moves from LowerAsyncSeq into RuntimeAsyncExceptionRewrite and is shared; the rewrite now receives the import map. * Tests for stack traces and success-path allocation; update the IL fragments of the composed CE test and pin the rethrow. * Docs and release notes.
FSharp.Core adds repeatable ConditionalAutoOpen(path, condition) and RetractExistingAutoopen(path, condition) assembly attributes. A condition matches one complete compiler CLI token exactly (preview language only). Selection runs once before type checking and passes the existing pipeline an ordinary list of assembly auto-open paths. Retraction affects only assembly-level AutoOpen entries. The compiler accepts opaque --features:<string> options. FSharp.Build passes each MSBuild Features item as --features:<item> and invalidates incremental compilation when Features or OtherFlags change. FSharp.Core (net) adds Microsoft.FSharp.Control.RuntimeAsync TaskBuilder, TaskSeqBuilder and TaskExpressions.task/taskSeq. They are auto-opened for --features:runtime-async=on and need .NET 11 or later at run time. Builder behavior tests move to FSharp.Core.UnitTests and use the shipped builders; the test-side builder copies are removed. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
- Decode conditional assembly attributes in CompilerImports and the in-memory reference reader through one name pattern; leave the attribute helpers and well-known flags unchanged. - Ignore malformed conditional attributes like AutoOpen(null); remove diagnostic 3926. - Read the FSI session config from TcImports so RequireReferences keeps its signature. - Cache only Features for incremental builds, hashed case-sensitively. - Drop runtimeasync.fsi; the public surface is unchanged. - Keep moved builder tests close to their originals and drop duplicate, qualification-only and unrelated test changes. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…location) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
✅ Release notes checked
|
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…toOpen tests on .NET only Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Experiment for fsharp/fslang-suggestions#1473: FSharp.Core ships a runtime-async
task/taskSeqthat a project opts into through an ordinary compiler flag, without renamingtaskor editing any source file. Includes #20870.Attributes (repeatable, assembly-level only, preview language)
[<assembly: ConditionalAutoOpen("Some.Module", "--features:runtime-async=on")>]opens the path when the condition is present.[<assembly: RetractExistingAutoopen("Some.Module", "<condition>")>]removes an ordinary assemblyAutoOpenof that path. Module-level[<AutoOpen>], explicitopenand qualified access are unaffected.--features:other=1,runtime-async=ondoes not match--features:runtime-async=on.Selection runs once, before type checking; the existing auto-open pipeline still receives a plain path list:
CLI flag / project property (same shape as C#)
fsc --features:runtime-async=on, mirroringcsc /features:runtime-async=on.<Features>$(Features);runtime-async=on</Features>, the same MSBuild property C# uses, so oneDirectory.Build.propsline covers mixed C#/F# solutions. Each item becomes one--features:option; changingFeaturesinvalidates incremental compilation.Conditional shadowing
Microsoft.FSharp.Control.RuntimeAsync.TaskExpressions(task,taskSeq; .NET 11+) and declaresConditionalAutoOpen("Microsoft.FSharp.Control.RuntimeAsync.TaskExpressions", "--features:runtime-async=on")after the existingMicrosoft.FSharp.Controlauto-open.taskby ordinary name resolution; without it, nothing changes. The classicTaskBuilderis not retracted:backgroundTask,open Microsoft.FSharp.Control.TaskBuilderModuleand fully qualified names still reach it.Checklist