Skip to content

transparent macro caller from private object access error #13477

Closed
@soronpo

Description

@soronpo

When exporting a transparent inline macro caller method from a private object, there is an access error.
If the macro is not transparent, then there is no error. If there is no macro call (just transparent inline) there is no error.
Possibly related to the resolved issue #12948.

Compiler version

v3.1.0-RC1

Minimized code

Minimized project available at: https://github.com/soronpo/dottybug/tree/export_inline_access_err
mylib/Main.scala

package mylib
import scala.quoted.*

private object Main:
  transparent inline def d(): Unit =
    ${interpMacro}
  def interpMacro(using Quotes) : Expr[Unit] =
    import quotes.reflect.*
    '{}

export Main.d

Test.scala

import mylib.*
val x = d()

Output

[error] 2 |val x = d()
[error]   |        ^^^
[error]   |object Main cannot be accessed as a member of mylib from module class Test$package$.
[error] one error found

Expectation

No error.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions