summary refs log tree commit diff stats
path: root/tests/varres/tprevent_forloopvar_mutations.nim
blob: 43cc04f308d35648e98fed0bbb4405426b311ff5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
discard """
  errmsg: "type mismatch: got <int>"
  line: 15
  nimout: '''type mismatch: got <int>
but expected one of:
proc inc[T: Ordinal | uint | uint64](x: var T; y = 1)
  for a 'var' type a variable needs to be passed, but 'i' is immutable

expression: inc i
'''
"""

for i in 0..10:
  echo i
  inc i