Skip to content

Not working for enums of singletons? #5

@kubukoz

Description

@kubukoz

Hey! I like the library but I'm having some trouble with it.

This results in a compile-time warning, on 3.3.0:

//> using lib "io.github.kitlangton::quotidian:0.0.6"
//> using scala "3.3.0"

import quotidian.*
import scala.quoted.*

enum TokenKind derives ToExpr {
  case EOF
  case Ident
}
Compiling project (Scala 3.3.0, JVM)
[warn] ./macros.scala:7:24
[warn] Unreachable case except for null (if this is intentional, consider writing case null => instead).
[warn] enum TokenKind derives ToExpr {
[warn]  

On 3.3.1, it fails to compile altogether:

//> using lib "io.github.kitlangton::quotidian:0.0.6"
//> using scala "3.3.1"

import quotidian.*
import scala.quoted.*

enum TokenKind derives ToExpr {
  case EOF
  case Ident
}
[warn] ./macros.scala:7:24
[warn] Unreachable case except for null (if this is intentional, consider writing case null => instead).
[warn] enum TokenKind derives ToExpr {
[warn]                        ^
[error] ./macros.scala:7:24
[error] Illegal reference to `scala.quoted.runtime.Expr`
[error] enum TokenKind derives ToExpr {
[error]                        ^
[error] ./macros.scala:7:24
[error] Illegal reference to `scala.quoted.runtime.Expr.quote`
[error] enum TokenKind derives ToExpr {
[error]                        ^

Is this something on my side, or could it be a fault in the library? BTW I remember there was some chatter on this getting inlined into dotty itself, has there been any update on that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions