summary refs log tree commit diff stats
path: root/compiler/astmsgs.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/astmsgs.nim')
-rw-r--r--compiler/astmsgs.nim8
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/astmsgs.nim b/compiler/astmsgs.nim
index a9027126a..aeeff1fd0 100644
--- a/compiler/astmsgs.nim
+++ b/compiler/astmsgs.nim
@@ -5,7 +5,7 @@ import options, ast, msgs
 proc typSym*(t: PType): PSym =
   result = t.sym
   if result == nil and t.kind == tyGenericInst: # this might need to be refined
-    result = t[0].sym
+    result = t.genericHead.sym
 
 proc addDeclaredLoc*(result: var string, conf: ConfigRef; sym: PSym) =
   result.add " [$1 declared in $2]" % [sym.kind.toHumanStr, toFileLineCol(conf, sym.info)]
@@ -24,6 +24,12 @@ proc addDeclaredLoc*(result: var string, conf: ConfigRef; typ: PType) =
     result.add " declared in " & toFileLineCol(conf, typ.sym.info)
   result.add "]"
 
+proc addTypeNodeDeclaredLoc*(result: var string, conf: ConfigRef; typ: PType) =
+  result.add " [$1" % typ.kind.toHumanStr
+  if typ.sym != nil:
+    result.add " declared in " & toFileLineCol(conf, typ.sym.info)
+  result.add "]"
+
 proc addDeclaredLocMaybe*(result: var string, conf: ConfigRef; typ: PType) =
   if optDeclaredLocs in conf.globalOptions: addDeclaredLoc(result, conf, typ)