From 9ba31fb5e69f7ae9b956833f54ace3a1650d9fcb Mon Sep 17 00:00:00 2001 From: tersec Date: Thu, 10 Oct 2024 12:23:23 +0000 Subject: [PATCH] adjust isomorphicCast to be Nim 2.2-compatible (#6633) --- beacon_chain/spec/datatypes/base.nim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/beacon_chain/spec/datatypes/base.nim b/beacon_chain/spec/datatypes/base.nim index c9b9e6ff4..4f8849478 100644 --- a/beacon_chain/spec/datatypes/base.nim +++ b/beacon_chain/spec/datatypes/base.nim @@ -891,8 +891,9 @@ func getSizeofSig(x: auto, n: int = 0): seq[(string, int, int)] = ## ## These SHOULD be used in function calls to avoid expensive temporary. ## see https://github.com/status-im/nimbus-eth2/pull/2250#discussion_r562010679 -template isomorphicCast*[T, U](x: U): T = +template isomorphicCast*[T](x: auto): T = # Each of these pairs of types has ABI-compatible memory representations. + type U = typeof(x) static: doAssert (T is ref) == (U is ref) when T is ref: type