mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-10 15:04:59 +00:00
17 lines
383 B
Nim
17 lines
383 B
Nim
discard """
|
|
errormsg: "type mismatch: got <int>"
|
|
nimout: '''tprevent_forloopvar_mutations.nim(16, 3) Error: type mismatch: got <int>
|
|
but expected one of:
|
|
proc inc[T, V: Ordinal](x: var T; y: V = 1)
|
|
first type mismatch at position: 1
|
|
required type for x: var T: Ordinal
|
|
but expression 'i' is immutable, not 'var'
|
|
|
|
expression: inc i
|
|
'''
|
|
"""
|
|
|
|
for i in 0..10:
|
|
echo i
|
|
inc i
|