diff options
author | LemonBoy <LemonBoy@users.noreply.github.com> | 2018-10-10 21:03:18 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-10-10 21:03:18 +0200 |
commit | 0ead36dae6ab0d4525d2318d19335147ffa0bd3d (patch) | |
tree | f5aae1163acc3da37ac0341c6e2fd8bc013de259 /lib/system.nim | |
parent | 0803b532f44fc7b0039e31187af76e36828ca89d (diff) | |
download | Nim-0ead36dae6ab0d4525d2318d19335147ffa0bd3d.tar.gz |
Unchecked arrays now have their own type (#9267)
Diffstat (limited to 'lib/system.nim')
-rw-r--r-- | lib/system.nim | 8 |
1 files changed, 7 insertions, 1 deletions
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): |