@@ -1914,6 +1914,7 @@ class JsonCodecMakerSpec extends VerifyingSpec {
1914
1914
" don't generate codecs for case classes with field that have duplicated @named annotation" in {
1915
1915
assert(intercept[TestFailedException ](assertCompiles {
1916
1916
""" case class DuplicatedNamed(@named("x") @named("y") z: Int)
1917
+ |
1917
1918
|JsonCodecMaker.make[DuplicatedNamed]""" .stripMargin
1918
1919
}).getMessage.contains {
1919
1920
" Duplicated 'com.github.plokhotnyuk.jsoniter_scala.macros.named' defined for 'z' of 'DuplicatedNamed'."
@@ -1922,7 +1923,9 @@ class JsonCodecMakerSpec extends VerifyingSpec {
1922
1923
" don't generate codecs for ADT leaf case classes that have duplicated @named annotation" in {
1923
1924
assert(intercept[TestFailedException ](assertCompiles {
1924
1925
""" sealed trait Z
1926
+ |
1925
1927
|@named("x") @named("y") case class DuplicatedNamed(z: Int) extends Z
1928
+ |
1926
1929
|JsonCodecMaker.make[Z]""" .stripMargin
1927
1930
}).getMessage.contains {
1928
1931
" Duplicated 'com.github.plokhotnyuk.jsoniter_scala.macros.named' defined for 'DuplicatedNamed'."
@@ -1937,10 +1940,12 @@ class JsonCodecMakerSpec extends VerifyingSpec {
1937
1940
|'com.github.plokhotnyuk.jsoniter_scala.macros.CodecMakerConfig.discriminatorFieldName' option.""" .stripMargin.replace('\n ' , ' ' )
1938
1941
assert(intercept[TestFailedException ](assertCompiles {
1939
1942
""" case class DuplicatedJsonName(x: Int, @named("x") z: Int)
1943
+ |
1940
1944
|JsonCodecMaker.make[DuplicatedJsonName]""" .stripMargin
1941
1945
}).getMessage.contains(expectedError))
1942
1946
assert(intercept[TestFailedException ](assertCompiles {
1943
1947
""" case class DuplicatedJsonName(y: Int, z: Int)
1948
+ |
1944
1949
|JsonCodecMaker.make[DuplicatedJsonName](CodecMakerConfig.withFieldNameMapper { case _ => "x" })""" .stripMargin
1945
1950
}).getMessage.contains(expectedError))
1946
1951
}
@@ -1969,6 +1974,7 @@ class JsonCodecMakerSpec extends VerifyingSpec {
1969
1974
" don't generate codecs for recursive types by default" in {
1970
1975
assert(intercept[TestFailedException ](assertCompiles {
1971
1976
""" case class Recursive(r: Recursive)
1977
+ |
1972
1978
|JsonCodecMaker.make[Recursive]""" .stripMargin
1973
1979
}).getMessage.contains {
1974
1980
""" Recursive type(s) detected: 'Recursive'. Please consider using a custom implicitly accessible codec for this
@@ -1978,9 +1984,13 @@ class JsonCodecMakerSpec extends VerifyingSpec {
1978
1984
})
1979
1985
assert(intercept[TestFailedException ](assertCompiles {
1980
1986
""" case class NonRecursive(r1: Recursive1)
1987
+ |
1981
1988
|case class Recursive1(r2: Recursive2)
1989
+ |
1982
1990
|case class Recursive2(r3: Recursive3)
1991
+ |
1983
1992
|case class Recursive3(r1: Recursive1)
1993
+ |
1984
1994
|JsonCodecMaker.make[NonRecursive]""" .stripMargin
1985
1995
}).getMessage.contains {
1986
1996
""" Recursive type(s) detected: 'Recursive1', 'Recursive2', 'Recursive3'. Please consider using a custom
@@ -1990,6 +2000,7 @@ class JsonCodecMakerSpec extends VerifyingSpec {
1990
2000
})
1991
2001
assert(intercept[TestFailedException ](assertCompiles {
1992
2002
""" case class HigherKindedType[F[_]](f: F[Int], fs: F[HigherKindedType[F]])
2003
+ |
1993
2004
|JsonCodecMaker.make[HigherKindedType[Option]]""" .stripMargin
1994
2005
}).getMessage.contains(
1995
2006
s """ Recursive type(s) detected: ${
@@ -2252,7 +2263,9 @@ class JsonCodecMakerSpec extends VerifyingSpec {
2252
2263
" don't generate codecs for CodecMakerConfig.withDiscriminatorFieldName(_root_.scala.None).withAlwaysEmitDiscriminator(true) compile-time configuration" in {
2253
2264
assert(intercept[TestFailedException ](assertCompiles {
2254
2265
""" sealed trait A
2266
+ |
2255
2267
|case class B(y: Int) extends A
2268
+ |
2256
2269
|JsonCodecMaker.make[B](CodecMakerConfig.withDiscriminatorFieldName(_root_.scala.None).withAlwaysEmitDiscriminator(true))""" .stripMargin
2257
2270
}).getMessage.contains {
2258
2271
" 'discriminatorFieldName' should not be 'None' when 'alwaysEmitDiscriminator' is 'true'"
@@ -2314,91 +2327,6 @@ class JsonCodecMakerSpec extends VerifyingSpec {
2314
2327
""" 'discriminatorFieldName' should be 'None' when 'circeLikeObjectEncoding' is 'true'"""
2315
2328
})
2316
2329
}
2317
- " serialize (but don't require on deserialization) discriminators for ADT leaf codecs when alwaysEmitDiscriminator is enabled" in {
2318
- sealed trait MyAdt
2319
- case class FooLeaf (x : Int , y : String ) extends MyAdt
2320
- case class BarLeaf (a : String , b : Int ) extends MyAdt
2321
- @ named(" baz" )
2322
- case class BazLeaf (x : String , z : Double ) extends MyAdt
2323
- sealed abstract class Intermediate extends MyAdt {
2324
- def tag : String
2325
- }
2326
- final case class Alpha (tag : String , a : Long ) extends Intermediate
2327
- final case class Beta (tag : String , b : Double ) extends Intermediate
2328
- @ named(" aa" )
2329
- final case class AlwaysEmitInCompanion (c : String , d : Double ) extends MyAdt
2330
- object AlwaysEmitInCompanion {
2331
- implicit val alwaysEmitCodec : JsonValueCodec [AlwaysEmitInCompanion ] = make(CodecMakerConfig .withAlwaysEmitDiscriminator(true ))
2332
- }
2333
-
2334
- val defaultBaseAdtCodec : JsonValueCodec [MyAdt ] = make[MyAdt ]
2335
- val alwaysEmitBaseAdtCodec : JsonValueCodec [MyAdt ] = make(CodecMakerConfig .withAlwaysEmitDiscriminator(true ))
2336
- verifySerDeser(defaultBaseAdtCodec, FooLeaf (12 , " VV" ), """ {"type":"FooLeaf","x":12,"y":"VV"}""" )
2337
- verifySerDeser(alwaysEmitBaseAdtCodec, FooLeaf (12 , " VV" ), """ {"type":"FooLeaf","x":12,"y":"VV"}""" )
2338
- verifySerDeser(alwaysEmitBaseAdtCodec, BazLeaf (" BB" , 1.2 ), """ {"type":"baz","x":"BB","z":1.2}""" )
2339
- verifySerDeser(defaultBaseAdtCodec, BazLeaf (" BB" , 1.2 ), """ {"type":"baz","x":"BB","z":1.2}""" )
2340
- verifySerDeser(defaultBaseAdtCodec, Alpha (" ttt" , 1000L ), """ {"type":"Alpha","tag":"ttt","a":1000}""" )
2341
- verifySerDeser(alwaysEmitBaseAdtCodec, Alpha (" ttt" , 1000L ), """ {"type":"Alpha","tag":"ttt","a":1000}""" )
2342
- verifySerDeser(defaultBaseAdtCodec, AlwaysEmitInCompanion (" ccc" , 3.4 ), """ {"type":"aa","c":"ccc","d":3.4}""" )
2343
- verifySerDeser(alwaysEmitBaseAdtCodec, AlwaysEmitInCompanion (" ccc" , 3.4 ), """ {"type":"aa","c":"ccc","d":3.4}""" )
2344
- verifyDeserError(defaultBaseAdtCodec, """ {"x":12,"y":"VV"}""" , """ expected key: "type"""" )
2345
- verifyDeserError(alwaysEmitBaseAdtCodec, """ {"x":12,"y":"VV"}""" , """ expected key: "type"""" )
2346
-
2347
- val defaultBarLeafCodec : JsonValueCodec [BarLeaf ] = make
2348
- val alwaysEmitBarLeafCodec : JsonValueCodec [BarLeaf ] = make(CodecMakerConfig .withAlwaysEmitDiscriminator(true ))
2349
- verifySerDeser(defaultBarLeafCodec, BarLeaf (" AA" ,13 ), """ {"a":"AA","b":13}""" )
2350
- verifySerDeser(alwaysEmitBarLeafCodec, BarLeaf (" AA" , 13 ), """ {"type":"BarLeaf","a":"AA","b":13}""" )
2351
- verifyDeser(alwaysEmitBarLeafCodec, BarLeaf (" AA" , 13 ), """ {"a":"AA","b":13}""" )
2352
- verifyDeser(defaultBarLeafCodec, BarLeaf (" AA" , 13 ), """ {"a":"AA","b":13}""" )
2353
-
2354
- val defaultBazLeafCodec : JsonValueCodec [BazLeaf ] = make
2355
- val alwaysEmitBazLeafCodec : JsonValueCodec [BazLeaf ] = make(CodecMakerConfig .withAlwaysEmitDiscriminator(true ))
2356
- verifySerDeser(defaultBazLeafCodec, BazLeaf (" BB" , 1.2 ), """ {"x":"BB","z":1.2}""" )
2357
- verifySerDeser(alwaysEmitBazLeafCodec, BazLeaf (" BB" , 1.2 ), """ {"type":"baz","x":"BB","z":1.2}""" )
2358
- verifyDeser(alwaysEmitBazLeafCodec, BazLeaf (" BB" , 1.2 ), """ {"x":"BB","z":1.2}""" )
2359
-
2360
- val defaultListBazLeafCodec : JsonValueCodec [List [BazLeaf ]] = make
2361
- val alwaysEmitListBazLeafCodec : JsonValueCodec [List [BazLeaf ]] = make(CodecMakerConfig .withAlwaysEmitDiscriminator(true ))
2362
- verifySerDeser(defaultListBazLeafCodec, List (BazLeaf (" BB" , 1.2 )), """ [{"x":"BB","z":1.2}]""" )
2363
- verifySerDeser(alwaysEmitListBazLeafCodec, List (BazLeaf (" BB" , 1.2 )), """ [{"type":"baz","x":"BB","z":1.2}]""" )
2364
- verifyDeser(alwaysEmitListBazLeafCodec, List (BazLeaf (" BB" , 1.2 )), """ [{"x":"BB","z":1.2}]""" )
2365
-
2366
- val defaultIntermediateCodec : JsonValueCodec [Intermediate ] = make
2367
- val alwaysEmitIntermediateCodec : JsonValueCodec [Intermediate ] = make(CodecMakerConfig .withAlwaysEmitDiscriminator(true ))
2368
- verifySerDeser(defaultIntermediateCodec, Alpha (" ttt" , 1000L ), """ {"type":"Alpha","tag":"ttt","a":1000}""" )
2369
- verifySerDeser(alwaysEmitIntermediateCodec, Alpha (" ttt" , 1000L ), """ {"type":"Alpha","tag":"ttt","a":1000}""" )
2370
- verifySerDeser(defaultIntermediateCodec, Beta (" ttt" , 2.3 ), """ {"type":"Beta","tag":"ttt","b":2.3}""" )
2371
- verifySerDeser(alwaysEmitIntermediateCodec, Beta (" ttt" , 2.3 ), """ {"type":"Beta","tag":"ttt","b":2.3}""" )
2372
- verifyDeserError(defaultIntermediateCodec, """ {"tag":"ttt","b":2.3}""" , """ expected key: "type"""" )
2373
- verifyDeserError(alwaysEmitIntermediateCodec, """ {"tag":"ttt","b":2.3}""" , """ expected key: "type"""" )
2374
-
2375
- // Don't change behavior for standalone classes that are not a member of an ADT
2376
- case class Standalone (f : String , g : Int )
2377
- val defaultStandaloneCodec : JsonValueCodec [Standalone ] = make
2378
- val alwaysEmitStandaloneCodec : JsonValueCodec [Standalone ] = make(CodecMakerConfig .withAlwaysEmitDiscriminator(true ))
2379
- verifySerDeser(defaultStandaloneCodec, Standalone (" FF" , 99 ), """ {"f":"FF","g":99}""" )
2380
- verifySerDeser(alwaysEmitStandaloneCodec, Standalone (" FF" , 99 ), """ {"f":"FF","g":99}""" )
2381
-
2382
- // Make sure we compose well with alwaysEmit codecs defined in companion class
2383
- final case class Composed (refined : AlwaysEmitInCompanion , otherRefined : FooLeaf , unrefined : MyAdt )
2384
- val defaultComposedCodec : JsonValueCodec [Composed ] = make
2385
- val alwaysEmitComposedCodec : JsonValueCodec [Composed ] = make(CodecMakerConfig .withAlwaysEmitDiscriminator(true ))
2386
- val instance = Composed (AlwaysEmitInCompanion (" aeic" , 4.5 ), FooLeaf (19 , " foo" ), BazLeaf (" bb" , 3.7 ))
2387
- // Even though we are using the default non-always-emit config, we should pick up the implicit codec for AlwaysEmitInCompanion
2388
- // from the companion object
2389
- verifySerDeser(defaultComposedCodec, instance,
2390
- """ {"refined":{"type":"aa","c":"aeic","d":4.5},"otherRefined":{"x":19,"y":"foo"},"unrefined":{"type":"baz","x":"bb","z":3.7}}""" )
2391
- // With always emit all of the fields should have their type disciminator emitted
2392
- verifySerDeser(alwaysEmitComposedCodec, instance,
2393
- """ {"refined":{"type":"aa","c":"aeic","d":4.5},"otherRefined":{"type":"FooLeaf","x":19,"y":"foo"},"unrefined":{"type":"baz","x":"bb","z":3.7}}""" )
2394
- // With always emit we still shouldn't require discriminators where they are not necessary
2395
- verifyDeser(alwaysEmitComposedCodec, instance,
2396
- """ {"refined":{"c":"aeic","d":4.5},"otherRefined":{"x":19,"y":"foo"},"unrefined":{"type":"baz","x":"bb","z":3.7}}""" )
2397
- // But we should still require type discriminators where they ARE necessary, in the `unrefined` field
2398
- verifyDeserError(alwaysEmitComposedCodec,
2399
- """ {"refined":{"c":"aeic","d":4.5},"otherRefined":{"x":19,"y":"foo"},"unrefined":{"x":"bb","z":3.7}}""" , """ expected key: "type"""" )
2400
-
2401
- }
2402
2330
" deserialize and throw non-implemented error for serialization with decodingOnly" in {
2403
2331
val decodingOnlyCodec = make[Int ](CodecMakerConfig .withDecodingOnly(true ))
2404
2332
verifyDeser(decodingOnlyCodec, 1 , " 1" )
@@ -2651,17 +2579,23 @@ class JsonCodecMakerSpec extends VerifyingSpec {
2651
2579
" don't generate codecs for non sealed traits or abstract classes as an ADT base" in {
2652
2580
assert(intercept[TestFailedException ](assertCompiles {
2653
2581
""" trait X1799
2582
+ |
2654
2583
|case class A1799(i: Int) extends X1799
2584
+ |
2655
2585
|case object B1799 extends X1799
2586
+ |
2656
2587
|JsonCodecMaker.make[X1799]""" .stripMargin
2657
2588
}).getMessage.contains {
2658
2589
""" Only sealed traits or abstract classes are supported as an ADT base. Please consider sealing the 'X1799' or
2659
2590
|provide a custom implicitly accessible codec for it.""" .stripMargin.replace('\n ' , ' ' )
2660
2591
})
2661
2592
assert(intercept[TestFailedException ](assertCompiles {
2662
2593
""" abstract class X
2594
+ |
2663
2595
|case class A(i: Int) extends X
2596
+ |
2664
2597
|case object B extends X
2598
+ |
2665
2599
|JsonCodecMaker.make[X]""" .stripMargin
2666
2600
}).getMessage.contains {
2667
2601
""" Only sealed traits or abstract classes are supported as an ADT base. Please consider sealing the 'X' or
@@ -2671,21 +2605,31 @@ class JsonCodecMakerSpec extends VerifyingSpec {
2671
2605
" don't generate codecs for ADTs that have intermediate non-sealed traits or abstract classes" in {
2672
2606
assert(intercept[TestFailedException ](assertCompiles {
2673
2607
""" sealed trait X
2608
+ |
2674
2609
|sealed abstract class AX extends X
2610
+ |
2675
2611
|abstract class BX extends X
2612
+ |
2676
2613
|case class A(i: Int) extends AX
2614
+ |
2677
2615
|case object B extends BX
2616
+ |
2678
2617
|JsonCodecMaker.make[X]""" .stripMargin
2679
2618
}).getMessage.contains {
2680
2619
""" Only sealed intermediate traits or abstract classes are supported. Please consider using of them for ADT
2681
2620
|with base 'X' or provide a custom implicitly accessible codec for the ADT base.""" .stripMargin.replace('\n ' , ' ' )
2682
2621
})
2683
2622
assert(intercept[TestFailedException ](assertCompiles {
2684
2623
""" sealed trait X
2624
+ |
2685
2625
|sealed trait AX extends X
2626
+ |
2686
2627
|trait BX extends X
2628
+ |
2687
2629
|case class A(i: Int) extends AX
2630
+ |
2688
2631
|case object B extends BX
2632
+ |
2689
2633
|JsonCodecMaker.make[X]""" .stripMargin
2690
2634
}).getMessage.contains {
2691
2635
""" Only sealed intermediate traits or abstract classes are supported. Please consider using of them for ADT
@@ -2695,13 +2639,15 @@ class JsonCodecMakerSpec extends VerifyingSpec {
2695
2639
" don't generate codecs for ADT bases without leaf classes" in {
2696
2640
assert(intercept[TestFailedException ](assertCompiles {
2697
2641
""" sealed trait X1859 extends Product with Serializable
2642
+ |
2698
2643
|JsonCodecMaker.make[X1859]""" .stripMargin
2699
2644
}).getMessage.contains {
2700
2645
""" Cannot find leaf classes for ADT base 'X1859'. Please add them or provide a custom implicitly
2701
2646
|accessible codec for the ADT base.""" .stripMargin.replace('\n ' , ' ' )
2702
2647
})
2703
2648
assert(intercept[TestFailedException ](assertCompiles {
2704
2649
""" sealed abstract class X extends Product with Serializable
2650
+ |
2705
2651
|JsonCodecMaker.make[X]""" .stripMargin
2706
2652
}).getMessage.contains {
2707
2653
""" Cannot find leaf classes for ADT base 'X'. Please add them or provide a custom implicitly
@@ -2711,8 +2657,11 @@ class JsonCodecMakerSpec extends VerifyingSpec {
2711
2657
" don't generate codecs for case objects which are mapped to the same discriminator value" in {
2712
2658
assert(intercept[TestFailedException ](assertCompiles {
2713
2659
""" sealed trait X extends Product with Serializable
2660
+ |
2714
2661
|case object A extends X
2662
+ |
2715
2663
|case object B extends X
2664
+ |
2716
2665
|JsonCodecMaker.make[X](CodecMakerConfig.withAdtLeafClassNameMapper(_ => "Z"))""" .stripMargin
2717
2666
}).getMessage.contains {
2718
2667
""" Duplicated discriminator defined for ADT base 'X': 'Z'. Values for leaf classes of ADT that are returned by
@@ -2721,8 +2670,11 @@ class JsonCodecMakerSpec extends VerifyingSpec {
2721
2670
})
2722
2671
assert(intercept[TestFailedException ](assertCompiles {
2723
2672
""" sealed trait Data extends Product with Serializable
2673
+ |
2724
2674
|case class Data1(i: Int, s: String) extends Data
2675
+ |
2725
2676
|case object Data1 extends Data
2677
+ |
2726
2678
|val c = make[Data]""" .stripMargin
2727
2679
}).getMessage.contains {
2728
2680
""" Duplicated discriminator defined for ADT base 'Data': 'Data1'. Values for leaf classes of ADT that are
@@ -2733,7 +2685,9 @@ class JsonCodecMakerSpec extends VerifyingSpec {
2733
2685
" don't generate codecs for case classes with fields that the same name as discriminator name" in {
2734
2686
assert(intercept[TestFailedException ](assertCompiles {
2735
2687
""" sealed trait DuplicatedJsonName extends Product with Serializable
2688
+ |
2736
2689
|case class A(x: Int) extends DuplicatedJsonName
2690
+ |
2737
2691
|JsonCodecMaker.make[DuplicatedJsonName](CodecMakerConfig.withDiscriminatorFieldName(_root_.scala.Some("x")))""" .stripMargin
2738
2692
}).getMessage.contains {
2739
2693
""" Duplicated JSON key(s) defined for 'A': 'x'. Keys are derived from field names of the class that are mapped
@@ -2910,6 +2864,7 @@ class JsonCodecMakerSpec extends VerifyingSpec {
2910
2864
" don't generate codecs for first-order types that are specified using 'Any' type parameter" in {
2911
2865
assert(intercept[TestFailedException ](assertCompiles {
2912
2866
""" case class FirstOrder[A](a: A)
2867
+ |
2913
2868
|JsonCodecMaker.make[FirstOrder[_]]""" .stripMargin
2914
2869
}).getMessage.contains {
2915
2870
if (ScalaVersionCheck .isScala2) {
@@ -2997,6 +2952,7 @@ class JsonCodecMakerSpec extends VerifyingSpec {
2997
2952
" don't generate codecs for case classes with non public parameters of the primary constructor" in {
2998
2953
assert(intercept[TestFailedException ](assertCompiles {
2999
2954
""" case class MultiListOfArgsWithNonPublicParam(i: Int)(l: Long)
2955
+ |
3000
2956
|JsonCodecMaker.make[MultiListOfArgsWithNonPublicParam]""" .stripMargin
3001
2957
}).getMessage.contains {
3002
2958
if (ScalaVersionCheck .isScala2) " 'l' parameter of 'MultiListOfArgsWithNonPublicParam' should be defined as 'val' or 'var' in the primary constructor."
@@ -3006,6 +2962,7 @@ class JsonCodecMakerSpec extends VerifyingSpec {
3006
2962
" don't generate codecs for classes with parameters in a primary constructor that have no accessor for read" in {
3007
2963
assert(intercept[TestFailedException ](assertCompiles {
3008
2964
""" class ParamHasNoAccessor(val i: Int, a: String)
2965
+ |
3009
2966
|JsonCodecMaker.make[ParamHasNoAccessor]""" .stripMargin
3010
2967
}).getMessage.contains {
3011
2968
if (ScalaVersionCheck .isScala2) " 'a' parameter of 'ParamHasNoAccessor' should be defined as 'val' or 'var' in the primary constructor."
@@ -3015,12 +2972,17 @@ class JsonCodecMakerSpec extends VerifyingSpec {
3015
2972
" don't generate codecs when all generic type parameters cannot be resolved" in {
3016
2973
assert(intercept[TestFailedException ](assertCompiles {
3017
2974
""" sealed trait Foo[F[_]] extends Product with Serializable
2975
+ |
3018
2976
|case class FooImpl[F[_], A](fa: F[A], as: Vector[A]) extends Foo[F]
2977
+ |
3019
2978
|sealed trait Bar[A] extends Product with Serializable
2979
+ |
3020
2980
|case object Baz extends Bar[Int]
2981
+ |
3021
2982
|case object Qux extends Bar[String]
2983
+ |
3022
2984
|val v = FooImpl[Bar, String](Qux, Vector.empty[String])
3023
- |val c = make[Foo[Bar]]""" .stripMargin
2985
+ |val c = JsonCodecMaker. make[Foo[Bar]]""" .stripMargin
3024
2986
}).getMessage.contains {
3025
2987
if (ScalaVersionCheck .isScala2) " Cannot resolve generic type(s) for `FooImpl[F,A]`. Please provide a custom implicitly accessible codec for it."
3026
2988
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."
@@ -3029,8 +2991,10 @@ class JsonCodecMakerSpec extends VerifyingSpec {
3029
2991
" don't generate codecs when 'AnyVal' or one value classes with 'CodecMakerConfig.withInlineOneValueClasses(true)' are leaf types of the ADT base" in {
3030
2992
assert(intercept[TestFailedException ](assertCompiles {
3031
2993
""" sealed trait X extends Any
2994
+ |
3032
2995
|case class D(value: Double) extends X
3033
- |make[X](CodecMakerConfig.withInlineOneValueClasses(true))""" .stripMargin
2996
+ |
2997
+ |JsonCodecMaker.make[X](CodecMakerConfig.withInlineOneValueClasses(true))""" .stripMargin
3034
2998
}).getMessage.contains {
3035
2999
" 'AnyVal' and one value classes with 'CodecMakerConfig.withInlineOneValueClasses(true)' are not supported as leaf classes for ADT with base 'X'."
3036
3000
})
0 commit comments