summary refs log tree commit diff stats
path: root/tests/int/twrongexplicitvarconv.nim
blob: 79f770e8e9a297d19267d21d253556781128fa88 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
discard """
  action: reject
  nimout: '''
  but expression 'int(a)' is immutable, not 'var'
'''
"""

proc `++`(n: var int) =
  n += 1

var a: int32 = 15

++int(a) #[tt.Error
^ type mismatch: got <int>]#

echo a