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 :)
Hello,
I painfully discovered that
loop.lastis 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 toloop.lastwhich is currently "undefined" (obviously) to make the error clearer about WHY isloop.lastundefined :)