diff options
author | Araq <rumpf_a@web.de> | 2011-03-25 00:47:03 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2011-03-25 00:47:03 +0100 |
commit | 032599c156260a0892522b6ce858b1cdff08df84 (patch) | |
tree | 582c86f5e7a23595e1253af47133be3c4764da1f /lib/system.nim | |
parent | 220dd54acfd5527c7c569811013b178fc462898e (diff) | |
download | Nim-032599c156260a0892522b6ce858b1cdff08df84.tar.gz |
bugfix: type converter that converts to bool in 'if' context
Diffstat (limited to 'lib/system.nim')
-rwxr-xr-x | lib/system.nim | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/system.nim b/lib/system.nim index 043275302..a43b0435b 100755 --- a/lib/system.nim +++ b/lib/system.nim @@ -87,6 +87,11 @@ proc new*[T](a: var ref T, finalizer: proc (x: ref T)) {. ## freeing the object. Note: The `finalizer` refers to the type `T`, not to ## the object! This means that for each object of type `T` the finalizer ## will be called! + +proc reset*(obj: var T) {.magic: "Reset", noSideEffect.} +proc reset*(obj: ref T) {.noSideEffect.} = reset(obj^) + ## resets an object `obj` to its initial (binary zero) value. This needs to + ## be called before any possible `object branch transition`:idx:. # for low and high the return type T may not be correct, but # we handle that with compiler magic in SemLowHigh() |