From 7cbe031909e90ae7896aee49382455f428a5c52a Mon Sep 17 00:00:00 2001 From: metagn Date: Sun, 29 Sep 2024 11:20:38 +0300 Subject: [PATCH] fix trivial segfault in sigmatch for static types (#24196) refs #7382, caused by #24005 --- compiler/sigmatch.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index f09fd6b69fe9..844db3209727 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -2012,7 +2012,7 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, var r = tryResolvingStaticExpr(c, f.n) if r == nil: r = f.n if not exprStructuralEquivalent(r, aOrig.n) and - not (aOrig.n.kind == nkIntLit and + not (aOrig.n != nil and aOrig.n.kind == nkIntLit and inferStaticParam(c, r, aOrig.n.intVal)): result = isNone elif f.base.kind == tyGenericParam: