diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-12-18 15:21:20 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-12-18 15:21:20 -0500 |
| commit | 1db70d46c62c9478ea84ccff204fb315136e518c (patch) | |
| tree | 0d0699614814d4a5064642c48d54c7382e8a9a8d /compile.c | |
| parent | 1df02db239aad3d19d142cacd04113f9934e947c (diff) | |
Fix cross promotion between types with/without defaults
Diffstat (limited to 'compile.c')
| -rw-r--r-- | compile.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -126,6 +126,10 @@ static bool promote(env_t *env, ast_t *ast, CORD *code, type_t *actual, type_t * if (actual->tag == PointerType && needed->tag == PointerType) return true; + // Cross-promotion between tables with default values and without + if (needed->tag == TableType && actual->tag == TableType) + return true; + if (needed->tag == ClosureType && actual->tag == FunctionType) { *code = CORD_all("((Closure_t){", *code, ", NULL})"); return true; |
