From 91efa49550b377e677cb0ff0d10e0c1192955b63 Mon Sep 17 00:00:00 2001 From: Jason Beetham Date: Thu, 14 Dec 2023 09:05:14 -0700 Subject: [PATCH] =?UTF-8?q?Overloads=20passed=20to=20static=20proc=20param?= =?UTF-8?q?eters=20now=20convert=20to=20the=20desired=E2=80=A6=20(#23063)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … type mirroring proc params --- compiler/semcall.nim | 14 ++++++++++---- compiler/semexprs.nim | 4 ++-- compiler/sigmatch.nim | 13 ++++++++++++- tests/statictypes/tstaticprocparams.nim | 9 ++++++++- 4 files changed, 32 insertions(+), 8 deletions(-) diff --git a/compiler/semcall.nim b/compiler/semcall.nim index c9f407b12c..f6beb1aebd 100644 --- a/compiler/semcall.nim +++ b/compiler/semcall.nim @@ -733,7 +733,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, son = evaluated.typ) arg.n = evaluated @@ -746,10 +746,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..