t1.nim 541 B

123456789101112131415
  1. doAssert typeOf(1.int64 + 1.int) is int64
  2. doAssert typeOf(1.uint64 + 1.uint) is uint64
  3. doAssert int64 is SomeNumber
  4. doAssert int64 is (SomeNumber and not(uint32|uint64|uint|int))
  5. doAssert int64 is (not(uint32|uint64|uint|int))
  6. doAssert int isnot int64
  7. doAssert int64 isnot int
  8. var myInt16 = 5i16
  9. var myInt: int
  10. doAssert typeOf(myInt16 + 34) is int16 # of type `int16`
  11. doAssert typeOf(myInt16 + myInt) is int # of type `int`
  12. doAssert typeOf(myInt16 + 2i32) is int32 # of type `int32`
  13. doAssert int32 isnot int64
  14. doAssert int32 isnot int