diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-08-13 03:08:27 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-08-13 03:08:27 -0400 |
| commit | 73656027151e14a5ee0299238196449d01eca36d (patch) | |
| tree | 6a2a4301102ef9a8c1f01948da1ae973c148e674 | |
| parent | 6f33b9301416d28ef1825358af58c0213ce7567f (diff) | |
Fixing up more stuff
| -rw-r--r-- | compile.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -2361,6 +2361,9 @@ CORD compile(env_t *env, ast_t *ast) type_t *actual = get_type(env, call->args->value); if (actual->tag != IntType && actual->tag != NumType) code_err(call->args->value, "This %T value cannot be converted to a %T", actual, t); + if (actual->tag == IntType && Match(actual, IntType)->bits == 0) + return CORD_all("((", compile_type(t), ")", t->tag == IntType ? "Int$as_i64" : "Int$as_num", "(", + compile(env, call->args->value), "))"); return CORD_all("((", compile_type(t), ")(", compile(env, call->args->value), "))"); } else if (t->tag == TextType) { // Text constructor: |
