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

stage1: add @hasField() built-in #2438

Merged
merged 3 commits into from
Jul 2, 2019
Merged

stage1: add @hasField() built-in #2438

merged 3 commits into from
Jul 2, 2019

Conversation

shawnl
Copy link
Contributor

@shawnl shawnl commented May 6, 2019

This was quite straight-forward

Closes: #1439

shawnl added 2 commits May 6, 2019 11:52
@shawnl
Copy link
Contributor Author

shawnl commented May 6, 2019

It doesn't work on imports.

@shawnl shawnl closed this May 6, 2019
@shawnl shawnl reopened this May 26, 2019
@emekoi
Copy link
Contributor

emekoi commented May 27, 2019

shouldn't it be @hasField(comptime T: type, comptime name: []const u8) bool? why must name be mutable?

@shawnl
Copy link
Contributor Author

shawnl commented May 27, 2019

@emekoi your right. That is the correct documentation of what the code already does.

Actually include the tests I wrote
IrInstruction base;

IrInstruction *container_type;
Buf *field_name_buffer;
Copy link
Member

Choose a reason for hiding this comment

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

I don't think the existence of this field is correct. I think you can follow this pattern: 269a53b

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was following another existing pattern.

@andrewrk andrewrk merged commit 5a91dbc into ziglang:master Jul 2, 2019
@andrewrk
Copy link
Member

andrewrk commented Jul 2, 2019

Thanks, and please have a look at the fixups commit: df11512

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.

introduce @hasField builtin function
3 participants