From 82e77a13f3aef7b41986d935d4cc24497dbf613c 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 (cherry picked from commit 91efa49550b377e677cb0ff0d10e0c1192955b63) --- 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 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..