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

use * for pointer type instead of & #1032

Merged
merged 7 commits into from Jun 1, 2018
Merged

use * for pointer type instead of & #1032

merged 7 commits into from Jun 1, 2018

Conversation

andrewrk
Copy link
Member

@andrewrk andrewrk commented Jun 1, 2018

This is part of Pointer Reform (See #770).

To help automatically translate code, see the
zig-fmt-pointer-reform-2 branch. It will convert all & into *. Due to the syntax
ambiguity (which is why we are making this change),
even address-of & will turn into *, so you'll have
to manually fix these instances. You will be guaranteed
to get compile errors for them - expected 'type', found 'foo'

This fixes the cause of a lot of comptime bugs - the fact that
you could not have a pointer to a type (See #588)

This patch does not implement a new pointer type. It only changes the syntax and then fixes the bugs that were caused by the syntactic ambiguity. Further progress on Pointer Reform will happen gradually.

See #770

To help automatically translate code, see the
zig-fmt-pointer-reform-2 branch.

This will convert all & into *. Due to the syntax
ambiguity (which is why we are making this change),
even address-of & will turn into *, so you'll have
to manually fix thes instances. You will be guaranteed
to get compile errors for them - expected 'type', found 'foo'
@andrewrk
Copy link
Member Author

andrewrk commented Jun 1, 2018

Hm, I just realized that AppVeyor has not been running since the rename from zig-lang. Fixing now.

@andrewrk
Copy link
Member Author

andrewrk commented Jun 1, 2018

All checks passed. I will merge this tomorrow morning.

@andrewrk andrewrk merged commit 3918e76 into master Jun 1, 2018
@andrewrk andrewrk deleted the pointer-reform branch June 1, 2018 15:49
@andrewrk
Copy link
Member Author

andrewrk commented Jun 1, 2018

@Hejsil I'd be happy to deal with merging master into std-meta for you and solve the merge conflicts. And also look into that TypeInfo thing.

@Hejsil
Copy link
Sponsor Contributor

Hejsil commented Jun 1, 2018

@andrewrk Sure thing. Idk if I got all redundant builtin removed, but I guess that can wait :)

@andrewrk
Copy link
Member Author

andrewrk commented Jun 1, 2018

Ok, I pushed std-meta-rebased. This has conflicts with master fixed and I ran zig fmt to minimize future conflicts. Now I'll look into the TypeInfo problem.

@andrewrk
Copy link
Member Author

andrewrk commented Jun 1, 2018

I think this can be fixed to actually use nullables now:
if (UnionTag == @typeOf(undefined))

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.

None yet

2 participants