fix closure iter state table init type [backport] (#20717)
fix closure iter state table init type It is a well-known fact that using closed intervals for ranges is logically, objectively and eternally wrong, as evidenced by this off-by-one.
This commit is contained in:
parent
52166e3546
commit
a0653ae71a
1 changed files with 1 additions and 1 deletions
|
|
@ -1155,7 +1155,7 @@ proc newArrayType(g: ModuleGraph; n: int, t: PType; idgen: IdGenerator; owner: P
|
|||
result = newType(tyArray, nextTypeId(idgen), owner)
|
||||
|
||||
let rng = newType(tyRange, nextTypeId(idgen), owner)
|
||||
rng.n = newTree(nkRange, g.newIntLit(owner.info, 0), g.newIntLit(owner.info, n))
|
||||
rng.n = newTree(nkRange, g.newIntLit(owner.info, 0), g.newIntLit(owner.info, n - 1))
|
||||
rng.rawAddSon(t)
|
||||
|
||||
result.rawAddSon(rng)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue