summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorJacek Sieka <arnetheduck@gmail.com>2017-08-28 21:44:35 +0800
committerAndreas Rumpf <rumpf_a@web.de>2017-08-28 15:44:35 +0200
commit22684370b0eb5938bc7a4172dc968e4c557a02ee (patch)
tree249ab747b22eeccb3be5ff7cfebcd4eec8ca7402 /tests
parentb2aae477d105287ee54da94f7254d5c0f579fe4f (diff)
downloadNim-22684370b0eb5938bc7a4172dc968e4c557a02ee.tar.gz
remove ArrayDummySize with unchecked arrays (#5818)
Diffstat (limited to 'tests')
-rw-r--r--tests/array/tunchecked.nim5
-rw-r--r--tests/metatype/ttypedesc2.nim3
2 files changed, 6 insertions, 2 deletions
diff --git a/tests/array/tunchecked.nim b/tests/array/tunchecked.nim
new file mode 100644
index 000000000..f5ac3642d
--- /dev/null
+++ b/tests/array/tunchecked.nim
@@ -0,0 +1,5 @@
+{.boundchecks: on.}
+type Unchecked {.unchecked.} = array[0, char]
+
+var x = cast[ptr Unchecked](alloc(100))
+x[5] = 'x'
diff --git a/tests/metatype/ttypedesc2.nim b/tests/metatype/ttypedesc2.nim
index e576ec91a..7650a6f6b 100644
--- a/tests/metatype/ttypedesc2.nim
+++ b/tests/metatype/ttypedesc2.nim
@@ -18,11 +18,10 @@ when true:
       uoffset_t* = uint32
       FlatBufferBuilder* = object
 
-      uarray* {.unchecked.} [T]  = array [0..0, T]
       Array* [T] = object
           o*: uoffset_t
           len*: int
-          data*: ptr uarray[T]
+          data*: ptr UncheckedArray[T]
 
   proc ca* (fbb: ptr FlatBufferBuilder, T: typedesc, len: int): Array[T] {.noinit.} =
       result.len = len