work around type issues

This commit is contained in:
Jacek Sieka 2020-05-29 16:37:59 +02:00
parent 4fc9a84c57
commit a0b8b818f3
No known key found for this signature in database
GPG Key ID: A1B09461ABB656B8

View File

@ -236,18 +236,21 @@ macro unsupported*(T: typed): untyped =
# File both problems as issues.
error "SSZ serialization of the type " & humaneTypeName(T) & " is not supported"
template ElemType*(T: type[HashArray]): untyped =
type(default(T).data[0])
template ElemType*(T: type HashArray): untyped =
T.T
template ElemType*(T: type[HashList]): untyped =
type(default(T).data[0])
template ElemType*(T: type HashList): untyped =
T.T
template ElemType*(T: type[array]): untyped =
template ElemType*(T: type array): untyped =
type(default(T)[low(T)])
template ElemType*(T: type[seq|List]): untyped =
template ElemType*(T: type seq): untyped =
type(default(T)[0])
template ElemType*(T: type List): untyped =
T.T
func isFixedSize*(T0: type): bool {.compileTime.} =
mixin toSszType, enumAllSerializedFields