tsetlen_invalidates.nim 521 B

123456789101112131415161718192021222324252627
  1. discard """
  2. nimout: '''tsetlen_invalidates.nim(12, 10) Warning: BEGIN [User]
  3. tsetlen_invalidates.nim(18, 12) Warning: cannot prove: 0 <= len(a) + -1; counter example: a`1.len -> 0
  4. a.len -> 1 [IndexCheck]
  5. tsetlen_invalidates.nim(26, 10) Warning: END [User]
  6. '''
  7. cmd: "drnim $file"
  8. action: "compile"
  9. """
  10. {.push staticBoundChecks: defined(nimDrNim).}
  11. {.warning: "BEGIN".}
  12. proc p() =
  13. var a = newSeq[int](3)
  14. if a.len > 0:
  15. a.setLen 0
  16. echo a[0]
  17. if a.len > 0:
  18. echo a[0]
  19. {.pop.}
  20. p()
  21. {.warning: "END".}