Skip to content

Conversation

abroooo
Copy link
Contributor

@abroooo abroooo commented Sep 23, 2025

This PR introduces the feature to use not only positional but also named arguments for the following builtins:

  • SEL
  • REF
  • ADR
  • UPPER_BOUND
  • LOWER_BOUND
  • SIZEOF
  • SUB
  • DIV

Note

The following builtins don't support named arguments for now:
MUX
GT
LT
NE
LE
EQ
GE
ADD
MUL

Copy link

codecov bot commented Sep 23, 2025

Codecov Report

❌ Patch coverage is 84.44444% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.82%. Comparing base (ce68921) to head (3548826).
⚠️ Report is 22 commits behind head on master.

Files with missing lines Patch % Lines
src/builtins.rs 84.26% 14 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1529      +/-   ##
==========================================
- Coverage   94.03%   93.82%   -0.21%     
==========================================
  Files         174      173       -1     
  Lines       58611    54308    -4303     
==========================================
- Hits        55112    50953    -4159     
+ Misses       3499     3355     -144     

☔ View full report in Codecov by Sentry.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@abroooo abroooo requested review from ghaith, mhasel and volsa September 24, 2025 06:52
assert_eq!(main.res, "world\0".as_bytes());
}

#[test]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH, at this stage i would prefer we don't add any more correctness tests and only use lit tests. We know our correctness tests don't take the full system into consideration when building. We should start planning to report coverage on the lit tests in addition to the current tests and slowly move tests to lit where it makes sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, lit tests are better here. So I'll remove them.

@@ -0,0 +1,126 @@
// RUN: (%COMPILE %s && %RUN) | %CHECK %s
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would create the exact same test for unnamed, even if they work, just so we have them in lit. And eventually we want one that mixes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah makes sense although I'm a bit torn here. It's nice to have them split into seperate tests but it's also nice to have them all together. But to get an overview over what's tested I agree that having distinclty named tests is nicer. So I added a separate one for positional arguments.

@abroooo abroooo requested a review from ghaith September 25, 2025 09:34
@@ -0,0 +1,23 @@
---
source: src/codegen/tests/expression_tests.rs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have some dangling snapshots here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch! will remove them

@abroooo abroooo requested a review from volsa September 30, 2025 09:37
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.

3 participants