make more tests green

This commit is contained in:
Araq 2017-02-16 01:43:12 +01:00
commit aebe9d7d13
3 changed files with 11 additions and 6 deletions

View file

@ -628,7 +628,10 @@ proc getConstExpr(m: PSym, n: PNode): PNode =
of {skProc, skMethod}:
result = n
of skType:
result = newSymNodeTypeDesc(s, n.info)
# XXX gensym'ed symbols can come here and cannot be resolved. This is
# dirty, but correct.
if s.typ != nil:
result = newSymNodeTypeDesc(s, n.info)
of skGenericParam:
if s.typ.kind == tyStatic:
if s.typ.n != nil:

View file

@ -869,10 +869,12 @@ proc transform(c: PTransf, n: PNode): PTransNode =
else:
result = transformSons(c, n)
of nkIdentDefs, nkConstDef:
result = n.PTransNode
#transformSons(c, n)
let L = n.len-1
result[L] = transform(c, n.sons[L])
when true:
result = transformSons(c, n)
else:
result = n.PTransNode
let L = n.len-1
result[L] = transform(c, n.sons[L])
# XXX comment handling really sucks:
if importantComments():
PNode(result).comment = n.comment

View file

@ -19,7 +19,7 @@ when true:
q(B()) # This call reported as ambiguous.
# bug #2219
template testPred(a: expr) =
template testPred(a: untyped) =
block:
type A = object of RootObj
type B = object of A