- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.1k
Closed
Closed
Copy link
Labels
area:metaprogramming:quotesIssues related to quotes and splicesIssues related to quotes and splicesitype:bug
Milestone
Description
Compiler version
3.6.3
Minimized code
import scala.quoted.*
transparent inline def foo =
  ${ fooImpl }
def fooImpl(using Quotes): Expr[Any] =
  '{
    new AnyRef {
      type T = Unit
      def make: T = ()
      def take(t: T): Unit = ()
    }: {
      type T
      def make: T
      def take(t: T): Unit
    }
  }Output
% ~/Downloads/scala3-3.6.3-aarch64-apple-darwin/bin/scalac test.scala
-- Error: test.scala:14:16 -----------------------------------------------------
14 |      def make: T
   |                ^
   |                access to trait <refinement> from wrong staging level:
   |                 - the definition is at level 0,
   |                 - but the access is at level 1
-- Error: test.scala:15:22 -----------------------------------------------------
15 |      def take(t: T): Unit
   |                      ^^^^
   |                  access to trait <refinement> from wrong staging level:
   |                   - the definition is at level 0,
   |                   - but the access is at level 1
-- Error: test.scala:15:18 -----------------------------------------------------
15 |      def take(t: T): Unit
   |                  ^
   |                  access to trait <refinement> from wrong staging level:
   |                   - the definition is at level 0,
   |                   - but the access is at level 1
3 errors foundExpectation
Should compile, as there is no stage mismatch.
A workaround would be appreciated.
Metadata
Metadata
Assignees
Labels
area:metaprogramming:quotesIssues related to quotes and splicesIssues related to quotes and splicesitype:bug