Fable icon indicating copy to clipboard operation
Fable copied to clipboard

Fix 4041

Open klofberg opened this issue 10 months ago • 2 comments

klofberg avatar Feb 17 '25 22:02 klofberg

@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?

klofberg avatar Mar 26 '25 18:03 klofberg

@MangelMaxime Is this OK to complete or do you need me to do anything else?

klofberg avatar Mar 31 '25 15:03 klofberg

@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)

klofberg avatar Aug 06 '25 20:08 klofberg

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 avatar Aug 06 '25 22:08 dbrattli

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 avatar Aug 07 '25 04:08 klofberg

@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())

dbrattli avatar Aug 08 '25 14:08 dbrattli

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 avatar Aug 08 '25 14:08 klofberg

@klofberg Thank you for your contribution, I'll close this PR as it is superseded by #4205 (which is basically #4042 + tests).

ncave avatar Aug 08 '25 19:08 ncave