Skip to content

Commit fcd837a

Browse files
authored
Merge pull request #12735 from mims-github/fix-PositionBridge-toString
Fix toString for PositionBridge
2 parents fe2fcc4 + 8165f99 commit fcd837a

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

compiler/src/dotty/tools/dotc/util/SourcePosition.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ extends SrcPos, interfaces.SourcePosition, Showable {
6868
if outer == null || outer == NoSourcePosition then this else outer.outermost
6969

7070
/** Inner most position that is contained within the `outermost` position.
71-
* Most precise position that that comes from the call site.
71+
* Most precise position that comes from the call site.
7272
*/
7373
def nonInlined: SourcePosition = {
7474
val om = outermost

sbt-bridge/src/dotty/tools/xsbt/PositionBridge.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ public Optional<Integer> pointer() {
3939
public Optional<String> pointerSpace() {
4040
return Optional.empty();
4141
}
42+
43+
public String toString() {
44+
return "";
45+
}
4246
};
4347

4448
public PositionBridge(SourcePosition pos, SourceFile src) {
@@ -116,4 +120,9 @@ public Optional<String> pointerSpace() {
116120
result.append(lineContent.charAt(i) == '\t' ? '\t' : ' ');
117121
return Optional.of(result.toString());
118122
}
123+
124+
@Override
125+
public String toString() {
126+
return pos.toString();
127+
}
119128
}

0 commit comments

Comments
 (0)