File tree Expand file tree Collapse file tree 2 files changed +15
-11
lines changed
compiler/src/dotty/tools/dotc/util Expand file tree Collapse file tree 2 files changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -219,10 +219,8 @@ object SourceFile {
219219 val jpath = file.jpath
220220 if jpath eq null then
221221 file.path // repl and other custom tests use abstract files with no path
222- else if jpath.isAbsolute then
223- sourcerootPath.relativize(jpath.normalize).toString
224222 else
225- jpath.normalize.toString
223+ sourcerootPath.relativize( jpath.toAbsolutePath. normalize) .toString
226224 }
227225}
228226
Original file line number Diff line number Diff line change @@ -37,14 +37,20 @@ grep -qe "def main(args: scala.Array\[scala.Predef.String\]): scala.Unit =" "$tm
3737echo " testing that paths SourceFile annotations are relativized"
3838clear_out " $OUT "
3939" $SBT " " scalac -d $OUT /out.jar -sourceroot tests/pos $( pwd) /tests/pos/i10430/lib.scala $( pwd) /tests/pos/i10430/app.scala"
40- " $SBT " " scalac -decompile -color:never $OUT /out.jar" > " $tmp "
41- grep -qe " : lib.scala" " $tmp "
42- grep -qe " : app.scala" " $tmp "
43- grep -qe " [lib.scala]" " $tmp "
44- grep -qe " [app.scala]" " $tmp "
45- grep -v " tests/pos/i10430/lib.scala" " $tmp "
46- grep -v " tests/pos/i10430/app.scala" " $tmp "
47-
40+ " $SBT " " scalac -decompile -print-tasty -color:never $OUT /out.jar" > " $tmp "
41+ cat " $tmp " # for debugging
42+ grep -q " : i10430/lib.scala" " $tmp "
43+ grep -q " : i10430/app.scala" " $tmp "
44+ grep -q " [i10430/lib.scala]" " $tmp "
45+ grep -q " [i10430/app.scala]" " $tmp "
46+ if grep -q " tests/pos/i10430/lib.scala" " $tmp " ; then
47+ echo " incorrect source file path in tasty"
48+ exit 1
49+ fi
50+ if grep -q " tests/pos/i10430/app.scala" " $tmp " ; then
51+ echo " incorrect source file path in tasty"
52+ exit 1
53+ fi
4854
4955echo " testing sbt scalac with suspension"
5056clear_out " $OUT "
You can’t perform that action at this time.
0 commit comments