Skip to content

Commit e6ed74c

Browse files
author
Markus Sutter
committed
Add person readable toString for PositionBridge
There are compile call paths relying on meaningful toString impl. for error/warning log messages. Therefor lets add toString, which is: "concise but informative representation that is easy for a person to read." Without this, e.g. users of https://github.com/davidB/scala-maven-plugin get unsuitable compile problems like: [Warn] dotty.tools.xsbt.PositionBridge@4fbdc20: match may not be exhaustive.... Example call path: log:45, SbtLogger (sbt_inc) log:47, Logger (sbt.util) warn:43, Logger (sbt.util) logWarning:159, LoggedReporter (sbt.internal.inc) display:168, LoggedReporter (sbt.internal.inc) log:142, LoggedReporter (sbt.internal.inc) doReport:43, DelegatingReporter (dotty.tools.xsbt) report:150, Reporter (dotty.tools.dotc.reporting) issueWarning:32, report$ (dotty.tools.dotc) warning:67, report$ (dotty.tools.dotc) checkExhaustivity:847, SpaceEngine (dotty.tools.dotc.transform.patmat) ....
1 parent 45bf7c4 commit e6ed74c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

+5
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,9 @@ public Optional<String> pointerSpace() {
116116
result.append(lineContent.charAt(i) == '\t' ? '\t' : ' ');
117117
return Optional.of(result.toString());
118118
}
119+
120+
@Override
121+
public String toString() {
122+
return pos;
123+
}
119124
}

0 commit comments

Comments
 (0)