Skip to content

Commit b7f9127

Browse files
committed
TESTS: For callback with None return type
1 parent 229c737 commit b7f9127

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

integration_tests/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,7 @@ RUN(NAME global_syms_06 LABELS cpython llvm c)
722722

723723
RUN(NAME callback_01 LABELS cpython llvm c)
724724
RUN(NAME callback_02 LABELS cpython llvm c)
725+
RUN(NAME callback_03 LABELS cpython llvm c)
725726

726727
# Intrinsic Functions
727728
RUN(NAME intrinsics_01 LABELS cpython llvm NOFAST) # any

integration_tests/callback_03.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from lpython import i32, Callable
2+
3+
def foo(x : i32) -> None:
4+
print(x)
5+
assert x == 3
6+
7+
def bar(func : Callable[[i32], None], arg : i32) -> i32:
8+
func(arg)
9+
10+
def main0():
11+
bar(foo, 3)
12+
13+
main0()

0 commit comments

Comments
 (0)