You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A set of conditional operands as for example if (a || b) seems to evaluate all its operands (a and b) upfront.
This means that b will be evaluated even if a was already true.
To Reproduce
Steps to reproduce the behavior:
Create a leaf file (e.g. page.leaf) with the following contents:
Rendering fails with "Unable to convert count parameter to LeafData collection" as thrown by the Count tag if the parameter is no collection. In this case, a breakpoint in Count prints the following for the first parameter (given that ctx.children is nil):
(lldb) po ctx.parameters
▿ 1 element
▿ 0 : void()?
▿ storage : void()?
▿ optional : 2 elements
- .0 : nil
- .1 : LeafKit.LeafData.NaturalType.void
Expected behavior
The page renders fine, showing "No children." with the following rendered HTML:
I tried to dig a bit into LeafKit's source, and am pretty sure that the evaluation of all conditional operands is the problem. However, I could also be missing something, in which case my "attempted diagnosis" might be incorrect and the issue is actually something different.
The text was updated successfully, but these errors were encountered:
Describe the bug
A set of conditional operands as for example
if (a || b)
seems to evaluate all its operands (a
andb
) upfront.This means that
b
will be evaluated even ifa
was already true.To Reproduce
Steps to reproduce the behavior:
page.leaf
) with the following contents:Count
tag if the parameter is no collection. In this case, a breakpoint inCount
prints the following for the first parameter (given thatctx.children
isnil
):Expected behavior
The page renders fine, showing "No children." with the following rendered HTML:
Environment
Additional context
I tried to dig a bit into
LeafKit
's source, and am pretty sure that the evaluation of all conditional operands is the problem. However, I could also be missing something, in which case my "attempted diagnosis" might be incorrect and the issue is actually something different.The text was updated successfully, but these errors were encountered: