I need something that not going to cause compilation error for the case when
expr does not have a type
template filter(expr: untyped) =
when expr is seq[bool]: echo "bool"
elif expr is seq[int]: echo "int"
else: discard
filter(a + b) # a and b are not defined, hence no type.
# Should gracefully go to else statement, but currently
causes compilation error
- How check if expression has a type without triggering compilati... cdome
- Re: How check if expression has a type without triggering ... Arrrrrrrrr
- Re: How check if expression has a type without trigger... cdome
