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

Variable name resolution problem #1061

Closed
vtomilov opened this issue Feb 20, 2024 · 0 comments · Fixed by #1063
Closed

Variable name resolution problem #1061

vtomilov opened this issue Feb 20, 2024 · 0 comments · Fixed by #1063
Labels
bug Something isn't working codegen

Comments

@vtomilov
Copy link

vtomilov commented Feb 20, 2024

Bug Report

I'm facing name resolution issues with variable k in the following example. And it happens only if I try to make array of dicts. For array of arrays variable k resolves fine. ([[k, v] for k, v in _data] and {k: v for k, v in _data} works as expected)

1. Minimal reproduce step (Required)

_data = {
    "a": 'foo'
    "b": 'bar'
}

r = [{k: v} for k, v in _data]

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

r:
- a: foo
- b: bar

3. What did you see instead (Required)

r:
- k: foo
- k: bar

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

v0.7.0, v0.7.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working codegen
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants