Hi!
The following code fails to compile:
proc test(a, b: int | int64) =
discard
test(1.int, 2.int64)
with this error:
a.nim(4, 5) Error: type mismatch: got (int, int64) but expected one of: a.test(a: int or int64, b: int or int64)
While the following code compiles OK:
proc test(a: int | int64, b: int | int64) =
discard
test(1.int, 2.int64)
If I interpret correctly, int | int64 is a union type, whose members are those that are members of int or those that are members of int64.
The first version requires that both a and b are members of this union type, hence it implies no relationship among them. If the | notation was only a shortcut, your interpretation would make sense, but the point is that (I think) int | int64 is a type on its own