diff options
| author | Zuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian> | 2026-01-25 10:33:34 +0000 |
|---|---|---|
| committer | Zuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian> | 2026-01-25 10:33:34 +0000 |
| commit | 17cc0542def402f5b0788ff9e8fe0538f81d5ddf (patch) | |
| tree | 58ef40e2974cb34cae20c7da96b7de9341988c4c /src/ast | |
| parent | 7813a12ed59274989ce954c931bf02ebea2a0104 (diff) | |
Fix for #114
Diffstat (limited to 'src/ast')
| -rw-r--r-- | src/ast/ast.c | 5 | ||||
| -rw-r--r-- | src/ast/ast.h | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/ast/ast.c b/src/ast/ast.c index 78d7efb..b20d9c2 100644 --- a/src/ast/ast.c +++ b/src/ast/ast.c @@ -129,6 +129,11 @@ int type_eq(Type *a, Type *b) return 1; } + if (a->kind == TYPE_UNKNOWN || b->kind == TYPE_UNKNOWN) + { + return 1; + } + // Lax integer matching (bool == int, char == i8, etc.). if (is_integer_type(a) && is_integer_type(b)) { diff --git a/src/ast/ast.h b/src/ast/ast.h index 5bcc4d5..21dbdbf 100644 --- a/src/ast/ast.h +++ b/src/ast/ast.h @@ -315,9 +315,11 @@ struct ASTNode struct { char *pattern; - char *binding_name; + char **binding_names; // Multiple bindings + int binding_count; // Count + int *binding_refs; // Ref flags per binding int is_destructuring; - int is_ref; // New: Supports 'ref' binding (Some(ref x)) + int is_ref; // Legacy single ref, I will remove it next. ASTNode *guard; ASTNode *body; int is_default; |
