Skip to content

SDDL2: locally-consumed field not usable as array length or parameter within same record #604

Description

@Tabaie

The documentation describes using a local field as an array length or record parameter as valid syntax, but it is rejected with a semantic error.

Repro using examples from documentation:

From arrays-collections.md, "Non-Instant-Parse Arrays" section:

Record Data() = {
  count: UInt32LE,
  values: Int32LE[count]  # Size depends on local field
}

data: Data()

Fails with:

semantic error: Undefined variable: 'count'
  3 |   values: Int32LE[count]  # Size depends on local field
    |                   ~~~~~

The #139 workaround (field[is_present]) also implies dynamic array lengths were expected to work. Tested on 2f9487062b9e86f3ac6799b1e50d87c8dd07d593.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions