summary refs log tree commit diff stats
path: root/tests/vm/teval1.nim
blob: 5c323f0e70d355f833d7ed53a7ecb26a80118b80 (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
discard """
nimout: "##"
"""

import macros

proc testProc: string {.compileTime.} =
  result = ""
  result = result & ""

when true:
  macro test(n: untyped): untyped =
    result = newNimNode(nnkStmtList)
    echo "#", testProc(), "#"
  test:
    "hi"

const
  x = testProc()

doAssert x == ""

# bug #1310
static:
  var i, j: set[int8] = {}
  var k = i + j