fix trivial segfault in sigmatch for static types (#24196)

refs #7382, caused by #24005
This commit is contained in:
metagn
2024-09-29 11:20:38 +03:00
committed by GitHub
parent 4f5c0efaf2
commit 7cbe031909

View File

@@ -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: