Skip to content

Interactive LPython delays the response or crashes #2807

@namannimmo10

Description

@namannimmo10

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions