Skip to content

Commit

Permalink
"Fix" compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
fthomas committed Feb 4, 2018
1 parent 77dcca8 commit a14628c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ trait RefType[F[_, _]] extends Serializable {

def unsafeRewrap[T, A, B](ta: F[T, A]): F[T, B]

def unsafeWrapM[T: c.WeakTypeTag, P: c.WeakTypeTag](c: blackbox.Context)(
t: c.Expr[T]): c.Expr[F[T, P]]
//def unsafeWrapM[T: c.WeakTypeTag, P: c.WeakTypeTag](c: blackbox.Context)(
// t: c.Expr[T]): c.Expr[F[T, P]]

def unsafeRewrapM[T: c.WeakTypeTag, A: c.WeakTypeTag, B: c.WeakTypeTag](c: blackbox.Context)(
ta: c.Expr[F[T, A]]): c.Expr[F[T, B]]
//def unsafeRewrapM[T: c.WeakTypeTag, A: c.WeakTypeTag, B: c.WeakTypeTag](c: blackbox.Context)(
// ta: c.Expr[F[T, A]]): c.Expr[F[T, B]]

/**
* Returns a value of type `T` refined as `F[T, P]` on the right if
Expand Down Expand Up @@ -161,12 +161,12 @@ object RefType {
override def unsafeRewrap[T, A, B](ta: Refined[T, A]): Refined[T, B] =
Refined.unsafeApply(ta.value)

override def unsafeWrapM[T: c.WeakTypeTag, P: c.WeakTypeTag](c: blackbox.Context)(
def unsafeWrapM[T: c.WeakTypeTag, P: c.WeakTypeTag](c: blackbox.Context)(
t: c.Expr[T]): c.Expr[Refined[T, P]] =
c.universe.reify(Refined.unsafeApply(t.splice))

override def unsafeRewrapM[T: c.WeakTypeTag, A: c.WeakTypeTag, B: c.WeakTypeTag](
c: blackbox.Context)(ta: c.Expr[Refined[T, A]]): c.Expr[Refined[T, B]] =
def unsafeRewrapM[T: c.WeakTypeTag, A: c.WeakTypeTag, B: c.WeakTypeTag](c: blackbox.Context)(
ta: c.Expr[Refined[T, A]]): c.Expr[Refined[T, B]] =
c.universe.reify(Refined.unsafeApply(ta.splice.value))
}

Expand All @@ -181,12 +181,12 @@ object RefType {
override def unsafeRewrap[T, A, B](ta: T @@ A): T @@ B =
ta.asInstanceOf[T @@ B]

override def unsafeWrapM[T: c.WeakTypeTag, P: c.WeakTypeTag](c: blackbox.Context)(
def unsafeWrapM[T: c.WeakTypeTag, P: c.WeakTypeTag](c: blackbox.Context)(
t: c.Expr[T]): c.Expr[T @@ P] =
c.universe.reify(t.splice.asInstanceOf[T @@ P])

override def unsafeRewrapM[T: c.WeakTypeTag, A: c.WeakTypeTag, B: c.WeakTypeTag](
c: blackbox.Context)(ta: c.Expr[T @@ A]): c.Expr[T @@ B] =
def unsafeRewrapM[T: c.WeakTypeTag, A: c.WeakTypeTag, B: c.WeakTypeTag](c: blackbox.Context)(
ta: c.Expr[T @@ A]): c.Expr[T @@ B] =
c.universe.reify(ta.splice.asInstanceOf[T @@ B])
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ class InferMacro(val c: blackbox.Context) extends MacroUtils {
abort(Resources.invalidInference(weakTypeOf[A].toString, weakTypeOf[B].toString))
}

refTypeInstance(rt).unsafeRewrapM(c)(ta)
???
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class RefineMacro(val c: blackbox.Context) extends MacroUtils with LiteralMatche
abort(validate.showResult(tValue, res))
}

refTypeInstance(rt).unsafeWrapM(c)(t)
???
}

def implApplyRef[FTP, F[_, _], T: c.WeakTypeTag, P: c.WeakTypeTag](t: c.Expr[T])(
Expand Down

0 comments on commit a14628c

Please sign in to comment.