Files
Nim/tests/misc/t9091.nim
Timothee Cour a36efb59b5 fix #16256: nimout: <empty> should give error (vacuously true); improve a few tests (#18089)
* fix #16256: nimout: <empty> should give error (vacuously true); improve some tests

* renamed:    tests/stdlib/t9710.nim -> tests/misc/t9710.nim

* improve tests

* fix non-DRY tests

* improve $nim_prs_D/tests/stdlib/t9091.nim

* renamed:    tests/stdlib/t9091.nim -> tests/misc/t9091.nim

* fixup

* address comment: doAssert => result.parseErrors
2021-05-31 13:39:19 +02:00

34 lines
456 B
Nim

# bug #9091
import streams
block:
type Mine = ref object
a: int
proc write(io: Stream, t: Mine) =
io.write("sure")
let str = newStringStream()
let mi = new Mine
str.write(mi)
str.setPosition 0
doAssert str.readAll == "sure"
block:
type
AObj = object
x: int
proc foo(a: int): string = ""
proc test(args: varargs[string, foo]) =
doAssert false
proc test(a: AObj) =
discard
let x = AObj()
test(x)