Skip to content

Commit

Permalink
Let accesors inherit @experimental annotations from accessed symvbols (
Browse files Browse the repository at this point in the history
  • Loading branch information
odersky authored Sep 26, 2022
2 parents 8986010 + cdfc0f4 commit 709a02a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions compiler/src/dotty/tools/dotc/transform/AccessProxies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ abstract class AccessProxies {
val sym = newSymbol(owner, name, Synthetic | Method, info, coord = accessed.span).entered
if accessed.is(Private) then sym.setFlag(Final)
else if sym.allOverriddenSymbols.exists(!_.is(Deferred)) then sym.setFlag(Override)
if accessed.hasAnnotation(defn.ExperimentalAnnot) then
sym.addAnnotation(defn.ExperimentalAnnot)
sym
}

Expand Down
9 changes: 9 additions & 0 deletions tests/pos-custom-args/no-experimental/i16091.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import scala.annotation.experimental

object Macro {
@experimental
inline def foo() = fooImpl

@experimental
private def fooImpl = ()
}

0 comments on commit 709a02a

Please sign in to comment.