t7446.nim 169 B

12345678910
  1. proc foo(x: Natural or SomeUnsignedInt):int =
  2. when x is int:
  3. result = 1
  4. else:
  5. result = 2
  6. let a = 10
  7. doAssert foo(a) == 1
  8. let b = 10'u8
  9. doAssert foo(b) == 2