Span of type error in contracts could be narrowed #3009
Labels
[C] Feature / Enhancement
A new feature request or enhancement to an existing feature.
T-User
Tag user issues / requests
Z-Contracts
Issue related to code contracts
Milestone
I was having a go at transcribing the example from the recent blog post, and I encountered a sub-optimal diagnostic issue.
Test case:
The above currently generates the following from Kani:
(I'm not sure why it prints two copies of the error message.)
I had a hard time seeing what was wrong, since the highlighted span was overly broad.
If you were to encode the contract as an assertion at the end of the method body and then invoke rustc, it produces a more precise diagnostic message:
You can see how this more immediately reveals the source of the problem.
The text was updated successfully, but these errors were encountered: