diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 08a2e2ce9a..6fefda52d6 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -974,7 +974,7 @@ proc semSym(c: PContext, n: PNode, sym: PSym, flags: TExprFlags): PNode = of skParam: markUsed(n.info, s, c.graph.usageSym) styleCheckUse(n.info, s) - if s.typ.kind == tyStatic and s.typ.n != nil: + if s.typ != nil and s.typ.kind == tyStatic and s.typ.n != nil: # XXX see the hack in sigmatch.nim ... return s.typ.n elif sfGenSym in s.flags: