You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The numeric types i32, i64, f32 and f64 accept String Constants and return value which a str variable can store. What I do here is highly unlikely to be done in the real world, but still, it is not the expected behavior.
The solution is not to disallow accepting string arguments, we need them as mentioned in #2554 . Instead, we need to handle invalid string literals like the above. Hexadecimal and numbers in other bases must be handled too.
The text was updated successfully, but these errors were encountered:
kmr-srbh
changed the title
Bug: All numeric types accept and return string arguments
Bug: All numeric types accpet invalid string literals as arguments
Mar 14, 2024
kmr-srbh
changed the title
Bug: All numeric types accpet invalid string literals as arguments
Bug: All numeric types accept invalid string literals as arguments
Mar 14, 2024
The problem
The numeric types
i32
,i64
,f32
andf64
accept String Constants and return value which astr
variable can store. What I do here is highly unlikely to be done in the real world, but still, it is not the expected behavior.The solution
The solution is not to disallow accepting string arguments, we need them as mentioned in #2554 . Instead, we need to handle invalid string literals like the above. Hexadecimal and numbers in other bases must be handled too.
The text was updated successfully, but these errors were encountered: