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

Bad related error location for inlined conjunct

RustanLeino opened this issue · comments

Dafny version

4.7.0

Code to produce this issue

trait Trait { }

class Class extends Trait { }

predicate P(t: Trait) {
  t is Class
}

method M(u: Trait) {
  assert P(u);
}

Command to run and resulting output

% dafny verify test.dfy
test.dfy(10,9): Error: assertion might not hold
   |
10 |   assert P(u);
   |          ^^^^

test.dfy(10,11): Related location: this proposition could not be proved
   |
10 |   assert P(u);
   |            ^


Dafny program verifier finished with 0 verified, 1 error

What happened?

The related error location points to the actual argument of predicate P, rather than the is conjunct inside P.

(Error reported by @erniecohen via @ssomayyajula.)

What type of operating system are you experiencing the problem on?

Mac