Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add function arity checking to calc example #431

Closed
wants to merge 1 commit into from

Conversation

pervognsen
Copy link
Contributor

I'm starting to poke around Salsa 2022 and noticed the calc example's type checker doesn't validate the arity of function calls. Hopefully I'll be able to make more substantial contributions in the future when I get my bearings.

@netlify
Copy link

netlify bot commented Feb 2, 2023

👷 Deploy Preview for salsa-rs processing.

Name Link
🔨 Latest commit f5ee0c8
🔍 Latest deploy log https://app.netlify.com/sites/salsa-rs/deploys/63dc4777fbac190008e1ed30

@netlify
Copy link

netlify bot commented Feb 2, 2023

Deploy Preview for salsa-rs canceled.

Name Link
🔨 Latest commit f5ee0c8
🔍 Latest deploy log https://app.netlify.com/sites/salsa-rs/deploys/63dc4777fbac190008e1ed30

Copy link
Member

@xffxff xffxff left a comment

Choose a reason for hiding this comment

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

Looks good!

Left one nit

self.report_error(
expression.span,
format!(
"the function `{}` expects {expected_arity} argument(s), only {actual_arity} provided",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"the function `{}` expects {expected_arity} argument(s), only {actual_arity} provided",
"the function `{}` expects {expected_arity} argument(s), but {actual_arity} provided",

I think it would be better to change it to "but", because the actual_arity may be more than the expected_arity, as in your test sample below

Copy link
Member

@nikomatsakis nikomatsakis left a comment

Choose a reason for hiding this comment

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

Apologies for letting this sit so long, but this looks like a nice change!

@nikomatsakis
Copy link
Member

This needs to be rebased before landing, any change you are still interested, @pervognsen ? Also, we're doing a renewed push around "Salsa 3.0" if you are still interested in doing more contribution.

@nikomatsakis
Copy link
Member

Going to close this since there has been so much activity! Still relevant though, let's come back to it.

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