Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Codon compiler prioritizes float if both int and float overloads exist for integer value #631

Open
bhargavibheemisetty-dev opened this issue Feb 28, 2025 · 0 comments
Assignees

Comments

@bhargavibheemisetty-dev

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants