-
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
Fix #3274 and other features #3279
Conversation
583aa21
to
fa97e08
Compare
UPDATE: Commits concerning this and below comments have been moved to #3282 @dbrattli If you want to identify |
@alfonsogarciacaro I just played with this example: [<Erase>]
type ErasedUnion =
| ErasedInt of int
| ErasedString of string
let test () =
let erased = ErasedInt 5
() Which currently outputs: def test(__unit: None=None) -> None:
erased: ErasedUnion = 5 So I need to figure out where to translate |
Yes, but it's a bit complicated because erased unions can be compiled in different ways. I will update the documentation and add a helper tomorrow so it's clearer. |
PS: I btw managed to get let test (arg: U2<string, int>) =
()
test (U2.Case2 10)
let a : U3<string, int, float> = U3.Case1 "hello" from typing import Union
def test(arg: Union[str, int]) -> None:
pass
test(10)
a: Union[str, int, float] = "hello" |
13e31b7
to
4e24d35
Compare
6ec86c0
to
ca2eb33
Compare
Because I realized I still need to fix reflection for erased records and unions and also Rust tests, maybe this cannot make it into Fable 4 release, so I've moved the erased record/union part to #3282 |
Condition
when manually parsing .fsproj in Fable packages. The condition is only evaluated if the property is one of the constants defined by Fable or user. Not sure if we will use this feature but I implemented it in case we decide to publish packages with different files for each target language.ValueOption
module