Skip to content
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

Dependent default values #2446

Merged

Conversation

janmasrovira
Copy link
Collaborator

@janmasrovira janmasrovira commented Oct 17, 2023

@janmasrovira janmasrovira added the enhancement New feature or request label Oct 17, 2023
@janmasrovira janmasrovira self-assigned this Oct 17, 2023
@janmasrovira janmasrovira linked an issue Oct 17, 2023 that may be closed by this pull request
@janmasrovira janmasrovira force-pushed the 2445-allow-default-values-to-refer-to-previous-arguments branch from 656a193 to d0e8b57 Compare October 19, 2023 07:08
@janmasrovira janmasrovira added this to the 0.5.3 milestone Oct 24, 2023
@janmasrovira janmasrovira marked this pull request as ready for review October 24, 2023 11:49
@lukaszcz lukaszcz self-requested a review October 24, 2023 12:32
@janmasrovira
Copy link
Collaborator Author

janmasrovira commented Oct 24, 2023

It is possible to enter an infinite loop when inserting default arguments.

E.g.

fun {a : Nat := fun} : Nat := a * a;

main : Nat := fun;

In order to prevent this problem, we need dependency information for default arguments before translating to Internal. I didn't want to delay this pr further, so I'll work on a patch separately. Also, this is a problem with default arguments in general, not only for dependent default values.

@janmasrovira
Copy link
Collaborator Author

It is possible to enter an infinite loop when inserting default arguments.

E.g.

fun {a : Nat := fun} : Nat := a * a;

main : Nat := fun;

In order to prevent this problem, we need dependency information for default arguments before translating to Internal. I didn't want to delay this pr further, so I'll work on a patch separately. Also, this is a problem with default arguments in general, not only for dependent default values.

this has been fixed in e886aa2

Copy link
Collaborator

@lukaszcz lukaszcz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Address the comments. I think SimpleLambda can be removed, but not completely sure.

@lukaszcz lukaszcz merged commit 0943a4a into main Oct 27, 2023
4 checks passed
@lukaszcz lukaszcz deleted the 2445-allow-default-values-to-refer-to-previous-arguments branch October 27, 2023 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow default values to refer to previous arguments
2 participants