Skip to content

Erroneous phase consistency check error for type annotation in quoted code #7519

Closed
@biboudis

Description

@biboudis

minimized code

object Test {
  class Annot extends StaticAnnotation

  class Quoted[T]

  inline def quote[T]: Quoted[T] = ${ quoteImpl[T] }
  def quoteImpl[T: Type](given qctx: QuoteContext): Expr[Quoted[T]] = '{
    new Quoted[T @Annot]
  }
}

produces an erroneous wrong stage error

12 |    new Quoted[T @Annot]
   |        ^^^^^^^^^^^^^^^^
   |        access to constructor Annot from wrong staging level:
   |         - the definition is at level 0,
   |         - but the access is at level 1.

expectation

Since Annot is global this shouldn't have been a problem.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions