File tree 2 files changed +13
-4
lines changed
sbt-dotty/sbt-test/compilerReporter/simple/project
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() {
88
88
else return Optional .ofNullable (src .file ().path ());
89
89
}
90
90
public Optional <Integer > line () {
91
- int line = pos .line ();
91
+ int line = pos .line () + 1 ;
92
92
if (line == -1 ) return Optional .empty ();
93
93
else return Optional .of (line );
94
94
}
Original file line number Diff line number Diff line change @@ -29,9 +29,18 @@ object Reporter {
29
29
println(problems.toList)
30
30
assert(problems.size == 1 )
31
31
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))
35
44
36
45
assert(problems.count(_.severity == Severity .Error ) == 1 ) // not found: er1,
37
46
}).value
You can’t perform that action at this time.
0 commit comments