fix #1789 (binding to static params during generic proc sigmatch)

This commit is contained in:
Zahary Karadjov 2014-12-30 11:27:54 +02:00
commit da36a847a7
6 changed files with 116 additions and 46 deletions

View file

@ -60,7 +60,13 @@ proc semGenericStmtSymbol(c: PContext, n: PNode, s: PSym,
else:
result = symChoice(c, n, s, scOpen)
of skGenericParam:
result = newSymNodeTypeDesc(s, n.info)
if s.typ != nil and s.typ.kind == tyStatic:
if s.typ.n != nil:
result = s.typ.n
else:
result = n
else:
result = newSymNodeTypeDesc(s, n.info)
styleCheckUse(n.info, s)
of skParam:
result = n