Better type error reporting#684
Conversation
fpoli
left a comment
There was a problem hiding this comment.
Someone should probably run an auto formatter on these files at some point; spaces around symbols are not used uniformly.
That means that the position of the errors is now I find it unusual and perhaps a bit confusing that the errors are precise about the types but not about the positions. The actual expressions that have type With the imprecise error positions, I would prefer an error message saying "Type error in a subexpression of ..." to remember that I should check all the arguments myself. |
Positions are also fixed now. New output: |
Addressing issue #642 (at least in most cases).
For the example in #642, Viper now reports
Additionally, in some cases, Viper used to mention internal type variables in error messages, e.g.
Expected type Ref, but found #R#1451 at the expression at test.vpr@15.8 (test.vpr@15.8--15.11). This PR fixes that to beExpected type Ref, but found Foo[Bool, Perm] at the expression at test.vpr@17.6 (test.vpr@17.6--17.17)instead.