Fix Include resolve named argument values when StrictVariables is enabled#648
Fix Include resolve named argument values when StrictVariables is enabled#648Benkei wants to merge 10 commits intoscriban:masterfrom
Include resolve named argument values when StrictVariables is enabled#648Conversation
|
Could you elaborate what is it solving? What I see is that with strict variables, we silently discard a runtime error, which feels... counter-intuitive? What is the use case and problem that this PR is trying to solve? |
|
Adjustment for #643 regarding templates in StrictVariables mode. When using 'include', the code checks whether named parameters collide with current local variables. Problem: I have refactored the variable resolution logic and implemented a non-throwing TryGetValue method in TemplateContext. Test Changes:
I hope this isn't too excessive 😅 |
|
I'm not sure that the previous fix #643 was actually the right thing to do, and looking at this PR, we are building maybe more workaround on something that should be simpler. Template arguments are transformed to local variables ( TemplateContext actually has a Probably closing this PR and if you want to open a new PR with my proposal above, it will be welcome, thank you. |
|
Thanks for the review. I'll check it again. |
This PR fixes a bug that occurs when StrictVariables is enabled during the Include process.
I hope this fixes the problem correctly.