Skip to content

Commit 30ad31e

Browse files
committed
Remove SourceFile annotation
1 parent 50a8ca6 commit 30ad31e

File tree

2 files changed

+0
-8
lines changed

2 files changed

+0
-8
lines changed

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,6 @@ object Annotations {
244244
}
245245
else None
246246
}
247-
248-
def makeSourceFile(path: String, span: Span)(using Context): Annotation =
249-
apply(defn.SourceFileAnnot, Literal(Constant(path)), span)
250247
}
251248

252249
@sharable val EmptyAnnotation = Annotation(EmptyTree)

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -417,12 +417,7 @@ class PostTyper extends MacroTransform with InfoTransformer { thisPhase =>
417417
if illegalRefs.nonEmpty then
418418
report.error(
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)
420-
// Add SourceFile annotation to top-level classes
421420
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))
426421
if sym != defn.WithPureFunsAnnot && sym != defn.CaptureCheckedAnnot then
427422
if Feature.ccEnabled then
428423
sym.addAnnotation(Annotation(defn.CaptureCheckedAnnot, tree.span))

0 commit comments

Comments
 (0)