tldconst.nim 230 B

123456789101112131415
  1. # Passes if it compiles
  2. # From issue #1946
  3. type
  4. Part = object
  5. index: int ## array index of argument to be accessed
  6. proc foobar(): int =
  7. var x: Part
  8. if x.index < high(int):
  9. discard
  10. 0
  11. const x = foobar()