Skip to content

Commit 6d3f88b

Browse files
committed
Fix error message in case of failed summoning of Ordering
1 parent e230c3b commit 6d3f88b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

jsoniter-scala-macros/shared/src/main/scala-2/com/github/plokhotnyuk/jsoniter_scala/macros/JsonCodecMaker.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ object JsonCodecMaker {
716716
}
717717

718718
def isConstType(tpe: Type): Boolean = tpe match {
719-
case ConstantType(Constant(_)) => true
719+
case ConstantType(_: Constant) => true
720720
case _ => false
721721
}
722722

jsoniter-scala-macros/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/macros/JsonCodecMaker.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -999,10 +999,10 @@ private class JsonCodecMakerInstance(cfg: CodecMakerConfig)(using Quotes) {
999999
}
10001000

10011001
private def summonOrdering(tpe: TypeRepr): Term = inferredOrderings.getOrElseUpdate(tpe, {
1002-
val orderingTpeApplied = TypeRepr.of[Ordering]
1003-
Implicits.search(orderingTpeApplied.appliedTo(tpe)) match
1002+
val orderingTpeApplied = TypeRepr.of[Ordering].appliedTo(tpe)
1003+
Implicits.search(orderingTpeApplied) match
10041004
case s: ImplicitSearchSuccess => s.tree
1005-
case _ => fail(s"Can't summon '${tpe.show}'")
1005+
case _ => fail(s"Can't summon '${orderingTpeApplied.show}'")
10061006
})
10071007

10081008
private def summonClassTag(tpe: TypeRepr): Term = Ref(classTags.getOrElseUpdate(tpe, {

0 commit comments

Comments
 (0)