summary refs log tree commit diff stats
path: root/compiler/magicsys.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/magicsys.nim')
-rw-r--r--compiler/magicsys.nim13
1 files changed, 9 insertions, 4 deletions
diff --git a/compiler/magicsys.nim b/compiler/magicsys.nim
index 1972dec98..88ae2cb12 100644
--- a/compiler/magicsys.nim
+++ b/compiler/magicsys.nim
@@ -115,11 +115,16 @@ proc getIntLitType*(literal: PNode): PType =
     result = copyType(ti, ti.owner, false)
     result.n = literal
 
+proc getFloatLitType*(literal: PNode): PType =
+  # for now we do not cache these:
+  result = newSysType(tyFloat, size=8)
+  result.n = literal
+
 proc skipIntLit*(t: PType): PType {.inline.} =
-  if t.kind == tyInt and t.n != nil:
-    result = getSysType(tyInt)
-  else:
-    result = t
+  if t.n != nil:
+    if t.kind in {tyInt, tyFloat}:
+      return getSysType(t.kind)
+  result = t
 
 proc AddSonSkipIntLit*(father, son: PType) =
   if isNil(father.sons): father.sons = @[]