import typetraits
when true:
# compiles
proc something*[T, U: SomeNumber](a: T, b: U) =
echo("type `a`:", a.type.name)
echo("type `b`:", b.type.name)
elif false:
# fails
proc something*(a, b: SomeNumber) =
echo("type `a`:", a.type.name)
echo("type `b`:", b.type.name)
else:
# fails
proc something*(a: SomeNumber, b: SomeNumber) =
echo("type `a`:", a.type.name)
echo("type `b`:", b.type.name)
something(2'f32, 2'i32)