Why is overloading a function with different types not possible:
fn sum(num1: Int, num2: Int) -> int:
return num1 + num2
fn sum(num1: Float, num2: Float) -> Float:
return num1 + num2
1 Reply
Your code is incorrect, there is no
int
, only Int
and there's Float32
not Float
function overloading is possible.
will print