Fix 4041
@alfonsogarciacaro I found and fixed the problem with Python that you mentioned here: https://github.com/fable-compiler/Fable/pull/4042#issuecomment-2659396139
Is this PR OK to complete or do I need to do anything else?
@MangelMaxime Is this OK to complete or do you need me to do anything else?
@MangelMaxime @alfonsogarciacaro @dbrattli @ncave Hi, Is there any chance for this to be merged into main? Do I need to do anything else? I've tested locally and added tests. (See #4042 for more info)
The description of this PR is empty. Please add Why and How. Links are good, but the PR should explain exactly what is being done and why.
The description of this PR is empty. Please add Why and How. Links are good, but the PR should explain exactly what is being done and why.
@dbrattli I’ve added a title and description. Please let me now if it needs to be improved!
@klofberg Since you are changing FSharp2Fable.Utils.fs this PR affects all targets. The code generation for Python looks worse after this fix, so I don't think I would like to have the same fix for Python.
For Python without this PR:
def update(model: None = None) -> tuple[None, None]:
return (model, None)
ignore(update())
With this PR:
def update(__unit: None=None) -> tuple[None, None]:
return (model, None) # <--- Undefined name `model`
ignore(update())
That's not good. I'll look in to it and try to make the generated python as before.
Is it ok to have conditionals in that file for different targets or do you have another preferred place to do the fix?
@klofberg Thank you for your contribution, I'll close this PR as it is superseded by #4205 (which is basically #4042 + tests).