We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c679218 commit 658eb4bCopy full SHA for 658eb4b
src/dotty/tools/dotc/util/Positions.scala
@@ -164,7 +164,9 @@ object Positions {
164
165
/** An index coordinate */
166
implicit def indexCoord(n: Int): Coord = new Coord(n + 1)
167
- implicit def positionCoord(pos: Position): Coord = new Coord(-(pos.point + 1))
+ implicit def positionCoord(pos: Position): Coord =
168
+ if (pos.exists) new Coord(-(pos.point + 1))
169
+ else NoCoord
170
171
/** A sentinel for a missing coordinate */
172
val NoCoord = new Coord(0)
0 commit comments