From ec71b4db28de68848f200393f7657e9e80f2e4f6 Mon Sep 17 00:00:00 2001 From: ncave <777696+ncave@users.noreply.github.com> Date: Fri, 27 Sep 2024 11:07:19 -0700 Subject: [PATCH] [TS] Fixed #3864 --- src/Fable.Cli/CHANGELOG.md | 1 + src/Fable.Transforms/Fable2Babel.fs | 1 + src/fable-library-ts/AsyncBuilder.ts | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Fable.Cli/CHANGELOG.md b/src/Fable.Cli/CHANGELOG.md index 9f8d4e6ed9..5722986c2b 100644 --- a/src/Fable.Cli/CHANGELOG.md +++ b/src/Fable.Cli/CHANGELOG.md @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * [GH-3900](https://github.com/fable-compiler/Fable/pull/3900) [Python] Fix nuget packages with hypens in their names (by @MangelMaxime) * [Rust] Uncurry field types for object expressions (by @ncave) +* [TS] Fixed missing Async type signature (#3864) (by @MangelMaxime) ## 4.21.0 - 2024-09-19 diff --git a/src/Fable.Transforms/Fable2Babel.fs b/src/Fable.Transforms/Fable2Babel.fs index eb3743c2ce..5eda90e026 100644 --- a/src/Fable.Transforms/Fable2Babel.fs +++ b/src/Fable.Transforms/Fable2Babel.fs @@ -757,6 +757,7 @@ module Annotation = // Move this to Replacements.tryEntity? let tryNativeOrFableLibraryInterface com ctx genArgs (ent: Fable.Entity) = match ent.FullName with + | Types.fsharpAsyncGeneric -> makeFableLibImportTypeAnnotation com ctx genArgs "AsyncBuilder" "IAsync" |> Some | _ when not ent.IsInterface -> None | Types.icollection -> makeNativeTypeAnnotation com ctx genArgs "Iterable" |> Some // -> makeFableLibImportTypeAnnotation com ctx [Fable.Any] "Util" "ICollection" diff --git a/src/fable-library-ts/AsyncBuilder.ts b/src/fable-library-ts/AsyncBuilder.ts index 7ddec8abf8..e9e569353d 100644 --- a/src/fable-library-ts/AsyncBuilder.ts +++ b/src/fable-library-ts/AsyncBuilder.ts @@ -155,7 +155,7 @@ export class AsyncBuilder { })); } - public Return(value?: T) { + public Return(value: T) { return protectedReturn(value); }