File tree Expand file tree Collapse file tree 4 files changed +27
-2
lines changed
compiler/src/dotty/tools/dotc/core/tasty Expand file tree Collapse file tree 4 files changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -152,6 +152,16 @@ class TastyPrinter(bytes: Array[Byte]) {
152152 sb.append(treeStr(" %10d" .format(addr.index)))
153153 sb.append(s " : ${offsetToInt(pos.start)} .. ${pos.end}\n " )
154154 }
155+
156+ val sources = posUnpickler.sourcePaths
157+ sb.append(s " \n source paths: \n " )
158+ val sortedPath = sources.toSeq.sortBy(_._1.index)
159+ for ((addr, path) <- sortedPath) {
160+ sb.append(treeStr(" %10d: " .format(addr.index)))
161+ sb.append(path)
162+ sb.append(" \n " )
163+ }
164+
155165 sb.result
156166 }
157167 }
Original file line number Diff line number Diff line change @@ -33,10 +33,18 @@ clear_out "$OUT"
3333" $SBT " " ;scalac -d $OUT /out.jar $SOURCE ; scalac -decompile -color:never $OUT /out.jar" > " $tmp "
3434grep -qe " def main(args: scala.Array\[scala.Predef.String\]): scala.Unit =" " $tmp "
3535
36+
3637echo " testing that paths SourceFile annotations are relativized"
3738clear_out " $OUT "
38- " $SBT " " ;scalac -d $OUT /out.jar $( pwd) /$SOURCE ; scalac -decompile -color:never $OUT /out.jar" > " $tmp "
39- grep -qe " SourceFile(\" $SOURCE \" )" " $tmp "
39+ " $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+
4048
4149echo " testing sbt scalac with suspension"
4250clear_out " $OUT "
Original file line number Diff line number Diff line change 1+ object App {
2+ val y = lib.double(5 )
3+ println(y)
4+ }
Original file line number Diff line number Diff line change 1+ object lib {
2+ inline def double (x : Int ): Int = x * x
3+ }
You can’t perform that action at this time.
0 commit comments