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:
60
60
val hasSource = fileExists(pos.source)
61
61
val line =
62
62
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 )
64
66
val code =
65
67
if hasSource then
66
68
SyntaxHighlighting .highlight(pos.lineContent.trim)
Original file line number Diff line number Diff line change @@ -259,7 +259,7 @@ class CompilationTests {
259
259
val outDirLib = defaultOutputDir + group + " /A/tastySource/A"
260
260
261
261
// 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" )
263
263
val lib = compileFile(" tests/init-global/special/tastySource/A.scala" , libOptions)(group).keepOutput.checkCompile()
264
264
265
265
compileFile(" tests/init-global/special/tastySource/B.scala" , tastSourceOptions.withClasspath(outDirLib))(group).checkWarnings()
Original file line number Diff line number Diff line change 5
5
|Reading mutable state of other static objects is forbidden as it breaks initialization-time irrelevance. Calling trace:
6
6
|├── object B: [ B.scala:1 ]
7
7
|│ ^
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 ]
10
10
|├── var y = A.foo(bar) * 2 [ B.scala:2 ]
11
11
|│ ^^^
12
12
|└── def bar = C.n * 3 // warn [ B.scala:4 ]
You can’t perform that action at this time.
0 commit comments