File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed
src/dotty/tools/dotc/transform/init
tests/init-global/special/tastySource Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,9 @@ object Trace:
6060 val hasSource = fileExists(pos.source)
6161 val line =
6262 if pos.exists then
63- val loc = pos.source.file.name + " :" + (pos.line + 1 )
63+ // Show more information for external code without source
64+ val file = if hasSource then pos.source.file.name else pos.source.file.path
65+ val loc = file + " :" + (pos.line + 1 )
6466 val code =
6567 if hasSource then
6668 SyntaxHighlighting .highlight(pos.lineContent.trim)
Original file line number Diff line number Diff line change @@ -259,7 +259,7 @@ class CompilationTests {
259259 val outDirLib = defaultOutputDir + group + " /A/tastySource/A"
260260
261261 // Set -sourceroot such that the source code cannot be found by the compiler
262- val libOptions = tastSourceOptions.and(" -sourceroot" , " tests/init-global/special/tastySource " )
262+ val libOptions = tastSourceOptions.and(" -sourceroot" , " tests/init-global/special" )
263263 val lib = compileFile(" tests/init-global/special/tastySource/A.scala" , libOptions)(group).keepOutput.checkCompile()
264264
265265 compileFile(" tests/init-global/special/tastySource/B.scala" , tastSourceOptions.withClasspath(outDirLib))(group).checkWarnings()
Original file line number Diff line number Diff line change 55 |Reading mutable state of other static objects is forbidden as it breaks initialization-time irrelevance. Calling trace:
66 |├── object B: [ B.scala:1 ]
77 |│ ^
8- |├── (no source) [ A.scala:2 ]
9- |├── (no source) [ A.scala:4 ]
8+ |├── (no source) [ tastySource/ A.scala:2 ]
9+ |├── (no source) [ tastySource/ A.scala:4 ]
1010 |├── var y = A.foo(bar) * 2 [ B.scala:2 ]
1111 |│ ^^^
1212 |└── def bar = C.n * 3 // warn [ B.scala:4 ]
You can’t perform that action at this time.
0 commit comments