Skip to content

Remove Expr.StringContext.unapply #10675

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

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions library/src-bootstrapped/scala/quoted/Expr.scala
Original file line number Diff line number Diff line change
Expand Up @@ -236,15 +236,4 @@ object Expr {
}
}

object StringContext {
/** Matches a `StringContext(part0, part1, ...)` and extracts the parts of a call to if the
* parts are passed explicitly. Returns the equvalent to `Seq('{part0}, '{part1}, ...)`.
*/
def unapply(sc: Expr[StringContext])(using Quotes): Option[Seq[Expr[String]]] =
sc match
case '{ scala.StringContext(${Varargs(parts)}: _*) } => Some(parts)
case '{ new scala.StringContext(${Varargs(parts)}: _*) } => Some(parts)
case _ => None
}

}