Skip to content

fix: overload string->ptr<i8> compatibility, add parser self-test - #432

Merged
godofecht merged 1 commit into
mainfrom
work
Aug 11, 2026
Merged

godofecht merged 1 commit into
mainfrom
work

Conversation

@godofecht

Copy link
Copy Markdown
Contributor

Summary

  • src/flow/overload.py: allow string to match ptr<i8> in overload resolution. Flow string lowers to C char*, so string literals must resolve to mangled names when passed to ptr<i8> parameters.
  • compiler/src/test_parser.flow: self-test for the existing self-hosted parser. Verifies AST node counts for a sample program with 2 functions.

Context

The self-hosted compiler at compiler/src/ (~9600 lines) already has a working lexer, parser, type checker, C generator, JS generator, formatter, and module resolver. It passes its own test suite (flowc: PASS).

Test plan

  • All 1341 unit tests pass
  • ./flow run compiler/src/main.flow passes (flowc: PASS)
  • ./flow run compiler/src/test_parser.flow passes (test_parser: PASS)

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

Generated with Devin

src/flow/overload.py: allow string to match ptr<i8> parameters in
overload resolution. Flow string lowers to C char*, so string
literals need to resolve to mangled function names when passed to
ptr<i8> parameters.

compiler/src/test_parser.flow: self-test for the existing self-hosted
parser. Verifies AST node counts (2 functions, 2 params, 1 let, 3
returns, 1 if, 1 call, 2 binops, 4 ints, 4 idents, 3 blocks) for a
sample program.

The self-hosted compiler at compiler/src/ (~9600 lines) already has
a working lexer, parser, type checker, C generator, JS generator,
formatter, and module resolver. It passes its own test suite.

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

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

cursor Bot commented Aug 11, 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 4ccff00 into main Aug 11, 2026
13 checks passed
@godofecht
godofecht deleted the work branch August 11, 2026 20:19
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