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

Reconsider returning the configured undefined for else-less ifs #2050

Open
adrian-zon opened this issue Nov 25, 2024 · 0 comments
Open

Reconsider returning the configured undefined for else-less ifs #2050

adrian-zon opened this issue Nov 25, 2024 · 0 comments

Comments

@adrian-zon
Copy link

(I would have just commented on #710 but it's locked)

The current behavior of always returning stock Undefined, regardless of the configured undefined class, is highly surprising. I understand the wish to be able to write {{ 'foo' if false }}, but we use a lot of if clauses for setting variables or function parameters, and I would not have expected to find Undefined instances when having undefined set to another class.

I suggest to either return a different value depending on the context (this is probably difficult or at least annoying to implement), or always return a defined value like None.

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

No branches or pull requests

1 participant