Skip to content

Wrong staging level for quoted singleton #15709

Closed
@prolativ

Description

@prolativ

Compiler version

3.2.1-RC1-bin-20220719-56e9a93-NIGHTLY and earlier

Minimized code

//> using scala "3.2.1-RC1-bin-20220719-56e9a93-NIGHTLY"

import quoted.*

inline def foo(s: Singleton): Unit = ${ fooImpl('s) }
def fooImpl(s: Expr[Singleton])(using Quotes) = '{}

Output

[error] QuotedSingleton.scala:5:49: access to parameter s from wrong staging level:
[error]  - the definition is at level 0,
[error]  - but the access is at level -1.
[error] inline def foo(s: Singleton): Unit = ${ fooImpl('s) }
[error]                                                 ^

Expectation

This should compile without error. The problem occurs also for unions of Singleton with other types.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions