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

Docs fix array/pointer/slice type coercion section #9392

Merged
merged 3 commits into from
Jul 23, 2021
Merged

Docs fix array/pointer/slice type coercion section #9392

merged 3 commits into from
Jul 23, 2021

Conversation

BuzzwordChief
Copy link
Contributor

@BuzzwordChief BuzzwordChief commented Jul 16, 2021

The type coercion removed in #265 ([X]T => [] const T) has to be removed from the docs.

@BuzzwordChief BuzzwordChief changed the title removed deprecated coercion: [X]T => [] const T Docs removed deprecated coercion Jul 16, 2021
@ghost
Copy link

ghost commented Jul 16, 2021

Actually the example code is correct but the test names are wrong.

Heading: Type Coercion: Arrays and Pointers -> Type Coercion: Slices and Pointers to Arrays ?

Comment mentioning issue 265 should be amended.

Test name: [N]T to []const T -> *const [N]T to []const T

Test name: [N]T to E![]const T -> *const [N]T to E![]const T

Test name: [N]T to ?[]const T -> *const [N]T to ?[]const T

This section could also be fleshed out to talk about sentinel terminated arrays explicitly. But the coercion section is already pretty gigantic...

@BuzzwordChief
Copy link
Contributor Author

You are absolutly right! I converted slices/arrays/pointers all night and in my opinion this deserves a few more examples (espcially bc arrays are so differeny to C's). I will fix that up and write one test converting string literals to include sentinel terminated * conversions.

@BuzzwordChief BuzzwordChief changed the title Docs removed deprecated coercion Docs fix array/pointer/slice type coercion section Jul 16, 2021
@Vexu Vexu merged commit e5b4762 into ziglang:master Jul 23, 2021
andrewrk pushed a commit that referenced this pull request Aug 31, 2021
* removed deprecated coercion: [X]T => [] const T

* Fixed tests and added desc for first test

* Improved heading
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.

2 participants