texplicitprocparams.nim 278 B

1234567891011121314151617181920
  1. discard """
  2. output: '''
  3. (x: 100)
  4. 5
  5. '''
  6. """
  7. type
  8. OdArray*[As: static[int], T] = object
  9. x: int
  10. proc initOdArray*[As: static[int], T](len: int): OdArray[As, T] =
  11. result.x = len
  12. echo initOdArray[10, int](100)
  13. proc doStatic[N: static[int]](): int = N
  14. echo doStatic[5]()