Skip to content

Commit

Permalink
[Importer] fix has value semantic return type (#2404)
Browse files Browse the repository at this point in the history
* fix value semantic return

* address comments

---------

Co-authored-by: zhekun.zhang <[email protected]>
  • Loading branch information
zhekunz2 and zhekunz2 authored Aug 29, 2023
1 parent ca34b9c commit 5282324
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,11 @@ def _get_function_signature(self, function_kind: str,
parameter_decls = list(map(parameter_decl_builder, self.arguments))
parameter_decls = list(filter(None, parameter_decls))
ret_decls = list(map(ret_decl_builder, self.returns))
ret_decls = list(filter(None, ret_decls))
parameters = ", ".join(parameter_decls)
result = ", ".join(ret_decls)
if len(ret_decls) == 0:
result = "None"
if len(ret_decls) >= 2:
result = f"Tuple[{result}]"

Expand Down Expand Up @@ -286,7 +289,7 @@ def parameter_decl_builder(arg: "SIG_ATTR_TYPE") -> str:
return ""

def ret_decl_builder(arg: "SIG_ATTR_TYPE") -> str:
return "None"
return ""

return self._get_function_signature(
"has_value_semantics", parameter_decl_builder, ret_decl_builder)
Expand Down

0 comments on commit 5282324

Please sign in to comment.