From 9b2115558b0146979503a40cb8fbe5722ba262ab Mon Sep 17 00:00:00 2001 From: Ganesh Viswanathan Date: Wed, 12 Sep 2018 12:00:01 -0500 Subject: [PATCH 1/2] Test cases for #6969 #7346 #7581 --- tests/seq/t7346.nim | 10 ++++++++++ tests/types/t6969.nim | 10 ++++++++++ tests/types/t7581.nim | 1 + 3 files changed, 21 insertions(+) create mode 100644 tests/seq/t7346.nim create mode 100644 tests/types/t6969.nim create mode 100644 tests/types/t7581.nim diff --git a/tests/seq/t7346.nim b/tests/seq/t7346.nim new file mode 100644 index 0000000000..ef2fd5b799 --- /dev/null +++ b/tests/seq/t7346.nim @@ -0,0 +1,10 @@ +when not defined(nimNewRuntime): + {.error: "This bug could only be reproduced with --newruntime".} + +type + Obj = object + a: int + +proc `=`(a: var Obj, b: Obj) = discard + +let a: seq[Obj] = @[] \ No newline at end of file diff --git a/tests/types/t6969.nim b/tests/types/t6969.nim new file mode 100644 index 0000000000..d6ce5e62af --- /dev/null +++ b/tests/types/t6969.nim @@ -0,0 +1,10 @@ +discard """ +errormsg: "invalid type: 'object' for var" +line: 6 +""" + +var a: object a: int +# or +var b: ref object a: int +# or +var c: ptr object a: int \ No newline at end of file diff --git a/tests/types/t7581.nim b/tests/types/t7581.nim new file mode 100644 index 0000000000..796f30271e --- /dev/null +++ b/tests/types/t7581.nim @@ -0,0 +1 @@ +discard int -1 \ No newline at end of file From f4356d611585a49de7bce893378c1a997b868005 Mon Sep 17 00:00:00 2001 From: Ganesh Viswanathan Date: Wed, 12 Sep 2018 12:58:50 -0500 Subject: [PATCH 2/2] Fix system.nim line number test case failure --- tests/assert/tfailedassert_stacktrace.nim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/assert/tfailedassert_stacktrace.nim b/tests/assert/tfailedassert_stacktrace.nim index a3edeb9bfc..43171ef6c8 100644 --- a/tests/assert/tfailedassert_stacktrace.nim +++ b/tests/assert/tfailedassert_stacktrace.nim @@ -2,9 +2,9 @@ discard """ output: ''' tfailedassert_stacktrace.nim(16) tfailedassert_stacktrace tfailedassert_stacktrace.nim(15) foo -system.nim(3777) failedAssertImpl -system.nim(3770) raiseAssert -system.nim(2817) sysFatal +system.nim(3778) failedAssertImpl +system.nim(3771) raiseAssert +system.nim(2818) sysFatal ''' """