Skip to content

RCA for array inside a tuple across callable boundary always treated as dynamically sized #1391

@swernli

Description

@swernli

With current RCA behaviors, all items inside a tuple are assumed to be dynamic, which for arrays means they are treated as totally dynamic and do not recognize when a static length is used. This can make certain code patterns be treated as if they are using dynamically sized arrays when technically they are not. For example:

@EntryPoint()
operation Main() : (Result, Bool[]) {
    let q = Qubit();
    let r = MResetZ(q);
    (r, [r == Zero, r == One])
}

This is an expected limitation of how tuples treat their contents in RCA, and may be difficult to account for. We should investigate whether some technique could allow for statically sized arrays to be used in a dynamic tuple context.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions