diff --git a/compiler/src/dotty/tools/dotc/typer/PrepareInlineable.scala b/compiler/src/dotty/tools/dotc/typer/PrepareInlineable.scala index 84ff8790f94d..56d89f982869 100644 --- a/compiler/src/dotty/tools/dotc/typer/PrepareInlineable.scala +++ b/compiler/src/dotty/tools/dotc/typer/PrepareInlineable.scala @@ -224,6 +224,7 @@ object PrepareInlineable { finally if ctx.reporter.errorCount != initialErrorCount then sym.resetFlag(Inline) + sym.resetFlag(Transparent) sym.removeAnnotation(defn.BodyAnnot) /** Register inline info for given inlineable method `sym`. diff --git a/tests/neg/i11437.check b/tests/neg/i11437.check new file mode 100644 index 000000000000..f327d6a6a8d2 --- /dev/null +++ b/tests/neg/i11437.check @@ -0,0 +1,6 @@ +-- [E006] Not Found Error: tests/neg/i11437.scala:1:29 ----------------------------------------------------------------- +1 |transparent inline def foo = error // error + | ^^^^^ + | Not found: error + +longer explanation available when compiling with `-explain` diff --git a/tests/neg/i11437.scala b/tests/neg/i11437.scala new file mode 100644 index 000000000000..b9e29d8d4fda --- /dev/null +++ b/tests/neg/i11437.scala @@ -0,0 +1 @@ +transparent inline def foo = error // error