fixes iterating over enums
This commit is contained in:
parent
c6d0611112
commit
8b933e470e
1 changed files with 4 additions and 4 deletions
|
|
@ -236,11 +236,11 @@ proc semTypeIdent(c: PContext, n: PNode): PSym =
|
||||||
markUsed(n, result)
|
markUsed(n, result)
|
||||||
if result.kind == skParam and result.typ.kind == tyTypeDesc:
|
if result.kind == skParam and result.typ.kind == tyTypeDesc:
|
||||||
# This is a typedesc param. is it already bound?
|
# This is a typedesc param. is it already bound?
|
||||||
# it's not bound when it's also used as return type for example
|
# it's not bound when it's used multiple times in the
|
||||||
if result.typ.sonsLen > 0:
|
# proc signature for example
|
||||||
|
if c.InGenericInst > 0:
|
||||||
let bound = result.typ.sons[0].sym
|
let bound = result.typ.sons[0].sym
|
||||||
if bound != nil:
|
if bound != nil: return bound
|
||||||
return bound
|
|
||||||
return result
|
return result
|
||||||
if result.typ.sym == nil:
|
if result.typ.sym == nil:
|
||||||
LocalError(n.info, errTypeExpected)
|
LocalError(n.info, errTypeExpected)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue