fixes #6255, add system.ashr arithmetic right shift (#8547)

This commit is contained in:
andri lim 2018-08-07 23:41:30 +07:00 • committed by Andreas Rumpf
commit 4d5cce9882
13 changed files with 95 additions and 12 deletions

View file

@ -858,6 +858,10 @@ proc inferStaticParam*(c: var TCandidate, lhs: PNode, rhs: BiggestInt): bool =
if lhs[2].kind == nkIntLit:
return inferStaticParam(c, lhs[1], rhs shl lhs[2].intVal)
of mAshrI:
if lhs[2].kind == nkIntLit:
return inferStaticParam(c, lhs[1], ashr(rhs, lhs[2].intVal))
of mUnaryMinusI:
return inferStaticParam(c, lhs[1], -rhs)