Skip to content

Commit

Permalink
manual: Undocument usage of foo.static
Browse files Browse the repository at this point in the history
foo.static and foo.static() are not expected to work.

Ref: https://github.com/nim-lang/Nim/pull/19084/files#r741203578
  • Loading branch information
kaushalmodi committed Nov 2, 2021
1 parent 97aca64 commit 393f77e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion doc/manual.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2987,7 +2987,7 @@ Even some code that has side effects is permitted in a static block:
# Below call evaluates the "getNum(123)" at compile time, but its
# result gets used at run time.
echo getNum(123).static
echo static(getNum(123))
There are limitations on what Nim code can be executed at compile time;
see `Restrictions on Compile-Time Execution
Expand Down
2 changes: 0 additions & 2 deletions tests/system/tstatic_callable.nim
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,5 @@ static:

# Below calls evaluate the "getNum(123)" at compile time, but the
# results of those calls get used at run time.
doAssert getNum(123).static == 123
doAssert getNum(123).static() == 123
doAssert (static getNum(123)) == 123
doAssert (static(getNum(123))) == 123

0 comments on commit 393f77e

Please sign in to comment.