Skip to content

Commit

Permalink
continue
Browse files Browse the repository at this point in the history
  • Loading branch information
deusaquilus committed May 21, 2019
1 parent 132648f commit 888d97f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions quill-core/src/main/scala/io/getquill/quotation/Parsing.scala
Original file line number Diff line number Diff line change
Expand Up @@ -625,10 +625,10 @@ trait Parsing {
tpe.typeSymbol.fullName startsWith "scala.Tuple"

/**
* Need special handling to check if a type is null since need to check if it's Option, Some or None. Don't want
* to use `<:<` since that would also match things like `Nothing` and `Null`.
*/
def isOptionType(tpe:Type) = {
* Need special handling to check if a type is null since need to check if it's Option, Some or None. Don't want
* to use `<:<` since that would also match things like `Nothing` and `Null`.
*/
def isOptionType(tpe: Type) = {
val era = tpe.erasure
era =:= typeOf[Option[Any]] || era =:= typeOf[Some[Any]] || era =:= typeOf[None.type]
}
Expand Down Expand Up @@ -796,10 +796,10 @@ trait Parsing {
OnConflict.Update(targets.map(assignmentParser(_)))

private[getquill] sealed trait ArgType { def tpe: Type }
private[getquill] case class OptionArg(tpe:Type) extends ArgType
private[getquill] case class Arg(tpe:Type) extends ArgType
private[getquill] case class OptionArg(tpe: Type) extends ArgType
private[getquill] case class Arg(tpe: Type) extends ArgType

private def innerType(lhs:Tree): ArgType = {
private def innerType(lhs: Tree): ArgType = {
val leftType = typecheckUnquoted(lhs).tpe
if (isOptionType(leftType) && !is[Nothing](leftType))
OptionArg(innerOptionParam(leftType).widen)
Expand Down

0 comments on commit 888d97f

Please sign in to comment.