Skip to content

does not match '{ new String($x: Array[Byte]) } since 3.3.1-RC1 #17606

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
xuwei-k opened this issue May 27, 2023 · 0 comments · Fixed by #17615 or #17749
Closed

does not match '{ new String($x: Array[Byte]) } since 3.3.1-RC1 #17606

xuwei-k opened this issue May 27, 2023 · 0 comments · Fixed by #17615 or #17749
Assignees
Labels
area:metaprogramming:quotes Issues related to quotes and splices itype:bug regression This worked in a previous version but doesn't anymore
Milestone

Comments

@xuwei-k
Copy link
Contributor

xuwei-k commented May 27, 2023

Compiler version

OK

  • 3.2.2
  • 3.3.0
  • 3.3.1-RC1-bin-20230321-d36cd2d-NIGHTLY

NG

  • 3.3.1-RC1-bin-20230322-1f574e8-NIGHTLY
  • 3.3.1-RC1
  • 3.3.1-RC1-bin-20230524-5262680-NIGHTLY

Minimized code

A.scala

package example

import scala.quoted.Expr
import scala.quoted.Quotes

object A {
  inline def f(inline a: Any): Boolean = ${ impl('a) }

  def impl(a: Expr[Any])(using Quotes): Expr[Boolean] = {
    a match {
      case '{ new String($x: Array[Byte]) } =>
        '{ true }
      case _ =>
        '{ false }
    }
  }
}

Main.scala

package example

object Main {
  def main(args: Array[String]): Unit = {
    val x = A.f(new String(Array.empty[Byte]))
    println(x)
  }
}

Output

false

Expectation

print true

Note

@xuwei-k xuwei-k added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels May 27, 2023
@nicolasstucki nicolasstucki added area:metaprogramming:quotes Issues related to quotes and splices and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels May 28, 2023
@nicolasstucki nicolasstucki self-assigned this May 28, 2023
@nicolasstucki nicolasstucki added the regression This worked in a previous version but doesn't anymore label May 28, 2023
@nicolasstucki nicolasstucki added this to the 3.3.1 milestone May 28, 2023
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue May 30, 2023
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Jun 1, 2023
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Jun 1, 2023
Kordyjan added a commit that referenced this issue Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:metaprogramming:quotes Issues related to quotes and splices itype:bug regression This worked in a previous version but doesn't anymore
Projects
None yet
2 participants