Skip to content

Rename static helpers that collide with user names - #853

Open
sueszli wants to merge 2 commits into
exo-lang:mainfrom
sueszli:fix/static-helper-name-collisions
Open

Rename static helpers that collide with user names#853
sueszli wants to merge 2 commits into
exo-lang:mainfrom
sueszli:fix/static-helper-name-collisions

Conversation

@sueszli

@sueszli sueszli commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Note

This patch is very low priority


@proc
def exo_floor_div(dst: f32[1]):
    dst[0] = 1.0

@proc
def user(dst: f32[1], i: index):
    if i / 2 < 0:
        dst[0] = 1.0

Actual:

error: static declaration of 'exo_floor_div' follows non-static declaration

Expected:

static int exo_floor_div_1(int num, int quot) { ... }

@sueszli
sueszli force-pushed the fix/static-helper-name-collisions branch from 25d9dfe to 125bcc0 Compare August 30, 2026 13:07
@codecov

codecov Bot commented Aug 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.58%. Comparing base (defe172) to head (e1e3836).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #853      +/-   ##
==========================================
+ Coverage   88.56%   88.58%   +0.02%     
==========================================
  Files         100      100              
  Lines       21917    21934      +17     
==========================================
+ Hits        19410    19430      +20     
+ Misses       2507     2504       -3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sueszli
sueszli force-pushed the fix/static-helper-name-collisions branch from 125bcc0 to 64fd322 Compare September 1, 2026 21:59
The helpers in _static_helpers are pasted at file scope in the generated C,
so a proc or a proc argument can take a helper name. A proc named
exo_floor_div produced "static declaration of 'exo_floor_div' follows
non-static declaration", and an argument of that name produced "called object
type 'int_fast32_t' is not a function or function pointer".

Rename a helper when a proc takes its name, and reserve helper names in each
proc so that an argument is renamed instead. A renamed argument also avoids
proc names so it cannot shadow a proc it calls.
@sueszli
sueszli force-pushed the fix/static-helper-name-collisions branch from 64fd322 to 52f5cf0 Compare September 2, 2026 21:43
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