From 95e582cc75fff6ddeb788d9a261c1aac0813effe Mon Sep 17 00:00:00 2001 From: Benoit Louy Date: Mon, 12 Feb 2024 13:44:02 -0500 Subject: [PATCH] fix infinite recursion when calling Bijection.identity --- modules/core/src/smithy4s/Bijection.scala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/core/src/smithy4s/Bijection.scala b/modules/core/src/smithy4s/Bijection.scala index 9db60d00c..2459fdc9f 100644 --- a/modules/core/src/smithy4s/Bijection.scala +++ b/modules/core/src/smithy4s/Bijection.scala @@ -16,6 +16,8 @@ package smithy4s +import scala.Predef.{identity => identity0, _} + /** * A bijection is an association of two opposite functions A => B and B => A. * @@ -47,7 +49,7 @@ trait Bijection[A, B] extends Function[A, B] { outer => } object Bijection { - def identity[A]: Bijection[A, A] = apply(identity[A], identity[A]) + def identity[A]: Bijection[A, A] = apply(identity0[A], identity0[A]) def apply[A, B](to: A => B, from: B => A): Bijection[A, B] = new Impl[A, B](to, from)