Cannot embed a void value
This commit is contained in:
parent
c04fc181c8
commit
c9268b2a5d
|
@ -746,7 +746,9 @@ proc toPreserve*[T](x: T; E = void): Preserve[E] =
|
|||
## When `tracePreserves` is defined (`-d:tracePreserves`) a diagnostic
|
||||
## trace is printing during `toPreserve`.
|
||||
when (T is Preserve[E]): result = x
|
||||
elif T is E: result = embed(x)
|
||||
elif T is E:
|
||||
when E is void: {.error: "cannot embed void".}
|
||||
result = embed(x)
|
||||
elif compiles(toPreserveHook(x, E)):
|
||||
result = toPreserveHook(x, E)
|
||||
elif T is enum:
|
||||
|
|
Loading…
Reference in New Issue