summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
author林亦恩 <s177653@hlc.edu.tw>2021-10-13 17:35:47 +0800
committerGitHub <noreply@github.com>2021-10-13 11:35:47 +0200
commite645be4d0c6c53cd9483d4fde24c4ddc7bd1bf96 (patch)
tree0e87c9c8b4637013d390d1fcbfb04b3999e2b23f /compiler
parent2aa97a228aa3a34b48f1af9901f29379fb131a31 (diff)
downloadNim-e645be4d0c6c53cd9483d4fde24c4ddc7bd1bf96.tar.gz
add ghci like type annotation buildEchoStmt (1049) (#18875)
* add ghci like type annotation buildEchoStmt (1049)

* Update compiler/semexprs.nim

* Update compiler/semexprs.nim

Co-authored-by: flywind <xzsflywind@gmail.com>

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
Co-authored-by: flywind <xzsflywind@gmail.com>
Diffstat (limited to 'compiler')
-rw-r--r--compiler/semexprs.nim1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim
index 342b8b05f..c11cecfa9 100644
--- a/compiler/semexprs.nim
+++ b/compiler/semexprs.nim
@@ -1057,6 +1057,7 @@ proc buildEchoStmt(c: PContext, n: PNode): PNode =
   else:
     result.add localErrorNode(c, n, "system needs: echo")
   result.add(n)
+  result.add(newStrNode(nkStrLit, ": " & n.typ.typeToString))
   result = semExpr(c, result)
 
 proc semExprNoType(c: PContext, n: PNode): PNode =