summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-10-26 22:48:54 +0100
committerAraq <rumpf_a@web.de>2014-10-26 22:48:54 +0100
commit0e439ce36738170bbc1097fcedfed5def7514a31 (patch)
treefa4573d66e24dbebac533df2d0cf6ab255be80ae /compiler
parent7a48942719f4a557abafefd6d5cbd8b25a283e3a (diff)
downloadNim-0e439ce36738170bbc1097fcedfed5def7514a31.tar.gz
implements #78
Diffstat (limited to 'compiler')
-rw-r--r--compiler/semcall.nim3
-rw-r--r--compiler/types.nim4
2 files changed, 3 insertions, 4 deletions
diff --git a/compiler/semcall.nim b/compiler/semcall.nim
index a4490b782..d3720b0ab 100644
--- a/compiler/semcall.nim
+++ b/compiler/semcall.nim
@@ -94,7 +94,7 @@ proc notFoundError*(c: PContext, n: PNode, errors: CandidateErrors) =
   
   var prefer = preferName
   for err in errors:
-    var errProto = "("
+    var errProto = ""
     let n = err.typ.n
     for i in countup(1, n.len - 1): 
       var p = n.sons[i]
@@ -102,7 +102,6 @@ proc notFoundError*(c: PContext, n: PNode, errors: CandidateErrors) =
         add(errProto, typeToString(p.sym.typ, prefer))
         if i != n.len-1: add(errProto, ", ")
       # else: ignore internal error as we're already in error handling mode
-    add(errProto, ')')
     if errProto == proto:
       prefer = preferModuleInfo
       break
diff --git a/compiler/types.nim b/compiler/types.nim
index e03762155..87f2e1a59 100644
--- a/compiler/types.nim
+++ b/compiler/types.nim
@@ -419,10 +419,10 @@ proc typeToString(typ: PType, prefer: TPreferedDesc = preferName): string =
        sfAnon notin t.sym.flags:
     if t.kind == tyInt and isIntLit(t):
       return t.sym.name.s & " literal(" & $t.n.intVal & ")"
-    if prefer == preferName:
+    if prefer == preferName or t.sym.owner.isNil:
       return t.sym.name.s
     else:
-      return t.sym.skipGenericOwner.name.s & '.' & t.sym.name.s
+      return t.sym.owner.name.s & '.' & t.sym.name.s
   case t.kind
   of tyInt:
     if not isIntLit(t) or prefer == preferExported: