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

Interactive LPython delays the response or crashes #2807

Closed
namannimmo10 opened this issue Aug 27, 2024 · 0 comments · Fixed by #2809
Closed

Interactive LPython delays the response or crashes #2807

namannimmo10 opened this issue Aug 27, 2024 · 0 comments · Fixed by #2809

Comments

@namannimmo10
Copy link
Collaborator

To reproduce,

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

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

Successfully merging a pull request may close this issue.

1 participant