summary refs log tree commit diff stats
path: root/lib/system.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2012-08-24 17:33:04 +0200
committerAraq <rumpf_a@web.de>2012-08-24 17:33:04 +0200
commitd17caa86e841489d92165d9caa13c2d8bc86afd5 (patch)
tree9504e5dd71501887da52fbc1f0fd39294ef913ea /lib/system.nim
parentafcff024a1ab335032aa8a98d844f6fbc701170e (diff)
downloadNim-d17caa86e841489d92165d9caa13c2d8bc86afd5.tar.gz
objects with no ancestor are not implicitely final
Diffstat (limited to 'lib/system.nim')
-rwxr-xr-xlib/system.nim7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/system.nim b/lib/system.nim
index 01b85a4d6..b40f161f1 100755
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -171,9 +171,12 @@ proc `..`*[T](b: T): TSlice[T] {.noSideEffect, inline.} =
 proc contains*[T](s: TSlice[T], value: T): bool {.noSideEffect, inline.} = 
   result = value >= s.a and value <= s.b
 
+when not defined(niminheritable):
+  {.pragma: inheritable.}
+
 when not defined(EcmaScript) and not defined(NimrodVM):
   type
-    TGenericSeq {.compilerproc, pure.} = object
+    TGenericSeq {.compilerproc, pure, inheritable.} = object
       len, reserved: int
     PGenericSeq {.exportc.} = ptr TGenericSeq
     # len and space without counting the terminating zero:
@@ -197,7 +200,7 @@ type
     ## is an int type ranging from one to the maximum value
     ## of an int. This type is often useful for documentation and debugging.
 
-  TObject* {.exportc: "TNimObject".} =
+  TObject* {.exportc: "TNimObject", inheritable.} =
     object ## the root of Nimrod's object hierarchy. Objects should
            ## inherit from TObject or one of its descendants. However,
            ## objects that have no ancestor are allowed.