Closed
Description
lpython/src/lpython/semantics/python_ast_to_asr.cpp
Lines 6684 to 6686 in d24f131
Example:
$ cat examples/expr2.py
from lpython import i32, InOut
def reserve(a: InOut[list[i32]], b: i32):
a.append(b)
print("user defined reserve() called")
def main0():
x: list[i32] = []
reserve(x, 5)
assert len(x) == 1
assert x[0] == 5
main0()
$ python examples/expr2.py
user defined reserve() called
$ lpython_in_main examples/expr2.py
AssertionError
Metadata
Metadata
Assignees
Labels
No labels