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

loop.last with generator should throw an exception #4096

Open
Geolim4 opened this issue May 18, 2024 · 0 comments
Open

loop.last with generator should throw an exception #4096

Geolim4 opened this issue May 18, 2024 · 0 comments

Comments

@Geolim4
Copy link

Geolim4 commented May 18, 2024

Hello,

I painfully discovered that loop.last is indeed impossible to access when your looping over a generator (after a couple of hours of painful debug), but I was wondering if there's any possibility for Twig to instead throw an exception when people are accessing to loop.last which is currently "undefined" (obviously) to make the error clearer about WHY is loop.last undefined :)

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

No branches or pull requests

1 participant