Open
Description
The presentation compiler reports the type-mismatch error at an offset position, causing the error annotation in the IDE to be just one character.
For example,
val foo: List[Int] = List(1).map(_.toString)
Will issue the error at the application of map
, using an offset position.
The alternative is to parse around that point in the IDE, but the proper solution would be to use a range position.
I investigated a bit and here's what I found:
- the tree position is already an offset position at the point where the error is issued
- the offset position is related to filled-in implicits. The following code shows the same positioning (though simpler example, with type parameters or not, position the error at a range)
def bar(x: Int)(implicit imp: Int) = x
implicit val impimp = 42
val sss: String = bar(1)
See also PR 759