File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
compiler/src/dotty/tools/dotc/util Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -100,13 +100,18 @@ object Positions {
100100
101101 /** A copy of this position with a different start */
102102 def withStart (start : Int ) =
103- fromOffsets(start, this .end, if (isSynthetic) SyntheticPointDelta else this .point - start)
103+ if (exists) fromOffsets(start, this .end, if (isSynthetic) SyntheticPointDelta else this .point - start)
104+ else this
104105
105106 /** A copy of this position with a different end */
106- def withEnd (end : Int ) = fromOffsets(this .start, end, pointDelta)
107+ def withEnd (end : Int ) =
108+ if (exists) fromOffsets(this .start, end, pointDelta)
109+ else this
107110
108111 /** A copy of this position with a different point */
109- def withPoint (point : Int ) = fromOffsets(this .start, this .end, point - this .start)
112+ def withPoint (point : Int ) =
113+ if (exists) fromOffsets(this .start, this .end, point - this .start)
114+ else this
110115
111116 /** A synthetic copy of this position */
112117 def toSynthetic = if (isSynthetic) this else Position (start, end)
You can’t perform that action at this time.
0 commit comments