Skip to content

The function instances() returns at least twice the number of instances #1960

Open
@spastorclovr

Description

@spastorclovr

Bug Report

1. Minimal reproduce step (Required)

https://play.kcl-lang.io/?s=M4YwFgpgtghgBADQE4BM4G0AeqD6BrASwDsUAaAcyQHsBXAB1JABsYCpgBeAMRieAgC6ALgBQccXBh0CANQhJgBKkSHAALkjgc4AIikEImNRCKLlwAHQhqwYHRZEIFpQHoAbgEYdYiYRKqNLV0AYSooOipFYwAlCGBaJBAIABEIADNiAjUlIm8JOCgINRgUGGKhOABvdSQApABfIMqffLgiGEKOHQASSuwUfGIUCyYqAHd5AAoASnqLXspaOnq8iXqWuDsIEArqjSFG7WbWiUX6ILO6Dfz2wuAm65O4PzRtfsGSR-F1uHWRNKCLCgACNSnB+lUfDoiFQ1GBiOQ4L01ABPOgQKhpSb9WbeP73bRYnBSOg4HEiETEuikiHaZAoSY6BDRACC1J0pF0JMs4FYpmKSAsxnAOmmkPyWxAFjc8jMpiC6C+4qeNw6ECCOk8vDoYBgXiVPwkAhEfxExHUMCISQJcCYJkm9Oc-Mt1pm0xEQA

  • One Schema
  • One Instance of this Schema

Related to #1880

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

I expect to see that there is exactly 1 instance.

3. What did you see instead (Required)

Depending on whether I use the "_app_xrd" variable I wil get 1 instance (if used after creation) or
2 instances (if the variable is used before the actual creation of the variable _app_xrd)

While it does not seem like a "normal" use-case to use a variable before it is instanciated, it could happen when running kcl with multiple files as arguments
kcl file1.k file2.k

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

0.11.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions