summary refs log tree commit diff stats
path: root/tests/ccgbugs/tmissinginit.nim
blob: d440608e6597fc003fd1c0b5c12b7974c8809f5f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
discard """
  output: '''0
0
0
0
[[a = nil,
b = nil]]'''
"""

# bug #1475
type
  Crash = object
    a: string
    b: seq[string]

proc initCrash(): Crash = discard

proc test() =
  var blongname = [initCrash()]
  echo repr(blongname)

# bug #1434
proc bug: array[1, int] = discard

echo bug()[0]
echo bug()[0]
echo bug()[0]
echo bug()[0]

when isMainModule: test()