mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-06 04:57:49 +00:00
fixes #24630
This commit is contained in:
@@ -2040,7 +2040,7 @@ proc genArrayConstr(c: PCtx, n: PNode, dest: var TDest) =
|
||||
c.gABx(n, opcLdNull, dest, c.genType(n.typ))
|
||||
|
||||
let intType = getSysType(c.graph, n.info, tyInt)
|
||||
let seqType = n.typ.skipTypes(abstractVar-{tyTypeDesc})
|
||||
let seqType = n.typ.skipTypes(abstractVar+{tyStatic}-{tyTypeDesc})
|
||||
if seqType.kind == tySequence:
|
||||
var tmp = c.getTemp(intType)
|
||||
c.gABx(n, opcLdImmInt, tmp, n.len)
|
||||
|
||||
@@ -87,3 +87,12 @@ block: # bug #22095
|
||||
z = fn()
|
||||
|
||||
doAssert z.limbs[0] == 10
|
||||
|
||||
block: # bug #24630
|
||||
func f(a: static openArray[int]): int =
|
||||
12
|
||||
|
||||
func g(a: static openArray[int]) =
|
||||
const b = f(a)
|
||||
|
||||
g(@[1,2,3])
|
||||
|
||||
Reference in New Issue
Block a user