Raise exception while nested calling of ms_function

This commit is contained in:
zhangzhaoju 2021-09-02 19:14:17 +08:00
parent 36be3f9c4f
commit 477bf20fa6
1 changed files with 6 additions and 0 deletions

View File

@ -549,6 +549,12 @@ class Parser:
error_info = f"The builtin function '{var}' is not supported in graph mode."
return None, var, error_info
return self.global_namespace, var
# For ms_function the function_name not equals to __code__.co_name
if self.function_name != self.fn.__code__.co_name:
raise TypeError(f"Not support nested calling of local ms_function, "
f"please delete decorator of '{self.function_name}'.")
error_info = f"The name '{var}' is not defined."
return None, var, error_info