diff options
-rw-r--r-- | compiler/types.nim | 2 | ||||
-rw-r--r-- | tests/errmsgs/t8339.nim | 8 |
2 files changed, 10 insertions, 0 deletions
diff --git a/compiler/types.nim b/compiler/types.nim index 80624502c..d065ae29a 100644 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -426,6 +426,8 @@ proc typeToString(typ: PType, prefer: TPreferedDesc = preferName): string = sfAnon notin t.sym.flags: if t.kind == tyInt and isIntLit(t): result = t.sym.name.s & " literal(" & $t.n.intVal & ")" + elif t.kind == tyAlias: + result = typeToString(t.sons[0]) elif prefer in {preferName, preferTypeName} or t.sym.owner.isNil: result = t.sym.name.s if t.kind == tyGenericParam and t.sonsLen > 0: diff --git a/tests/errmsgs/t8339.nim b/tests/errmsgs/t8339.nim new file mode 100644 index 000000000..f0a97658a --- /dev/null +++ b/tests/errmsgs/t8339.nim @@ -0,0 +1,8 @@ +discard """ + line: 8 + errormsg: "type mismatch: got <seq[int]> but expected 'seq[float]'" +""" + +import sequtils + +var x: seq[float] = @[1].mapIt(it) |