From 4d9a2dc28f30f77f6b9fed71acbe9cdf5ee7c78e Mon Sep 17 00:00:00 2001 From: Erik Erlandson Date: Wed, 24 Apr 2024 18:32:12 -0700 Subject: [PATCH] by-name param to fix recursive reader def --- .../src/main/scala/coulomb/integrations/pureconfig/io.scala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pureconfig/src/main/scala/coulomb/integrations/pureconfig/io.scala b/pureconfig/src/main/scala/coulomb/integrations/pureconfig/io.scala index 62cbd3602..3d6b653e1 100644 --- a/pureconfig/src/main/scala/coulomb/integrations/pureconfig/io.scala +++ b/pureconfig/src/main/scala/coulomb/integrations/pureconfig/io.scala @@ -91,7 +91,9 @@ object ruJSON: given ctx_RuntimeUnit_JSON_Reader(using rr: ConfigReader[Rational], - upm: UnitPathMapper + upm: UnitPathMapper, + // by-name parameter to handle recursive definition + crru: => ConfigReader[RuntimeUnit] ): ConfigReader[RuntimeUnit] = ConfigReader[Rational].map(RuntimeUnit.UnitConst(_)) `orElse` ConfigReader[String].emap { id =>