-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unclear error reporting on non-static resources in static context #463
Comments
It seems there are two issues here:
The first one is straightforward to fix, the second one I'm not so sure. Altough it is fixed indirectly by not letting unexpected errors propagate to the back-end. It seems that generally a faulty satcheck error indicates some error in the frontend was missed by vercors and caught by viper. I think this happened a few times before, where some unrelated (syntax?) error in the spec triggered the method spec unsound. Maybe we should investigate if we can implement satcheck differently. One option (probably the most elegant) would be to implement Related: #469 |
I agree with most of what you say. However, note that I also get "ApplicationPreCondition:AssertionFalse". So it is not just the satcheck that that has the issue, the "regular" verification also turns the viper error into an unrelated error. |
Let's keep this issue for the strange error translation, I'll make a new one for the type check part. |
Bob mentioned that the unsound error is also due to the way we check for preconditions unsoundness, so this issue is actually threefold. |
The decided way forward is the following: |
fix #463: consider whether the context is static
I have a class
A
containing a resourcex
. I used that resource successfully withinA
, e.g. as a requirement for a pure functionfoo
:I then tried to use it in another class in the contract of a method
bar
:I got "ApplicationPreCondition:AssertionFalse" on the call to
foo
(i.e. no error reported onA.x()
), and "MethodPreConditionUnsound:MethodPreConditionFalse" on the whole methodbar
.Looking at the Viper output, it reports that
x
andfoo
have the wrong parameter count. In fact, they are defined as non-static, and thus invoking them asA.x()
andA.foo()
means lacking an implicitthis
argument. Making them static resolved the issue.I find the VerCors error messages rather misleading, as they seem to indicate a logical error (such as contradictory conditions) when it is actually a syntactic error. It would be nice if the Viper error message, which is more indicative of the real issue, could be propagated to the user.
The text was updated successfully, but these errors were encountered: