Fix a FieldError crash in the == comparison for Result[void, T]

This commit is contained in:
Zahary Karadjov 2021-02-22 20:59:54 +02:00
parent 04f8150a08
commit 42475fd2f1
No known key found for this signature in database
GPG Key ID: C8936F8A3073D609
1 changed files with 2 additions and 0 deletions

View File

@ -453,6 +453,8 @@ func `==`*[T0: not void, E0, T1: not void, E1](lhs: Result[T0, E0], rhs: Result[
func `==`*[E0, E1](lhs: Result[void, E0], rhs: Result[void, E1]): bool {.inline.} =
if lhs.o != rhs.o:
false
elif lhs.o:
true
else:
lhs.e == rhs.e