Skip to content

Commit 9e01840

Browse files
committed
Do not add @SourceFile annotations
1 parent 9b8ab6e commit 9e01840

File tree

2 files changed

+0
-6
lines changed

2 files changed

+0
-6
lines changed

compiler/src/dotty/tools/dotc/core/Annotations.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,6 @@ object Annotations {
245245
else None
246246
}
247247

248-
def makeSourceFile(path: String, span: Span)(using Context): Annotation =
249-
apply(defn.SourceFileAnnot, Literal(Constant(path)), span)
250248
}
251249

252250
@sharable val EmptyAnnotation = Annotation(EmptyTree)

compiler/src/dotty/tools/dotc/transform/PostTyper.scala

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -419,10 +419,6 @@ class PostTyper extends MacroTransform with InfoTransformer { thisPhase =>
419419
em"The type of a class parent cannot refer to constructor parameters, but ${parent.tpe} refers to ${illegalRefs.map(_.name.show).mkString(",")}", parent.srcPos)
420420
// Add SourceFile annotation to top-level classes
421421
if sym.owner.is(Package) then
422-
if ctx.compilationUnit.source.exists && sym != defn.SourceFileAnnot then
423-
val reference = ctx.settings.sourceroot.value
424-
val relativePath = util.SourceFile.relativePath(ctx.compilationUnit.source, reference)
425-
sym.addAnnotation(Annotation.makeSourceFile(relativePath, tree.span))
426422
if sym != defn.WithPureFunsAnnot && sym != defn.CaptureCheckedAnnot then
427423
if Feature.ccEnabled then
428424
sym.addAnnotation(Annotation(defn.CaptureCheckedAnnot, tree.span))

0 commit comments

Comments
 (0)