File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed
sbt-dotty/sbt-test/compilerReporter/simple/project Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ public Optional<String> sourcePath() {
8888 else return Optional .ofNullable (src .file ().path ());
8989 }
9090 public Optional <Integer > line () {
91- int line = pos .line ();
91+ int line = pos .line () + 1 ;
9292 if (line == -1 ) return Optional .empty ();
9393 else return Optional .of (line );
9494 }
Original file line number Diff line number Diff line change @@ -29,9 +29,18 @@ object Reporter {
2929 println(problems.toList)
3030 assert(problems.size == 1 )
3131
32- // Assert disabled because we don't currently pass positions to sbt
33- // See https://github.com/lampepfl/dotty/pull/2107
34- // assert(problems.forall(_.position.offset.isDefined))
32+ // make sure position reported by zinc are proper
33+ val mainProblem = problems.head
34+
35+ val line = mainProblem.position().line()
36+ assert(line.isPresent() == true )
37+ assert(line.get() == 9 )
38+
39+ val pointer = mainProblem.position().pointer()
40+ assert(pointer.isPresent() == true )
41+ assert(pointer.get() == 10 )
42+
43+ assert(problems.forall(_.position.offset.isPresent))
3544
3645 assert(problems.count(_.severity == Severity .Error ) == 1 ) // not found: er1,
3746 }).value
You can’t perform that action at this time.
0 commit comments