diff --git a/compiler/semcall.nim b/compiler/semcall.nim index 3afcf025b4..0106ce3045 100644 --- a/compiler/semcall.nim +++ b/compiler/semcall.nim @@ -714,7 +714,7 @@ proc explicitGenericSym(c: PContext, n: PNode, s: PSym): PNode = # try transforming the argument into a static one before feeding it into # typeRel if formal.kind == tyStatic and arg.kind != tyStatic: - let evaluated = c.semTryConstExpr(c, n[i]) + let evaluated = c.semTryConstExpr(c, n[i], n[i].typ) if evaluated != nil: arg = newTypeS(tyStatic, c) arg.sons = @[evaluated.typ] @@ -728,10 +728,16 @@ proc explicitGenericSym(c: PContext, n: PNode, s: PSym): PNode = onUse(info, s) result = newSymNode(newInst, info) -proc setGenericParams(c: PContext, n: PNode) = +proc setGenericParams(c: PContext, n, expectedParams: PNode) = ## sems generic params in subscript expression for i in 1..