summary refs log blame commit diff stats
path: root/tests/casestmt/t18964.nim
blob: 1d2de2bbc7f5ba31a7b92db6330002baf04193e6 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12











                                                                        
discard """
errormsg: "invalid order of case branches"
"""

import macros

macro genCase(val: string): untyped =
  result = nnkCaseStmt.newTree(val,
    nnkElse.newTree(quote do: echo "else"),
    nnkOfBranch.newTree(newLit("miauz"), quote do: echo "first branch"))

genCase("miauz")