Generic inference restrictions

The types var T, out T and typedesc[T] cannot be inferred in a generic instantiation. The following is not allowed:

  1. proc g[T](f: proc(x: T); x: T) =
  2. f(x)
  3. proc c(y: int) = echo y
  4. proc v(y: var int) =
  5. y += 100
  6. var i: int
  7. # allowed: infers 'T' to be of type 'int'
  8. g(c, 42)
  9. # not valid: 'T' is not inferred to be of type 'var int'
  10. g(v, i)
  11. # also not allowed: explicit instantiation via 'var int'
  12. g[var int](v, i)