summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2019-08-24 06:25:47 +0200
committerGitHub <noreply@github.com>2019-08-24 06:25:47 +0200
commitce7f29e8e6628df209ecebb566f9cefc14243aaf (patch)
treee70a04d3bd577274ea5b0380f76043402b596fdc /tests
parentf2e8c39e851b1d1f55d387d80ae3d9f598a6ef0e (diff)
downloadNim-ce7f29e8e6628df209ecebb566f9cefc14243aaf.tar.gz
fixes #11833 (#12018)
Diffstat (limited to 'tests')
-rw-r--r--tests/destructor/tnewruntime_misc.nim8
-rw-r--r--tests/destructor/tv2_cast.nim3
-rw-r--r--tests/errmsgs/twrong_at_operator.nim4
3 files changed, 11 insertions, 4 deletions
diff --git a/tests/destructor/tnewruntime_misc.nim b/tests/destructor/tnewruntime_misc.nim
index c5f978a98..d6c03b9b0 100644
--- a/tests/destructor/tnewruntime_misc.nim
+++ b/tests/destructor/tnewruntime_misc.nim
@@ -75,5 +75,13 @@ proc selfAssign =
 
 selfAssign()
 
+# bug #11833
+type FooAt = object
+
+proc testWrongAt() =
+  var x = @[@[FooAt()]]
+
+testWrongAt()
+
 let (a, d) = allocCounters()
 discard cprintf("%ld  new: %ld\n", a - unpairedEnvAllocs() - d, allocs)
diff --git a/tests/destructor/tv2_cast.nim b/tests/destructor/tv2_cast.nim
index 8a4d69ef0..9c05b2ae1 100644
--- a/tests/destructor/tv2_cast.nim
+++ b/tests/destructor/tv2_cast.nim
@@ -2,7 +2,6 @@ discard """
   cmd: '''nim c --newruntime $file'''
   output: '''@[1]
 @[116, 101, 115, 116]
-test
 @[1953719668, 875770417]'''
 """
 
@@ -13,7 +12,7 @@ echo cast[seq[uint8]](@[1])
 echo cast[seq[uint8]]("test")
 
 discard cast[string](@[116'u8, 101, 115, 116])
-echo cast[string](@[116'u8, 101, 115, 116])
+#echo cast[string](@[116'u8, 101, 115, 116, 0])
 var a = cast[seq[uint32]]("test1234")
 a.setLen(2)
 echo a
diff --git a/tests/errmsgs/twrong_at_operator.nim b/tests/errmsgs/twrong_at_operator.nim
index 7ce077003..edf584094 100644
--- a/tests/errmsgs/twrong_at_operator.nim
+++ b/tests/errmsgs/twrong_at_operator.nim
@@ -8,9 +8,9 @@ proc `@`[T](a: openArray[T]): seq[T]
   first type mismatch at position: 1
   required type for a: openarray[T]
   but expression '[int]' is of type: array[0..0, type int]
-proc `@`[IDX, T](a: array[IDX, T]): seq[T]
+proc `@`[IDX, T](a: sink array[IDX, T]): seq[T]
   first type mismatch at position: 1
-  required type for a: array[IDX, T]
+  required type for a: sink array[IDX, T]
   but expression '[int]' is of type: array[0..0, type int]
 
 expression: @[int]