Fable
Fable copied to clipboard
IsUnion returns false for typeof<Option<int>>
Description
Reflection.FSharpType.IsUnion typeof<Option<int>> returns false.
Expected and actual results
Expecting true like on .NET.
Related information
- Fable version: Online REPL
Yes, in Fable option is a special type and is not like other unions. Although I guess we could fix it in the reflection info. https://github.com/fable-compiler/Fable/blob/7d02d3e690a9b15cb7ca823b90c20f46f13f2a37/src/fable-library/Reflection.ts#L111-L113
Do you have an example of a scenario that's being blocked by this?
https://github.com/Zaid-Ajaj/Fable.Remoting/pull/158/files#diff-5bdc4da2122faa430fe9e2f88bdb24e6R425
Not really a blocker since one can always specifically typecheck for Option.