Skip to content

Symbol.fullName is inconsistent with JVM class name for nested objects #13321

Closed
@scf37

Description

@scf37

Compiler version

3.0.1

Minimized code

import scala.quoted._
object Macro:
  inline def apply[A]: Unit = ${impl[A]}

  private def impl[A: Type](using Quotes): Expr[String] =
    import quotes.reflect._
    val t = TypeRepr.of[A]
    println(t.classSymbol.get.fullName)
    Expr("")
object Foo:
  object Boo

object Main:
  def main(args: Array[String]) =
    Macro[Foo.Boo.type]

Output

Foo$.Boo$

Expectation

Correct runtime name for Foo.Boo:

Foo$Boo$

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions