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

Duplicate List Items When Using Schema, Mixin, and Protocol Together #1772

Open
eminaktas opened this issue Dec 3, 2024 · 2 comments
Open
Assignees
Labels
bug Something isn't working evaluator

Comments

@eminaktas
Copy link

eminaktas commented Dec 3, 2024

Bug Report

1. Minimal reproduce step (Required)

An example in the playground here.

schema Tree:
  names?: [str] = []

schema NotAPerson[tree: Tree]:
    mixin [TreeNamesMixin]

    configs: Configs {
      tree = tree
    }

    names = configs.tree.names

schema TreeNamesMixin for TreeProtocol:
    configs.tree.names += ["Banyan", "Alder", "Cedar"]

protocol TreeProtocol:
  configs: Configs

schema Configs:
  tree: Tree

_treeConfig = Tree {}

result = NotAPerson(_treeConfig)

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

result:
  configs:
    tree:
      names:
      - Banyan
      - Alder
      - Cedar
  names:
  - Banyan
  - Alder
  - Cedar

3. What did you see instead (Required)

result:
  configs:
    tree:
      names:
      - Banyan
      - Alder
      - Cedar
      - Banyan
      - Alder
      - Cedar
  names:
  - Banyan
  - Alder
  - Cedar

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

0.10.10-darwin-arm64

@Peefy Peefy added bug Something isn't working evaluator labels Dec 3, 2024
@Peefy Peefy added this to the v0.11.0 Release milestone Dec 3, 2024
@He1pa
Copy link
Contributor

He1pa commented Dec 4, 2024

We are trying to fix this issue.
You can temporarily workaround it by here

@eminaktas
Copy link
Author

We are trying to fix this issue. You can temporarily workaround it by here

Thank you. I applied your suggestion to resolve the issue.

@He1pa He1pa assigned Peefy and unassigned He1pa and zong-zhe Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working evaluator
Projects
None yet
Development

No branches or pull requests

4 participants