tlateboundstatic.nim 229 B

1234567891011121314151617
  1. discard """
  2. nimout: "array[0..3, int]"
  3. """
  4. type
  5. KK[I: static[int]] = object
  6. x: array[I, int]
  7. proc foo(a: static[string]): KK[a.len] =
  8. result.x[0] = 12
  9. var x = foo "test"
  10. import typetraits
  11. static: echo x.x.type.name