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]) {
152
152
sb.append(treeStr(" %10d" .format(addr.index)))
153
153
sb.append(s " : ${offsetToInt(pos.start)} .. ${pos.end}\n " )
154
154
}
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
+
155
165
sb.result
156
166
}
157
167
}
Original file line number Diff line number Diff line change @@ -33,10 +33,18 @@ clear_out "$OUT"
33
33
" $SBT " " ;scalac -d $OUT /out.jar $SOURCE ; scalac -decompile -color:never $OUT /out.jar" > " $tmp "
34
34
grep -qe " def main(args: scala.Array\[scala.Predef.String\]): scala.Unit =" " $tmp "
35
35
36
+
36
37
echo " testing that paths SourceFile annotations are relativized"
37
38
clear_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
+
40
48
41
49
echo " testing sbt scalac with suspension"
42
50
clear_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