summary refs log tree commit diff stats
path: root/compiler/semgnrc.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/semgnrc.nim')
-rwxr-xr-xcompiler/semgnrc.nim15
1 files changed, 10 insertions, 5 deletions
diff --git a/compiler/semgnrc.nim b/compiler/semgnrc.nim
index 4eaa5f39b..2e1eccda2 100755
--- a/compiler/semgnrc.nim
+++ b/compiler/semgnrc.nim
@@ -30,6 +30,11 @@ proc getIdentNode(n: PNode): PNode =
   else:
     illFormedAst(n)
     result = n
+  
+proc newSymNodeTypeDesc(s: PSym; info: TLineInfo): PNode =
+  result = newSymNode(s, info)
+  result.typ = newType(tyTypeDesc, s.owner)
+  result.typ.addSonSkipIntLit(s.typ)
 
 proc semGenericStmt(c: PContext, n: PNode, flags: TSemGenericFlags,
                     ctx: var TIntSet): PNode
@@ -63,12 +68,12 @@ proc semGenericStmtSymbol(c: PContext, n: PNode, s: PSym): PNode =
     else:
       result = symChoice(c, n, s, scOpen)
   of skGenericParam: 
-    result = newSymNode(s, n.info)
+    result = newSymNodeTypeDesc(s, n.info)
   of skParam: 
     result = n
   of skType: 
     if (s.typ != nil) and (s.typ.kind != tyGenericParam): 
-      result = newSymNode(s, n.info)
+      result = newSymNodeTypeDesc(s, n.info)
     else: 
       result = n
   else: result = newSymNode(s, n.info)
@@ -156,13 +161,13 @@ proc semGenericStmt(c: PContext, n: PNode,
       of skProc, skMethod, skIterator, skConverter: 
         result.sons[0] = symChoice(c, n.sons[0], s, scOption)
         first = 1
-      of skGenericParam: 
-        result.sons[0] = newSymNode(s, n.sons[0].info)
+      of skGenericParam:
+        result.sons[0] = newSymNodeTypeDesc(s, n.sons[0].info)
         first = 1
       of skType: 
         # bad hack for generics:
         if (s.typ != nil) and (s.typ.kind != tyGenericParam): 
-          result.sons[0] = newSymNode(s, n.sons[0].info)
+          result.sons[0] = newSymNodeTypeDesc(s, n.sons[0].info)
           first = 1
       else:
         result.sons[0] = newSymNode(s, n.sons[0].info)