silver
silver copied to clipboard
Add full term to [type] error report
Created by bitbucket user juhaszu on 2014-11-03 11:14 Last updated on 2017-11-26 14:45
Currently we report a type error using the first character of the offending expression.
This can lead to some confusing messages - e.g.:
p:Perm q:Perm q := p\2
Here we would get two error messages pointing at the same location: "expected Int but got Perm" (for p) "expected Perm but got Int" (p\2)
Currently we can report start and end points, but not the actual text of the offending expression.
I would suggest including in type errors (and maybe others) the full text of the offending expression
@mschwerhoff commented on 2014-11-03 13:16
I contacted Tony Sloane (the guy behind Kiama) and asked him if it is possible to get the original input that gave rise to a parsed node, here is the corresponding mailing list thread. Looks as if it will be possible with the upcoming release.
@mschwerhoff commented on 2017-11-26 14:45
At the time of writing, parsing
method test() {
var p: Bool
var q: Bool
q := p/2
}
yielded the error message Type error in the expression at file.sil@[4.8-4.11]
.
@mschwerhoff on 2017-11-26 14:45:
- edited the description
- changed
priority
frommajor
tominor
- changed
component
from(none)
toParser