You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
modulerecGlutinumopenFable.CoreopenFable.Core.JsInteropopenSystem[<AllowNullLiteral>][<Interface>]typeLiteralBool=abstractmemberlog:boolwith get, set
Problem description
TypeScript allows to pass literal values in the type but not F#.
To support this syntax, we currently transform the literal value to its type representation. But this means that people could pass false instead of the only accepted value which is true.
Is there something we can do about that?
Perhaps, we could use Emit to generate on the fly the POJO but is it worth the complexity?
modulerecGlutinumopenFable.CoreopenFable.Core.JsInteropopenSystem[<Global>][<AllowNullLiteral>]typeoptions[<Emit("{name: $0, log: true}")>](
name : string,
log: bool
)=member vallog:bool = nativeOnly with get, set
leto= options("maxime",false)// I on purpose used false here to show that the output always use true
generates
exportconsto={name: "maxime",log: true};
This is correct but can be confusing for the user.
The text was updated successfully, but these errors were encountered:
Issue created from Glutinum Tool
Glutinum version - 0.9.0-preview
TypeScript
FSharp
Problem description
TypeScript allows to pass literal values in the type but not F#.
To support this syntax, we currently transform the literal value to its type representation. But this means that people could pass
false
instead of the only accepted value which istrue
.Is there something we can do about that?
Perhaps, we could use
Emit
to generate on the fly the POJO but is it worth the complexity?generates
This is correct but can be confusing for the user.
The text was updated successfully, but these errors were encountered: