-
Notifications
You must be signed in to change notification settings - Fork 311
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 removing function argument when argument is unit #4042
Fix removing function argument when argument is unit #4042
Conversation
This is tricky, if we do this we generate code that doesn't feel as native because all functions accepting unit will have a useless argument. I think we were replacing all identifiers with unit value to avoid this situation, not sure why it didn't work in this case |
Do you think it would be possible to remove the argument from the body instead? |
Interesting, I thought we were doing this already but apparently not 😅 |
Great :-) I'm new to developing the fable compiler but I would be happy to help. Should I try to add tests? Maybe I can investigate how it affects Rust and Python? |
Adding tests is a good idea indeed, but it will need to be done @alfonsogarciacaro PR. We have 2 types of tests:
If you want to contribute to Fable feel free to ask questions and we will try to help you. |
I'm uncertain how to run the tests? If i run them with Is this the best place for me to ask questions or should I use Discord or something else? |
@klofberg When working with Fable you should use the They will give you all the commands that you can use to work with Fable. In this case, it would be something like I made Amplifying F# session showing how Fable works: https://amplifyingfsharp.io/sessions/2023-12-15/ |
Great, thanks! :-)
…On Tue, 11 Feb 2025 at 21:07, Maxime Mangel ***@***.***> wrote:
@klofberg <https://github.com/klofberg> When working with Fable you
should use the build.sh and build.bat script (run build.sh --help to
learn more)
They will give you all the commands that you can use to work with Fable.
In this case, it would be something like build.sh test javascript
I made Amplifying F# session showing how Fable works:
https://amplifyingfsharp.io/sessions/2023-12-15/
—
Reply to this email directly, view it on GitHub
<#4042 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAA5B7DAW2BS7HVML6VHQCD2PJKARAVCNFSM6AAAAABW3QXVJKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNJRHE2TKNRVGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@klofberg I'd be more than happy if you cherry-pick the commit (or just copy the code) and continue the PR. An integration test could be a good idea, so we also check that functions with To add an integration test you just need to add/edit at project in the About Python, it should have the same behavior more or less. The only thing that surprised me is when I checked In Fable repl, Python had Fable/src/Fable.Transforms/Python/Fable2Python.fs Line 3386 in 5c95930
|
Sounds good. Thanks for the input and help! I will look at what I can do. |
@alfonsogarciacaro I've created a new PR #4050 with your code and added a integration test for javascript. I will try to have a look at the Python issue you mention also. |
This PR fixes the issue: #4041