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 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.