address the comments

This commit is contained in:
narimiran 2019-08-27 14:49:32 +02:00
commit 329e169e96
3 changed files with 4 additions and 7 deletions

View file

@ -514,11 +514,8 @@ proc changeType(c: PContext; n: PNode, newType: PType, check: bool) =
localError(c.config, n.info, "cannot convert " & $value &
" to " & typeToString(newType))
of nkFloatLit..nkFloat64Lit:
if check:
echo newType.kind
if not floatRangeCheck(n.floatVal, newType):
localError(c.config, n.info, "cannot convert " & $n.floatVal &
" to " & typeToString(newType))
if check and not floatRangeCheck(n.floatVal, newType):
localError(c.config, n.info, errFloatToString % [$n.floatVal, typeToString(newType)])
else: discard
n.typ = newType