Updated documentation of system.new. Ref #2699.

This commit is contained in:
Dominik Picheta
2015-08-04 09:06:47 +01:00
parent 202cc48903
commit f8f9677205

View File

@@ -178,7 +178,10 @@ proc new*[T](a: var ref T) {.magic: "New", noSideEffect.}
proc new*(T: typedesc): auto =
## creates a new object of type ``T`` and returns a safe (traced)
## reference to it as result value
## reference to it as result value.
##
## When ``T`` is a ref type then the resulting type will be ``T``,
## otherwise it will be ``ref T``.
when (T is ref):
var r: T
else: