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>
This commit is contained in:
林亦恩
2021-10-13 17:35:47 +08:00
committed by GitHub
parent 2aa97a228a
commit e645be4d0c

View File

@@ -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 =