mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-04 10:54:42 +00:00
@@ -306,7 +306,7 @@ proc semArrayIndex(c: PContext, n: PNode): PType =
|
||||
result = makeRangeWithStaticExpr(c, e)
|
||||
if c.inGenericContext > 0: result.flags.incl tfUnresolved
|
||||
elif e.kind in (nkCallKinds + {nkBracketExpr}) and hasUnresolvedArgs(c, e):
|
||||
if not isOrdinalType(e.typ):
|
||||
if not isOrdinalType(e.typ.skipTypes({tyStatic, tyAlias, tyGenericInst, tySink})):
|
||||
localError(c.config, n[1].info, errOrdinalTypeExpected)
|
||||
# This is an int returning call, depending on an
|
||||
# yet unknown generic param (see tgenericshardcases).
|
||||
|
||||
@@ -349,3 +349,11 @@ type
|
||||
a: array[n, int]
|
||||
Tile = TileCT #Commenting this out to make it work
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------------------
|
||||
# issue #15858
|
||||
|
||||
proc fn(N1: static int, N2: static int, T: typedesc): array[N1 * N2, T] =
|
||||
doAssert(len(result) == N1 * N2)
|
||||
|
||||
let yy = fn(5, 10, float)
|
||||
|
||||
Reference in New Issue
Block a user