@@ -900,7 +900,9 @@ static inline ASR::asr_t* create_LogGamma(Allocator& al, const Location& loc,
900
900
const std::function<void (const std::string &, const Location &)> err) {
901
901
ASR::ttype_t *type = ASRUtils::expr_type (args[0 ]);
902
902
903
- if (!ASRUtils::is_real (*type)) {
903
+ if (args.n != 1 ) {
904
+ err (" Intrinsic `log_gamma` accepts exactly one argument" , loc);
905
+ } else if (!ASRUtils::is_real (*type)) {
904
906
err (" `x` argument of `log_gamma` must be real" ,
905
907
args[0 ]->base .loc );
906
908
}
@@ -951,7 +953,9 @@ namespace X {
951
953
const std::function<void (const std::string &, const Location &)> err) \
952
954
{ \
953
955
ASR::ttype_t *type = ASRUtils::expr_type (args[0 ]); \
954
- if (!ASRUtils::is_real (*type) && !ASRUtils::is_complex (*type)) { \
956
+ if (args.n != 1 ) { \
957
+ err (" Intrinsic `" #X" ` accepts exactly one argument" , loc); \
958
+ } else if (!ASRUtils::is_real (*type) && !ASRUtils::is_complex (*type)) { \
955
959
err (" `x` argument of `" #X" ` must be real or complex" , \
956
960
args[0 ]->base .loc ); \
957
961
} \
@@ -963,7 +967,6 @@ namespace X {
963
967
const Location &loc, SymbolTable *scope, \
964
968
Vec<ASR::ttype_t *>& arg_types, ASR::ttype_t *return_type, \
965
969
Vec<ASR::call_arg_t >& new_args,int64_t overload_id) { \
966
- LCOMPILERS_ASSERT (arg_types.size () == 1 ); \
967
970
ASR::ttype_t * arg_type = arg_types[0 ]; \
968
971
return UnaryIntrinsicFunction::instantiate_functions (al, loc, scope, \
969
972
#lcompilers_name, arg_type, return_type, new_args, overload_id); \
0 commit comments