more fixes for new integer promotion rules; fixes #152; fixes #157; fixes #156; fixes #155

This commit is contained in:
Araq 2012-07-09 21:11:11 +02:00
commit 4966212141
8 changed files with 27 additions and 20 deletions

View file

@ -601,7 +601,10 @@ proc getConstExpr(m: PSym, n: PNode): PNode =
else:
result = magicCall(m, n)
of mIs:
result = newIntNodeT(ord(sameType(n[1].typ, n[2].typ)), n)
# BUGFIX: don't evaluate this too early: ``T is void``
if not containsGenericType(n[1].typ) and
not containsGenericType(n[2].typ):
result = newIntNodeT(ord(sameType(n[1].typ, n[2].typ)), n)
of mAstToStr:
result = newStrNodeT(renderTree(n[1], {renderNoComments}), n)
of mConStrStr: