Skip to content

Commit

Permalink
Remove unused code (#2900)
Browse files Browse the repository at this point in the history
  • Loading branch information
guizmaii authored Oct 2, 2023
1 parent 4ef60ee commit f9c68d8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package io.getquill.ast

trait StatelessTransformer {

def applyIdent(id: Ident) = id
def applyIdent(id: Ident): Ident = id

def apply(e: Ast): Ast =
e match {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import io.getquill.ast._
* body. Other places where this needs to be done (e.g. in a Tuple that
* `Returning` returns) are done in `ExpandReturning`.
*/
private[getquill] case class DemarcateExternalAliases(externalIdent: Ident) extends StatelessTransformer {
private[getquill] final case class DemarcateExternalAliases(externalIdent: Ident) extends StatelessTransformer {

def applyNonOverride(idents: Ident*)(ast: Ast) =
if (idents.forall(_ != externalIdent)) apply(ast)
private def applyNonOverride(idents: Ident*)(ast: Ast): Ast =
if (!idents.contains(externalIdent)) apply(ast)
else ast

override def apply(ast: Ast): Ast = ast match {
Expand Down Expand Up @@ -71,7 +71,7 @@ private[getquill] case class DemarcateExternalAliases(externalIdent: Ident) exte

object DemarcateExternalAliases {

private def demarcateQueriesInBody(id: Ident, body: Ast) =
private def demarcateQueriesInBody(id: Ident, body: Ast): Ast =
Transform(body) {
// Apply to the AST defined apply method about, not to the superclass method that takes Query
case q: Query => new DemarcateExternalAliases(id).apply(q.asInstanceOf[Ast])
Expand All @@ -81,7 +81,6 @@ object DemarcateExternalAliases {
case Returning(a, id, body) =>
Returning(a, id, demarcateQueriesInBody(id, body))
case ReturningGenerated(a, id, body) =>
val d = demarcateQueriesInBody(id, body)
ReturningGenerated(a, id, demarcateQueriesInBody(id, body))
case other =>
other
Expand Down

0 comments on commit f9c68d8

Please sign in to comment.