dafny-lang / dafny

Dafny is a verification-aware programming language

Home Page:https://dafny.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Better path error reporting

keyboardDrummer opened this issue · comments

Dafny currently may, when postconditions can not be proven, report a specific return location where those could not be proven, in case there are different return locations. However, this does not always work reliably, like here, where we would hope the error is shown in the then branch of the if:

image

In other cases, the error only occurs for a specific path, but for all return locations, like here:

image

So Dafny will not indicate a useful path location by design.

A better UX might be that if only particular branches lead to the exception, that Dafny would tag these branches as related locations.