twrongexplicitvarconv.nim 212 B

1234567891011121314151617
  1. discard """
  2. action: reject
  3. nimout: '''
  4. but expression 'int(a)' is immutable, not 'var'
  5. '''
  6. """
  7. proc `++`(n: var int) =
  8. n += 1
  9. var a: int32 = 15
  10. ++int(a) #[tt.Error
  11. ^ type mismatch: got <int>]#
  12. echo a