fixes #12029; finish the 'unused import' feature (#12064)

This commit is contained in:
Andreas Rumpf
2019-08-27 19:18:56 +02:00
committed by GitHub
parent d8177a3980
commit 114da04cbb
9 changed files with 28 additions and 4 deletions

View File

@@ -6276,6 +6276,17 @@ is particularly useful when the symbol was generated by a macro:
implementArithOps(int)
echoAdd 3, 5
``used`` can also be used as a top level statement to mark a module as "used".
This prevents the "Unused import" warning:
.. code-block:: nim
# module: debughelper.nim
when defined(nimHasUsed):
# 'import debughelper' is so useful for debugging
# that Nim shouldn't produce a warning for that import,
# even if currently unused:
{.used.}
experimental pragma