summary refs log tree commit diff stats
path: root/tests/system/tensuremove2.nim
blob: 39bbeb22e753af002dd57fb94659ef62f0513925 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
discard """
  errormsg: "Nested expressions cannot be moved: 'if true: s else: String()'"
"""

type
  String = object
    id: string

proc hello =
  var s = String(id: "1")
  var m = ensureMove(if true: s else: String())
  discard m
  discard s

hello()