Commit e1824580
e18245803e54Merged
Yukihiro "Matz" Matsumoto <[email protected]> · 5 months ago · 2 files · ~2 modified
Description
MultiWriteNode as expression: infer type from RHS value, emit stmt+expr
Allows result = (x, y = call) where the multi-write appears as a
sub-expression by returning infer_type of the RHS value node and
emitting the multi-write as a statement then the RHS as the expression.
Co-Authored-By: Claude Sonnet 4.6 [email protected]
Details
- Commit
- e18245803e54
- Parent
- 277101496b51
src/analyze.cmodifiedView file
@@ -1416,6 +1416,10 @@
14161416
return ty_unify(et, rt);14171417
}14181418
1419+
/* MultiWriteNode as expression: value is the RHS array. */1420+
if (!strcmp(ty, "MultiWriteNode"))1421+
return infer_type(c, nt_ref(nt, id, "value"));1422+
14191423
return TY_UNKNOWN;14201424
}14211425
src/codegen.cmodifiedView file
Loading diff…