-
Notifications
You must be signed in to change notification settings - Fork 301
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
[TypeScript] Option<> to Optional Parameter misses unwrap. #3847
Comments
@Freymaurer Yes, looks like it doesn't unwrap when you omit some of the optional parameters. [<AttachMembersAttribute>]
type MyTestClass(?nameOption: string, ?otherOption: int) =
member val Name = defaultArg nameOption "Kevin" with get, set
let testCreate (nameOption: string option) =
MyTestClass(?nameOption = nameOption) |
Thank you for the quick fix, @ncave! For when is the next release containing this fix planned? |
It is available in 4.19.3 |
@MangelMaxime @ncave I am also working on a library for both TS and .NET. |
Have a look here, that is at least what worked for me 🙂 but i am by no means an expert for ts. |
Description
I am currently working on typescript transpilation for our library ARCtrl. I want to do this to offer type support for the js native release.
Sadly i get around 850 errors, which i am now trying to resolve one by one. I started investigating in:
And i found the following:
I tried to replicate this behavior on the Fable REPL, but the REPL transpiles it using
unwrap
(see REPL below).Adding
unwrap
by hand to the typescript code seems to resolve the issue. Now i am not sure why this happens.The F# code in question can be found: here
Repro code
REPL.
Expected and actual results
Please provide the expected and actual results.
Related information
dotnet fable --version
: 4.19.2The text was updated successfully, but these errors were encountered: