Files
Nim/drnim/tests/tsetlen_invalidates.nim
Andreas Rumpf 3a2697dd73 drnim: tiny progress (#13882)
* drnim: tiny progress
* refactoring complete
* drnim: prove .ensures annotations
* Moved code around to avoid code duplication
* drnim: first implementation of the 'old' property
* drnim: be precise about the assignment statement
* first implementation of --assumeUnique
* progress on forall/exists handling
2020-04-15 20:03:25 +02:00

27 lines
521 B
Nim

discard """
nimout: '''tsetlen_invalidates.nim(12, 10) Warning: BEGIN [User]
tsetlen_invalidates.nim(18, 12) Warning: cannot prove: 0 <= len(a) + -1; counter example: a`1.len -> 0
a.len -> 1 [IndexCheck]
tsetlen_invalidates.nim(26, 10) Warning: END [User]
'''
cmd: "drnim $file"
action: "compile"
"""
{.push staticBoundChecks: defined(nimDrNim).}
{.warning: "BEGIN".}
proc p() =
var a = newSeq[int](3)
if a.len > 0:
a.setLen 0
echo a[0]
if a.len > 0:
echo a[0]
{.pop.}
p()
{.warning: "END".}