Open
Description
Bug Report
Resources that follow an if clause that evaluates to False are rendered twice, if a function is used inside of them
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
_items = []
functionTest = lambda -> str {
"value"
}
_items += [{
name = "A"
}]
_role = []
if False:
_items += [
{name = "B"}
]
_items += [
{
name= "C"
key = functionTest()
}
]
items = _items
The code above creates the following output:
items:
- name: A
- name: C
key: value
- name: C
key: value
If the function call to functionTest() is removed the output is (as expected)
items:
- name: A
- name: C
key: value
If the if clause resolves to True the output is (as expected)
items:
- name: A
- name: B
- name: C
key: value
2. What did you expect to see? (Required)
Irrelevant of using a function in the last item, if the if evaluates to False, the output should be
items:
- name: A
- name: C
key: value
3. What did you see instead (Required)
When using a function and if the if evaluates to False, the result is
items:
- name: A
- name: C
key: value
- name: C
key: value
4. What is your KCL components version? (Required)
0.11