summary refs log tree commit diff stats
path: root/tests/js/tbasics.nim
blob: 0c8d33e7fd006ad6ec6984246f0506303a2af94c (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
31
32
33
34
35
36
37
discard """
  output: '''ABCDC
1
14
ok'''
"""

type
  MyEnum = enum
    A,B,C,D
# trick the optimizer with an seq:
var x = @[A,B,C,D]
echo x[0],x[1],x[2],x[3],MyEnum(2)

# bug #10651

var xa: seq[int]
var ya = @[1,2]
xa &= ya
echo xa[0]

proc test =
  var yup: seq[int]
  try:
    yup.add 14
    echo yup.pop
  finally:
    discard

test()

when true:
  var a: seq[int]

  a.setLen(0)

  echo "ok"