Skip to content

Commit

Permalink
WIP: Do not add @SourceFile
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasstucki committed Nov 27, 2023
1 parent 3dbfd7d commit 27881d3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions compiler/src/dotty/tools/dotc/transform/PostTyper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -420,10 +420,10 @@ class PostTyper extends MacroTransform with InfoTransformer { thisPhase =>
// Add SourceFile annotation to top-level classes
if sym.owner.is(Package) then
// TODO do not add SourceFile annotation
if ctx.compilationUnit.source.exists && sym != defn.SourceFileAnnot then
val reference = ctx.settings.sourceroot.value
val relativePath = util.SourceFile.relativePath(ctx.compilationUnit.source, reference)
sym.addAnnotation(Annotation.makeSourceFile(relativePath, tree.span))
// if ctx.compilationUnit.source.exists && sym != defn.SourceFileAnnot then
// val reference = ctx.settings.sourceroot.value
// val relativePath = util.SourceFile.relativePath(ctx.compilationUnit.source, reference)
// sym.addAnnotation(Annotation.makeSourceFile(relativePath, tree.span))
if sym != defn.WithPureFunsAnnot && sym != defn.CaptureCheckedAnnot then
if Feature.ccEnabled then
sym.addAnnotation(Annotation(defn.CaptureCheckedAnnot, tree.span))
Expand Down

0 comments on commit 27881d3

Please sign in to comment.