Files
Nim/tests/system/tstatic_callable_error.nim
Kaushal Modi 5fed1c05ce manual: Document the use of static as a proc call (#19084)
* manual: Document the use of `static` as a proc call

Also adds tests.

Fixes https://github.com/nim-lang/Nim/issues/16987 .

* Update doc/manual.rst

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>

* Use the "bug #NNNN" comment syntax for consistency

Ref:
https://nim-lang.github.io/Nim/contributing.html#writing-tests-stdlib

> Always refer to a GitHub issue using the following exact syntax: bug
for tooling.

* manual: Undocument usage of foo.static

foo.static and foo.static() are not expected to work.

Ref: https://github.com/nim-lang/Nim/pull/19084/files#r741203578

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
2021-11-03 06:48:30 +01:00

15 lines
255 B
Nim

# bug #16987
discard """
errormsg: "cannot evaluate at compile time: inp"
nimout: '''
tstatic_callable_error.nim(14, 21) Error: cannot evaluate at compile time: inp'''
"""
# line 10
proc getNum(a: int): int = a
let inp = 123
echo (static getNum(inp))