summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorzah <zahary@gmail.com>2019-01-07 13:10:54 +0200
committerAndreas Rumpf <rumpf_a@web.de>2019-01-07 12:10:54 +0100
commit87f8ec5b92d5647ab4b1875262e845d51dd82763 (patch)
tree6dc75f243cbfd0eb8ba93258bb9dcc65bb42c56e /compiler
parent5345c5b1302e7beca5eb88ed510570e8e4431413 (diff)
downloadNim-87f8ec5b92d5647ab4b1875262e845d51dd82763.tar.gz
Fix #10073 (#10218)
Diffstat (limited to 'compiler')
-rw-r--r--compiler/semexprs.nim9
1 files changed, 8 insertions, 1 deletions
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim
index 7a124c769..f03af3db9 100644
--- a/compiler/semexprs.nim
+++ b/compiler/semexprs.nim
@@ -1043,7 +1043,8 @@ proc semSym(c: PContext, n: PNode, sym: PSym, flags: TExprFlags): PNode =
   of skConst:
     markUsed(c.config, n.info, s, c.graph.usageSym)
     onUse(n.info, s)
-    case skipTypes(s.typ, abstractInst-{tyTypeDesc}).kind
+    let typ = skipTypes(s.typ, abstractInst-{tyTypeDesc})
+    case typ.kind
     of  tyNil, tyChar, tyInt..tyInt64, tyFloat..tyFloat128,
         tyTuple, tySet, tyUInt..tyUInt64:
       if s.magic == mNone: result = inlineConst(c, n, s)
@@ -1061,6 +1062,12 @@ proc semSym(c: PContext, n: PNode, sym: PSym, flags: TExprFlags): PNode =
       # deal with two different ``[]``.
       if s.ast.len == 0: result = inlineConst(c, n, s)
       else: result = newSymNode(s, n.info)
+    of tyStatic:
+      if typ.n != nil:
+        result = typ.n
+        result.typ = typ.base
+      else:
+        result = newSymNode(s, n.info)
     else:
       result = newSymNode(s, n.info)
   of skMacro: