Skip to content

readNamesOfPersonsOlderThan does not compile #1

@mslinn

Description

@mslinn

The custom comparison operator had a weird error when I tried to run this program. This also failed:

def readNamesOfPersonsOlderThan(age: Int): Future[Seq[String]] = {
    val longAgo: LocalDateTime = LocalDateTime.now(DateTimeZone.UTC).minusYears(age)
    ctx.run {
      quote {
        query[Person]
          .filter(t => t.birthDate.isAfter(lift(longAgo)) && t.deathDate.isEmpty)
          .map(_.name)
      }
    }
  }

Error:(24, 13) Tree 't.birthDate.isAfter((package.this.ctx.liftScalar[org.joda.time.LocalDateTime](longAgo)(scala.Predef.implicitly[io.getquill.example.postgres.async.package.ctx.Encoder[org.joda.time.LocalDateTime]](package.this.ctx.mappedEncoder[org.joda.time.LocalDateTime, java.util.Date](package.this.ctx.jodaLocalDateTimeEncoder, package.this.ctx.dateEncoder))): org.joda.time.LocalDateTime))' can't be parsed to 'Ast' quote {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions