Conversation
|
I think that this node visitor must also enforce the availability of the variable at runtime to make this works correctly. |
|
Did you mean @drjayvee instead? |
Oops, sorry for the wrong ping. |
Sure, but it does add an exception for
Sorry, I didn't read your comment properly. Aside from the run-time checks, there's also the (possible) compile-time validation of the type to check whether it is valid, and whether a given class (or interface, trait) exists. TwigQI does all of those already. I wouldn't mind bringing some of its functionality into Twig core. However, all of these require that we first standardize the typing system and syntax. That discussion in #4532 proved to be controversial. I wouldn't mind having another go at it, however. |
This is the simplest useful node visitor that use the new types information to optimize the compiled code.