Skip to content

Commit 229c737

Browse files
committed
ASR: Return nullptr for None return type in Callback
1 parent a394303 commit 229c737

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/lpython/semantics/python_ast_to_asr.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1703,6 +1703,10 @@ class CommonVisitor : public AST::BaseVisitor<Struct> {
17031703
abi, is_argument);
17041704
}
17051705

1706+
if (AST::is_a<AST::ConstantNone_t>(annotation)) {
1707+
return nullptr;
1708+
}
1709+
17061710
if (AST::is_a<AST::Subscript_t>(annotation)) {
17071711
AST::Subscript_t *s = AST::down_cast<AST::Subscript_t>(&annotation);
17081712
if (AST::is_a<AST::Name_t>(*s->m_value)) {

0 commit comments

Comments
 (0)