diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-04-07 15:13:07 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-04-07 15:13:07 -0400 |
| commit | d2bee9ce7401672cae5cf02cf15dfa0ee48c2352 (patch) | |
| tree | 575d068817fccef76596537ac9e59592fdb933b7 /src/typecheck.c | |
| parent | 14d8b534ef2fc2dd011c9bd6af29929ccd4f2102 (diff) | |
Fix for (&table).keys being seen as mutable
Diffstat (limited to 'src/typecheck.c')
| -rw-r--r-- | src/typecheck.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/typecheck.c b/src/typecheck.c index fedc7c96..f5acad31 100644 --- a/src/typecheck.c +++ b/src/typecheck.c @@ -1599,7 +1599,8 @@ PUREFUNC bool can_be_mutated(env_t *env, ast_t *ast) auto access = Match(ast, FieldAccess); type_t *fielded_type = get_type(env, access->fielded); if (fielded_type->tag == PointerType) { - return true; + type_t *val = value_type(fielded_type); + return val->tag == StructType; } else if (fielded_type->tag == StructType) { return can_be_mutated(env, access->fielded); } else { |
