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

Overridden default function argument not visible in the Text representation #7723

Closed
radeusgd opened this issue Sep 4, 2023 · 1 comment · Fixed by #7762
Closed

Overridden default function argument not visible in the Text representation #7723

radeusgd opened this issue Sep 4, 2023 · 1 comment · Fixed by #7762
Assignees

Comments

@radeusgd
Copy link
Member

radeusgd commented Sep 4, 2023

Our new textual representation of functions shows its non-default arguments, which is aiding with understanding errors of argument mismatches (e.g. #7359).

After some further practical usage of this new feature, I've noticed that if I set an argument which has a default value, it is not displayed in the function representation.

E.g.

from Standard.Base import all

foo a b c=3 d=4 =
    a + b + c + d

main =
    IO.println (foo b=100)
    IO.println (foo c=200)

Actual behaviour

yields

no-default-shown.foo[no-default-shown.enso:3-4] self=no-default-shown a=_ b=100
no-default-shown.foo[no-default-shown.enso:3-4] self=no-default-shown a=_ b=_

Expected behaviour

while I'd expect

no-default-shown.foo[no-default-shown.enso:3-4] self=no-default-shown a=_ b=100
no-default-shown.foo[no-default-shown.enso:3-4] self=no-default-shown a=_ b=_ c=200

or even better:

no-default-shown.foo[no-default-shown.enso:3-4] self=no-default-shown a=_ b=100 c=<default> d=<default>
no-default-shown.foo[no-default-shown.enso:3-4] self=no-default-shown a=_ b=_ c=200 d=<default>

After seeing this in practice, I'm sure we want to display the argument when its overridden, regardless if it has a default value or not. Otherwise there is no way to tell if the argument is set or not.

Additionally, I know I initially voted that there is no need to display defaulted arguments. I'm not yet that sure. I think after all it may be useful to include them in the textual representation, e.g. as shown above as x=<default>.

Either way, if the argument has a provided value - then its 'defaulted' status should no longer matter - it should always be displayed (like the c=200 above).

@github-project-automation github-project-automation bot moved this to ❓New in Issues Board Sep 4, 2023
@radeusgd radeusgd assigned radeusgd and JaroslavTulach and unassigned radeusgd Sep 4, 2023
@jdunkerley jdunkerley moved this from ❓New to 📤 Backlog in Issues Board Sep 6, 2023
@JaroslavTulach JaroslavTulach moved this from 📤 Backlog to 👁️ Code review in Issues Board Sep 7, 2023
@github-project-automation github-project-automation bot moved this from 👁️ Code review to 🟢 Accepted in Issues Board Sep 7, 2023
@enso-bot
Copy link

enso-bot bot commented Sep 8, 2023

Jaroslav Tulach reports a new STANDUP for yesterday (2023-09-07):

Progress: - merged: #7762

Next Day: Bugfixing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants