Skip to content

No static bounds checking for register and list indexing #101

Description

@vishnu-m77

The current type checker (analog or atomic) validates index types but not index ranges. Out of bounds access on registers or lists are not caught during static analysis. Example:

r = qreg[2]
x = r[5]

This code is invalid because it is attempting to access index 5 of a register with 2 values. However, this is not caught by the static analysis. This code will fail during runtime as the error is not caught during compile time. By implementing proper bounds checking, out of bounds access can be caught during program compilation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions