Fix post-return compilation warning

This commit is contained in:
Emery Hemingway 2023-09-13 09:38:11 +02:00
parent ab3bd12c11
commit 53981fd70a
1 changed files with 5 additions and 4 deletions

View File

@ -1171,10 +1171,11 @@ proc fromPreserve*[T, E](v: var T; pr: Preserve[E]): bool {.gcsafe.} =
result = fromPreserveHook(v, pr)
# a previous branch determined that the hook does not compile but
# calling it here explicitly produces a reasonable compiler error
if not result:
trace T, " !- ", pr
else:
trace T, " <- ", pr
when defined(tracePreserves):
if not result:
trace T, " !- ", pr
else:
trace T, " <- ", pr
proc preserveTo*(pr: Preserve; T: typedesc): Option[T] =
## Reverse of `toPreserve`.