diff options
Diffstat (limited to 'compiler/semexprs.nim')
-rw-r--r-- | compiler/semexprs.nim | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 67eee3a19..009458089 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -630,7 +630,7 @@ proc changeType(c: PContext; n: PNode, newType: PType, check: bool) = a.add m changeType(m, tup[i], check) of nkCharLit..nkUInt64Lit: - if check and n.kind != nkUInt64Lit and not sameType(n.typ, newType): + if check and n.kind != nkUInt64Lit and not sameTypeOrNil(n.typ, newType): let value = n.intVal if value < firstOrd(c.config, newType) or value > lastOrd(c.config, newType): localError(c.config, n.info, "cannot convert " & $value & @@ -3152,7 +3152,6 @@ proc semExpr(c: PContext, n: PNode, flags: TExprFlags = {}, expectedType: PType expected.kind in {tyInt..tyInt64, tyUInt..tyUInt64, tyFloat..tyFloat128}): - result.typ = expected if expected.kind in {tyFloat..tyFloat128}: n.transitionIntToFloatKind(nkFloatLit) changeType(c, result, expectedType, check=true) |