summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-05-15 10:57:42 +0200
committerAndreas Rumpf <rumpf_a@web.de>2016-05-15 10:57:42 +0200
commit28a45f7ac91a397b73454c1941e06cd827583013 (patch)
tree57a7ec881831ddcbc9933fa1160c3b055d53538b
parent0662f3be4c5c16f60ee44a6f458cf60acfdb65fb (diff)
parent5a49c51b4cd902f172264e28a567be3783ac73be (diff)
downloadNim-28a45f7ac91a397b73454c1941e06cd827583013.tar.gz
Merge pull request #4154 from yglukhov/sizeof-doc
Added limitations note to sizeof. Closes #4153.
-rw-r--r--lib/system.nim3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/system.nim b/lib/system.nim
index f584f7590..cb98bcc5f 100644
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -588,6 +588,9 @@ proc sizeof*[T](x: T): int {.magic: "SizeOf", noSideEffect.}
   ## that one never needs to know ``x``'s size. As a special semantic rule,
   ## ``x`` may also be a type identifier (``sizeof(int)`` is valid).
   ##
+  ## Limitations: If used within nim VM context ``sizeof`` will only work
+  ## for simple types.
+  ##
   ## .. code-block:: nim
   ##  sizeof('A') #=> 1
   ##  sizeof(2) #=> 8