summary refs log tree commit diff stats
path: root/compiler/sem.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-03-29 12:19:49 +0200
committerAndreas Rumpf <rumpf_a@web.de>2016-03-29 12:19:49 +0200
commit0378f9980f64303a87be4e5423272c65c1976a73 (patch)
treef59afa976dc001d6288621cc2e98d37e4d6e3530 /compiler/sem.nim
parent8c8825b9ce1ec04a812142d85ec1369c4c0d2ca7 (diff)
downloadNim-0378f9980f64303a87be4e5423272c65c1976a73.tar.gz
fixed regressions
Diffstat (limited to 'compiler/sem.nim')
-rw-r--r--compiler/sem.nim5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/sem.nim b/compiler/sem.nim
index e09d49f88..97a20a4da 100644
--- a/compiler/sem.nim
+++ b/compiler/sem.nim
@@ -67,9 +67,12 @@ template semIdeForTemplateOrGeneric(c: PContext; n: PNode;
 
 proc typeMismatch(n: PNode, formal, actual: PType) =
   if formal.kind != tyError and actual.kind != tyError:
+    let named = typeToString(formal)
+    let desc = typeToString(formal, preferDesc)
+    let x = if named == desc: named else: named & " = " & desc
     localError(n.info, errGenerated, msgKindToString(errTypeMismatch) &
         typeToString(actual) & ") " &
-        `%`(msgKindToString(errButExpectedX), [typeToString(formal)]))
+        `%`(msgKindToString(errButExpectedX), [x]))
 
 proc fitNode(c: PContext, formal: PType, arg: PNode): PNode =
   if arg.typ.isNil: