Skip to content

Commit 61d45b3

Browse files
authored
Add missing support of mutable.PriorityQueue by Scala 3 macros
1 parent 159df44 commit 61d45b3

File tree

1 file changed

+3
-1
lines changed
  • jsoniter-scala-macros/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/macros

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1729,7 +1729,7 @@ object JsonCodecMaker {
17291729
case '[t1] => '{ (null: ::[t1]) }.asExprOf[T]
17301730
}
17311731
else if (tpe <:< TypeRepr.of[List[_]] || tpe.typeSymbol == TypeRepr.of[Seq[_]].typeSymbol) '{ Nil }.asExprOf[T]
1732-
else if (tpe <:< TypeRepr.of[collection.SortedSet[_]]) withNullValueFor(tpe) {
1732+
else if (tpe <:< TypeRepr.of[collection.SortedSet[_]] || tpe <:< TypeRepr.of[mutable.PriorityQueue[_]]) {
17331733
val tpe1 = typeArg1(tpe)
17341734
Apply(scalaCollectionEmptyNoArgs(tpe, tpe1), List(summonOrdering(tpe1))).asExprOf[T]
17351735
} else if (tpe <:< TypeRepr.of[mutable.ArraySeq[_]] || tpe <:< TypeRepr.of[immutable.ArraySeq[_]] ||
@@ -2511,6 +2511,8 @@ object JsonCodecMaker {
25112511
val emptyCollection = {
25122512
if (tpe <:< TypeRepr.of[mutable.UnrolledBuffer[_]]) {
25132513
Apply(scalaCollectionEmptyNoArgs(tpe, tpe1), List(summonClassTag(tpe1)))
2514+
} else if (tpe <:< TypeRepr.of[mutable.PriorityQueue[_]]) {
2515+
Apply(scalaCollectionEmptyNoArgs(tpe, tpe1), List(summonOrdering(tpe1)))
25142516
} else scalaCollectionEmptyNoArgs(tpe, tpe1)
25152517
}.asExprOf[T & mutable.Growable[t1]]
25162518
genReadCollection('{

0 commit comments

Comments
 (0)