infer static parameters even when more complicated arithmetic is involved

This commit is contained in:
Zahary Karadjov 2016-08-12 03:25:59 +03:00
commit 0f2c4be129
10 changed files with 139 additions and 48 deletions

View file

@ -195,6 +195,7 @@ proc semRangeAux(c: PContext, n: PNode, prev: PType): PType =
for i in 0..1:
if hasGenericArguments(range[i]):
result.n.addSon makeStaticExpr(c, range[i])
result.flags.incl tfUnresolved
else:
result.n.addSon semConstExpr(c, range[i])