mirror of https://github.com/status-im/nim-eth.git
allow `ElemType(XXX)` on inputs not called `T` (#414)
Currently, `ElemType` can only be called on `List` types when they are first assigned to a variable called `T`. The template has been adjusted so that different variable names may be used. The template can now also be applied to in-line computed types, e.g., `ElemType(typeof(x))`.
This commit is contained in:
parent
004ea06b80
commit
33f548186d
|
@ -164,8 +164,8 @@ template ElemType*(T: type array): untyped =
|
||||||
template ElemType*(T: type seq): untyped =
|
template ElemType*(T: type seq): untyped =
|
||||||
type(default(T)[0])
|
type(default(T)[0])
|
||||||
|
|
||||||
template ElemType*(T: type List): untyped =
|
template ElemType*(T0: type List): untyped =
|
||||||
T.T
|
T0.T
|
||||||
|
|
||||||
func isFixedSize*(T0: type): bool {.compileTime.} =
|
func isFixedSize*(T0: type): bool {.compileTime.} =
|
||||||
mixin toSszType, enumAllSerializedFields
|
mixin toSszType, enumAllSerializedFields
|
||||||
|
|
Loading…
Reference in New Issue