File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -335,7 +335,11 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { thisPhase
335
335
&& ctx.compilationUnit.source.exists
336
336
&& sym != defn.SourceFileAnnot
337
337
then
338
- sym.addAnnotation(Annotation .makeSourceFile(ctx.compilationUnit.source.file.path))
338
+ val jpath = ctx.compilationUnit.source.file.jpath.normalize
339
+ val sourceRoot = java.nio.file.Paths .get(" ." ).toAbsolutePath.normalize
340
+ val relativePath =
341
+ if jpath.isAbsolute then sourceRoot.relativize(jpath) else jpath
342
+ sym.addAnnotation(Annotation .makeSourceFile(relativePath.toString))
339
343
else (tree.rhs, sym.info) match
340
344
case (rhs : LambdaTypeTree , bounds : TypeBounds ) =>
341
345
VarianceChecker .checkLambda(rhs, bounds)
You can’t perform that action at this time.
0 commit comments