diff options
author | alaviss <alaviss@users.noreply.github.com> | 2019-02-13 14:07:58 +0700 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2019-02-13 08:07:58 +0100 |
commit | 3520253a09cb8f32df834e619c7435092a370e9d (patch) | |
tree | 6e7d39ecb0b4fa1a88028b9235fc25a45e61f6ed /compiler | |
parent | b6c22eae6a73438ca9bf48281090ce0958475e06 (diff) | |
download | Nim-3520253a09cb8f32df834e619c7435092a370e9d.tar.gz |
compiler/types: correctly generates signature for non-proc types (#10658)
This makes signatures generated for nimsuggest correctly distinguish template/macro/converter from proc.
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/types.nim | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/compiler/types.nim b/compiler/types.nim index 23902459e..7034917d4 100644 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -588,7 +588,15 @@ proc typeToString(typ: PType, prefer: TPreferedDesc = preferName): string = if prefer != preferExported: result.add("(" & typeToString(t.sons[0]) & ")") of tyProc: - result = if tfIterator in t.flags: "iterator " else: "proc " + result = if tfIterator in t.flags: "iterator " + elif t.owner != nil: + case t.owner.kind + of skTemplate: "template " + of skMacro: "macro " + of skConverter: "converter " + else: "proc " + else: + "proc " if tfUnresolved in t.flags: result.add "[*missing parameters*]" result.add "(" for i in countup(1, sonsLen(t) - 1): |