Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If nesting causes unpredictable results #1837

Open
spastorclovr opened this issue Jan 22, 2025 · 1 comment
Open

If nesting causes unpredictable results #1837

spastorclovr opened this issue Jan 22, 2025 · 1 comment

Comments

@spastorclovr
Copy link

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)


options = {}

if "a" == "a":
    _extra_resource = options?.extraResources

    if _extra_resource:
        _env_from_extra =[{"hello":"bonjour"}]

    _deploy_manifest = {
        env = _env_from_extra
    }

    if "s" != "s":
        _items = ["a"]
        print("RETURNING IN IF ${_items}")
    else:
        _items = ["b"]
        print("RETURNING IN ELSE ${_items}")
    print("RETURNING in main ${_items}")

2. What did you expect to see? (Required)

RETURNING IN ELSE [b]
RETURNING in main [b]

3. What did you see instead (Required)

RETURNING in main Undefined
RETURNING in main Undefined
RETURNING in main Undefined
RETURNING IN ELSE Undefined
RETURNING in main Undefined

BUT if you comment

env = _env_from_extra
The expected result is displayed..

And finally if you remove the top if "if "a" == "a":" everything works smoothly.
This is a blocker for us as it brings uncertainty on how well our kcl functions (crossplane) could run depending on some level of IF confitions.

4. What is your KCL components version? (Required)

0.11.0

@spastorclovr
Copy link
Author

COuld be related to #1835

@spastorclovr spastorclovr changed the title If embrication causes unpredictable results If nesting causes unpredictable results Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant