compiler/types: correctly generates signature for non-proc types (#10658)
This makes signatures generated for nimsuggest correctly distinguish template/macro/converter from proc.
This commit is contained in:
parent
1ae61767f8
commit
9e754c3b06
2 changed files with 21 additions and 1 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue