summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorLemonBoy <LemonBoy@users.noreply.github.com>2018-10-10 21:03:18 +0200
committerAndreas Rumpf <rumpf_a@web.de>2018-10-10 21:03:18 +0200
commit0ead36dae6ab0d4525d2318d19335147ffa0bd3d (patch)
treef5aae1163acc3da37ac0341c6e2fd8bc013de259 /lib
parent0803b532f44fc7b0039e31187af76e36828ca89d (diff)
downloadNim-0ead36dae6ab0d4525d2318d19335147ffa0bd3d.tar.gz
Unchecked arrays now have their own type (#9267)
Diffstat (limited to 'lib')
-rw-r--r--lib/core/macros.nim2
-rw-r--r--lib/system.nim8
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/core/macros.nim b/lib/core/macros.nim
index 971c00012..2b0d74e6a 100644
--- a/lib/core/macros.nim
+++ b/lib/core/macros.nim
@@ -98,7 +98,7 @@ type
     ntyUInt, ntyUInt8, ntyUInt16, ntyUInt32, ntyUInt64,
     ntyUnused0, ntyUnused1, ntyUnused2,
     ntyVarargs,
-    ntyUnused,
+    ntyUncheckedArray,
     ntyError,
     ntyBuiltinTypeClass, ntyUserTypeClass, ntyUserTypeClassInst,
     ntyCompositeTypeClass, ntyInferred, ntyAnd, ntyOr, ntyNot,
diff --git a/lib/system.nim b/lib/system.nim
index 94706c525..c9d56de0d 100644
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -253,7 +253,13 @@ type
   seq*{.magic: "Seq".}[T]  ## Generic type to construct sequences.
   set*{.magic: "Set".}[T]  ## Generic type to construct bit sets.
 
-  UncheckedArray* {.unchecked.}[T] = array[0, T]
+when defined(nimUncheckedArrayTyp):
+  type
+    UncheckedArray*{.magic: "UncheckedArray".}[T]
+    ## Array with no bounds checking
+else:
+  type
+    UncheckedArray*{.unchecked.}[T] = array[0,T]
     ## Array with no bounds checking
 
 when defined(nimHasOpt):