Skip to content

feat(flowc): lower c64/c128 complex constructors in C generator - #459

Merged
godofecht merged 1 commit into
mainfrom
work8
Aug 12, 2026
Merged

godofecht merged 1 commit into
mainfrom
work8

Conversation

@godofecht

Copy link
Copy Markdown
Contributor

Summary

c64(re, im) now lowers to ((float)(re) + (float)(im) * I) and c128(re, im) lowers to ((double)(re) + (double)(im) * I), matching the Python reference compiler. Single-argument forms c64(x) and c128(x) lower to ((float)(x) + 0.0f * I) and ((double)(x) + 0.0 * I).

Previously c64(re, im) was emitted as a bare function call c64(re, im), which failed with "unexpected type name 'c64': expected expression" because c64 is a typedef, not a function.

Test plan

  • Self-host fixed-point passes (byte-identical)
  • Self-compile audit: all compiler/src modules pass
  • Roundtrip: all checks pass
  • rf.flow no longer has unexpected type name 'c64' error

This pull request includes code written with the assistance of AI.
The code has not yet been reviewed by a human.

Generated with Devin

c64(re, im) now lowers to ((float)(re) + (float)(im) * I) and
c128(re, im) lowers to ((double)(re) + (double)(im) * I), matching
the Python reference compiler. Single-argument forms c64(x) and
c128(x) lower to ((float)(x) + 0.0f * I) and ((double)(x) + 0.0 * I).

Previously c64(re, im) was emitted as a bare function call c64(re, im),
which failed with "unexpected type name 'c64': expected expression"
because c64 is a typedef, not a function.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@cursor

cursor Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@godofecht
godofecht merged commit b34a59d into main Aug 12, 2026
15 checks passed
@godofecht
godofecht deleted the work8 branch August 12, 2026 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant