diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-08-13 02:51:10 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-08-13 02:51:10 -0400 |
| commit | 2c4f6536a34cb55a5dcaf73908b7ea056da802a9 (patch) | |
| tree | 27de91078ac6c0c286b8d769d4b6a4b79d1d7b28 /compile.c | |
| parent | f4011eb489d97bbf3170c81a985a09568bfc0dd7 (diff) | |
Fix Int->Num promotions
Diffstat (limited to 'compile.c')
| -rw-r--r-- | compile.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -36,6 +36,11 @@ static bool promote(env_t *env, CORD *code, type_t *actual, type_t *needed) return true; } + if (actual->tag == IntType && Match(actual, IntType)->bits == 0 && needed->tag == NumType) { + *code = CORD_all("Int$as_num(", *code, ")"); + return true; + } + if (actual->tag == IntType || actual->tag == NumType) return true; |
