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.
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:Fails with:
The #139 workaround (
field[is_present]) also implies dynamic array lengths were expected to work. Tested on2f9487062b9e86f3ac6799b1e50d87c8dd07d593.