Unchecked arrays now have their own type (#9267)

This commit is contained in:
LemonBoy 2018-10-10 21:03:18 +02:00 • committed by Andreas Rumpf
commit 0ead36dae6
15 changed files with 72 additions and 21 deletions

View file

@ -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,

View file

@ -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):