Errror indicator covers too much in case of double definition of a val/def
In case of double definition of a val (or local def) Eclipse's error indicator covers the whole definition instead of just the identifier (which is the real problem). See the screenshot attached.
I asked Adriaan about this and he said that what IDE is probably doing is displaying an error using range positions of the tree with an error. Here, the error is set for ValDef/DefDef and rangepos covers also right hand side of val/def. What should happen is that in case of error set for valdef/defdef tree node you should take position of left hand side and display an error for it. This is always safe to do because if the error is somewhere on rhs you'll get an error attached somewhere there.
I asked Adriaan about this and he said that what IDE is probably doing is displaying an error using range positions of the tree with an error. Here, the error is set for ValDef/DefDef and rangepos covers also right hand side of val/def. What should happen is that in case of error set for valdef/defdef tree node you should take position of left hand side and display an error for it. This is always safe to do because if the error is somewhere on rhs you'll get an error attached somewhere there.
Leave a comment