Skip to content

Commit

Permalink
Decrease DelegatingReporter suppression zone
Browse files Browse the repository at this point in the history
  • Loading branch information
dwijnand authored and Xavientois committed Feb 2, 2022
1 parent 903da50 commit 195e887
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import core.Contexts._
* are suppressed, unless they are of increasing severity. */
trait UniqueMessagePositions extends Reporter {

private val positions = new mutable.HashMap[(SourceFile, Int), Diagnostic]
private val positions = new mutable.HashMap[(SourceFile, Integer), Diagnostic]

/** Logs a position and returns true if it was already logged.
* @note Two positions are considered identical for logging if they have the same point.
Expand Down
15 changes: 11 additions & 4 deletions sbt-bridge/src/dotty/tools/xsbt/DelegatingReporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
*/
package dotty.tools.xsbt;

import scala.Tuple2;
import scala.collection.mutable.HashMap;

import dotty.tools.dotc.core.Contexts.Context;
import dotty.tools.dotc.reporting.AbstractReporter;
import dotty.tools.dotc.reporting.Diagnostic;
import dotty.tools.dotc.reporting.Message;
import dotty.tools.dotc.util.SourceFile;
import dotty.tools.dotc.util.SourcePosition;
import xsbti.Position;
import xsbti.Severity;

// sbt-bridge/src/dotty/tools/xsbt/DelegatingReporter.java:14:1: dotty$tools$dotc$reporting$UniqueMessagePositions$$positions() in dotty.tools.dotc.reporting.AbstractReporter implements dotty$tools$dotc$reporting$UniqueMessagePositions$$positions() in dotty.tools.dotc.reporting.UniqueMessagePositions
// return type requires unchecked conversion from scala.collection.mutable.HashMap to scala.collection.mutable.HashMap<scala.Tuple2<dotty.tools.dotc.util.SourceFile,java.lang.Object>,dotty.tools.dotc.reporting.Diagnostic>
@SuppressWarnings("unchecked")

final public class DelegatingReporter extends AbstractReporter {
private xsbti.Reporter delegate;

Expand Down Expand Up @@ -66,4 +66,11 @@ private static Position positionOf(SourcePosition pos) {
return PositionBridge.noPosition;
}
}

@SuppressWarnings("unchecked")
// [warn] sbt-bridge/src/dotty/tools/xsbt/DelegatingReporter.java:18:1: dotty$tools$dotc$reporting$UniqueMessagePositions$$positions() in dotty.tools.dotc.reporting.AbstractReporter implements dotty$tools$dotc$reporting$UniqueMessagePositions$$positions() in dotty.tools.dotc.reporting.UniqueMessagePositions
// [warn] return type requires unchecked conversion from scala.collection.mutable.HashMap to scala.collection.mutable.HashMap<scala.Tuple2<dotty.tools.dotc.util.SourceFile,java.lang.Integer>,dotty.tools.dotc.reporting.Diagnostic>
public HashMap<Tuple2<SourceFile, Integer>, Diagnostic> dotty$tools$dotc$reporting$UniqueMessagePositions$$positions() {
return (HashMap<Tuple2<SourceFile, Integer>, Diagnostic>) super.dotty$tools$dotc$reporting$UniqueMessagePositions$$positions();
}
}

0 comments on commit 195e887

Please sign in to comment.