You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: jsoniter-scala-macros/shared/src/main/scala-2/com/github/plokhotnyuk/jsoniter_scala/macros/JsonCodecMaker.scala
Copy file name to clipboardExpand all lines: jsoniter-scala-macros/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/macros/JsonCodecMaker.scala
Copy file name to clipboardExpand all lines: jsoniter-scala-macros/shared/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/macros/JsonCodecMakerNewTypeSpec.scala
+45-38Lines changed: 45 additions & 38 deletions
Original file line number
Diff line number
Diff line change
@@ -68,6 +68,42 @@ given nullableValueCodec: JsonValueCodec[Int | Null | String] = new JsonValueCod
68
68
defnullValue:Int|Null|String=null
69
69
}
70
70
71
+
// Borrowed from an amazing work of Matthias Berndt: https://scastie.scala-lang.org/rCmIrOrnRdydyDvWfJRAzw
Copy file name to clipboardExpand all lines: jsoniter-scala-macros/shared/src/test/scala/com/github/plokhotnyuk/jsoniter_scala/macros/JsonCodecMakerSpec.scala
+3-11Lines changed: 3 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -2129,15 +2129,7 @@ class JsonCodecMakerSpec extends VerifyingSpec {
2129
2129
"""case class HigherKindedType[F[_]](f: F[Int], fs: F[HigherKindedType[F]])
"serialize and deserialize indented by spaces and new lines if it was configured for writer" in {
2143
2135
verifySerDeser(codecOfRecursive,
@@ -3217,8 +3209,8 @@ class JsonCodecMakerSpec extends VerifyingSpec {
3217
3209
|val v = FooImpl[Bar, String](Qux, Vector.empty[String])
3218
3210
|val c = JsonCodecMaker.make[Foo[Bar]]""".stripMargin
3219
3211
}).getMessage.contains {
3220
-
if (ScalaVersionCheck.isScala2) "Cannot resolve generic type(s) for `FooImpl[F,A]`. Please provide a custom implicitly accessible codec for it."
3221
-
else"Type parameter A of class FooImpl can't be deduced from type arguments of Foo[[A >: scala.Nothing <: scala.Any] => Bar[A]]. Please provide a custom implicitly accessible codec for it."
3212
+
if (ScalaVersionCheck.isScala2) "Cannot resolve generic type(s) for 'FooImpl[F,A]'. Please provide a custom implicitly accessible codec for it."
3213
+
else"Type parameter 'A' of 'class FooImpl' can't be deduced from type arguments of 'Foo[[A >: scala.Nothing <: scala.Any]"
3222
3214
})
3223
3215
}
3224
3216
"don't generate codecs when 'AnyVal' or one value classes with 'CodecMakerConfig.withInlineOneValueClasses(true)' are leaf types of the ADT base" in {
0 commit comments