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

fix: mangle field names in setter templates #1379

Merged
merged 2 commits into from
Jan 24, 2022

Conversation

scolsen
Copy link
Contributor

@scolsen scolsen commented Jan 14, 2022

This fixes a regression whereby the names of struct fields weren't
mangled in calls to setters/mutators, resulting in invalid C code if the
user happened to use reserved words in their struct field names such as
"short" or a disallowed character like a dash.

Fixes #1378

This fixes a regression whereby the names of struct fields weren't
mangled in calls to setters/mutators, resulting in invalid C code if the
user happened to use reserved words in their struct field names such as
"short" or a disallowed character like a dash.
@scolsen scolsen requested a review from a team January 14, 2022 18:08
@TimDeve
Copy link
Contributor

TimDeve commented Jan 15, 2022

Should we add unit tests for when there's code changes that fix regressions/bugs?

@scolsen
Copy link
Contributor Author

scolsen commented Jan 15, 2022

Should we add unit tests for when there's code changes that fix regressions/bugs?

Definitely, I can add some to this PR

Copy link
Collaborator

@eriksvedang eriksvedang left a comment

Choose a reason for hiding this comment

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

Nice!

This test ensures struct field names are mangled correctly in C output.
@scolsen
Copy link
Contributor Author

scolsen commented Jan 24, 2022

Added a regression test

@eriksvedang eriksvedang merged commit 6f120b0 into carp-lang:master Jan 24, 2022
@eriksvedang
Copy link
Collaborator

Nice!

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.

regression Struct field names are no longer mangled in field mutators
3 participants