[BUG]: "default" Volt filter break the compilation if used in a switch case block #16003
Labels
5.0
The issues we want to solve in the 5.0 release
bug
A bug report
external dependency
This issue depends on external issue to be resolved.
status: medium
Medium
Projects
Hi 😃.
Describe the bug
In a switch control structure inside a Volt template, if I use
default(…)
native filter in code template, Volt compiler raises the following error:Message: Uncaught Phalcon\Mvc\View\Exception: Syntax error, unexpected token DEFAULT(default) in …
To Reproduce
Write this template (
views/bug.volt
) :and compile it with the Volt engine compiler:
Expected behavior
Compilation finish successfully, without any error.
Details
Additional context
I caught this by searching this specific issue, I came accross this fix, however I noticed that it only check if the "default" token is in a switch (means the default case of the switch), not if it's a valid filter in a case block.
I looked at the current state of master, and I think the issue is still there as the code is still nearly the same
Unfortunately I can't test a more recent version of the framework, but I'm confident about the bug still happens.
The text was updated successfully, but these errors were encountered: