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
Type inference fails while converting between types and assigning.
Example
>>> x: i32 = i32("123")
semantic error: Type mismatch in annotation-assignment, the types must be compatible
--> input:1:1
|
1 | x: i32 = i32("123")
| ^ ^^^^^ type mismatch ('i32' and 'str')
Note: Please report unclear or confusing messages as bugs at
https://github.com/lcompilers/lpython/issues.
But it works while printing.
❯ lp
>>> print(i32("123"))
123
Can i32 function type cast?
If someone can suggest a more meaningful title for this issue, I would appreciate it.
The text was updated successfully, but these errors were encountered:
Type inference fails while converting between types and assigning.
Example
But it works while printing.
❯ lp >>> print(i32("123")) 123
Can
i32
function type cast?The text was updated successfully, but these errors were encountered: