From 5a49c51b4cd902f172264e28a567be3783ac73be Mon Sep 17 00:00:00 2001 From: Yuriy Glukhov Date: Fri, 13 May 2016 20:09:14 +0300 Subject: Added limitations note to sizeof. Closes #4153. --- lib/system.nim | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib') 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 -- cgit 1.4.1-2-gfad0