diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-08-24 14:18:22 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-08-24 14:18:22 -0400 |
| commit | be534f5e511a1d3836254b827cdaa2b8c309f5c4 (patch) | |
| tree | 478fc9ede3a1c61220d3b02a2524fb32d53e7300 /src/typecheck.h | |
| parent | 788922fa2437c5b680b57d8adaaac9012fd5aba4 (diff) | |
Constructors and functions with underscore arguments should be allowed to be called, but
only if the underscore arguments are not provided but are implicit from
the default values. Same for constructing structs with private fields.
Diffstat (limited to 'src/typecheck.h')
| -rw-r--r-- | src/typecheck.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/typecheck.h b/src/typecheck.h index b2be77bf..34fc33a1 100644 --- a/src/typecheck.h +++ b/src/typecheck.h @@ -4,6 +4,7 @@ #include <gc.h> #include <stdarg.h> +#include <stdbool.h> #include "ast.h" #include "environment.h" @@ -25,7 +26,12 @@ PUREFUNC bool can_be_mutated(env_t *env, ast_t *ast); type_t *parse_type_string(env_t *env, const char *str); type_t *get_method_type(env_t *env, ast_t *self, const char *name); PUREFUNC bool is_constant(env_t *env, ast_t *ast); -bool is_valid_call(env_t *env, arg_t *spec_args, arg_ast_t *call_args, bool promotion_allowed); PUREFUNC bool can_compile_to_type(env_t *env, ast_t *ast, type_t *needed); +typedef struct { + bool promotion : 1, underscores : 1; +} call_opts_t; + +bool is_valid_call(env_t *env, arg_t *spec_args, arg_ast_t *call_args, call_opts_t options); + // vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0 |
