Skip to content

Commit 3da7e86

Browse files
committed
bypass(NIM-BUG), fixup! feat(bool): pybool cvt works for Option, bool-able: T is SomeNumber not compile
1 parent 50156e6 commit 3da7e86

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/pylib/pybool.nim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ template toBool*[T](arg: T): bool =
6565
# If we have len proc for this object
6666
when compiles(arg.len):
6767
arg.len > 0
68-
elif T is SomeNumber:
68+
elif system.`is`(arg, SomeNumber):
6969
# If we can compare if it's not 0
7070
arg != 0 # works for NaN
7171
# If we can compare if it's greater than 0
@@ -78,7 +78,7 @@ template toBool*[T](arg: T): bool =
7878
arg != None
7979
elif compiles(bool(arg)):
8080
bool(arg)
81-
elif T is Option:
81+
elif system.`is`(T, Option):
8282
arg.optionToBool
8383
else:
8484
# XXX: is this correct?

0 commit comments

Comments
 (0)