Merge pull request #8956 from genotrance/devel

Test cases for #6969 #7346 #7581
This commit is contained in:
LemonBoy
2018-09-12 20:59:01 +02:00
committed by GitHub
4 changed files with 24 additions and 3 deletions

View File

@@ -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
'''
"""

10
tests/seq/t7346.nim Normal file
View File

@@ -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] = @[]

10
tests/types/t6969.nim Normal file
View File

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

1
tests/types/t7581.nim Normal file
View File

@@ -0,0 +1 @@
discard int -1