(lp) namannimmo@srf lpython % lpython
>>> a: i32 = 10 1,12 ]
>>> b: f64 = 20. 1,13 ]
>>> a + b 1,6 ]
semantic error: Type mismatch in binary operator; the types must be compatible
--> input:1:1
|
1 | a + b
| ^ ^ type mismatch (i32 and f64)
Note: Please report unclear or confusing messages as bugs at
https://github.com/lcompilers/lpython/issues.
>>> a + i32(b) 1,11 ]
30
>>> pow(a, i32(b)) 1,15 ]
2147483647
>>> a ** i32(b) 1,12 ]
2147483647
>>> a: i32 1,7 ]
style suggestion: Could have used '**' instead of 'pow'
--> input:1:1
|
1 | a: i32
| ^^ '**' could be used instead
semantic error: Symbol is already declared in the same scope
--> input:1:1
|
1 | a: i32
| ~~~~~~~~~~~ original declaration
|
1 | a: i32
| ^^^^^^ redeclaration
The suggestion was delayed in the case above, but it might crash, too.
To reproduce,
The suggestion was delayed in the case above, but it might crash, too.