Skip to content

Quoted expression in annotations are not reified #7123

Closed
@liufengyun

Description

@liufengyun

minimized code

import scala.quoted._

class annot[T: Type](x: Expr[T]) extends scala.annotation.Annotation

class Test()(implicit qtx: QuoteContext) {
  @annot('{4})
  def foo(str: String) = '{4}
}

The code '{4} stays unchanged until the backend, as can be seen from -Xprint:all.

expectation

I'm not sure if this is a bug, as annotations do not have runtime semantics.

Founded from #7053.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions