Skip to content

Commit 9ba31fb

Browse files
authoredOct 10, 2024··
adjust isomorphicCast to be Nim 2.2-compatible (#6633)
1 parent 8a91d91 commit 9ba31fb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎beacon_chain/spec/datatypes/base.nim

+2-1
Original file line numberDiff line numberDiff line change
@@ -891,8 +891,9 @@ func getSizeofSig(x: auto, n: int = 0): seq[(string, int, int)] =
891891
##
892892
## These SHOULD be used in function calls to avoid expensive temporary.
893893
## see https://github.com/status-im/nimbus-eth2/pull/2250#discussion_r562010679
894-
template isomorphicCast*[T, U](x: U): T =
894+
template isomorphicCast*[T](x: auto): T =
895895
# Each of these pairs of types has ABI-compatible memory representations.
896+
type U = typeof(x)
896897
static: doAssert (T is ref) == (U is ref)
897898
when T is ref:
898899
type

0 commit comments

Comments
 (0)