mirror of
https://github.com/nim-lang/Nim.git
synced 2026-09-17 18:44:53 +00:00
21 lines
475 B
Nim
21 lines
475 B
Nim
discard """
|
|
targets: "c cpp"
|
|
matrix: "--mm:refc; --mm:orc"
|
|
ccodeCheck: "\\i !@('W T' \\d+ '_;')"
|
|
"""
|
|
|
|
type W {.exportc.} = object
|
|
data: array[1000, byte]
|
|
items: seq[int]
|
|
|
|
# bug #26119: assigning a try expression directly to the result must not leave
|
|
# an unused temporary of the result type in the generated procedure.
|
|
proc y(): W {.exportc.} =
|
|
try:
|
|
default(W)
|
|
except CatchableError:
|
|
default(W)
|
|
|
|
var v = y()
|
|
doAssert v.data[0] == 0 and v.items.len == 0
|