Codon compiler prioritizes float if both int and float overloads exist for integer value
Open
- Dominant language
- Python
- Stars
- 16.8k
- Forks
- 603
- Avg merge
- 4d 23h
- Merged PRs (30d)
- 6
Description
When there are two overload functions with i64 and f64 data types and if user tries to pass integer value, I expect the function with i64 parameter to be called.
Below are the codon overload functions:
@overload
test_function(val: i64):
print('Calling int function')
@overload
test_function(val: f64):
print('Calling float function')
Now if I try to call this function with following parameters
test_function(10)
Actual Output:
Calling float function
Expected output:
Calling int function
Contributor guide
Assessment
This issue has not been assessed yet.