summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2017-04-21 22:28:34 +0200
committerzah <zahary@gmail.com>2018-06-10 14:25:40 +0300
commit03653ab61e6eed6811c5df0677a2bf2aa722ef9c (patch)
treeb2a0c9389fba4fdb116530c8df53226b548cea0d /compiler
parentae342f84de7d7b6101f766e3b3d08671a9f98d0e (diff)
downloadNim-03653ab61e6eed6811c5df0677a2bf2aa722ef9c.tar.gz
Fix type inference with static literals.
Fixes #3977
Diffstat (limited to 'compiler')
-rw-r--r--compiler/semstmts.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim
index 3687e50e9..7213601de 100644
--- a/compiler/semstmts.nim
+++ b/compiler/semstmts.nim
@@ -498,7 +498,7 @@ proc semVarOrLet(c: PContext, n: PNode, symkind: TSymKind): PNode =
           def = fitNode(c, typ, def, def.info)
           #changeType(def.skipConv, typ, check=true)
       else:
-        typ = skipIntLit(def.typ)
+        typ = def.typ.skipTypes({tyStatic}).skipIntLit
         if typ.kind in tyUserTypeClasses and typ.isResolvedUserTypeClass:
           typ = typ.lastSon
         if hasEmpty(typ):