Hello world. Here is my code:
proc myProc[T](i: T):T =
if i is SomeNumber:
return i * 2
else:
return i
myProc true
Compiler considers that I multiply a bool by an int. It says: Error: type mismatch: got <bool, int literal(2)>
The type of I and the return type MUST be known on compile time.
Nonetheless, this can be fixed by replacing the if with a when (converting the run time check into a compile time check)