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

non scalar sentinels allowed in array types #22472

Closed
xdBronch opened this issue Jan 12, 2025 · 0 comments · Fixed by #22473
Closed

non scalar sentinels allowed in array types #22472

xdBronch opened this issue Jan 12, 2025 · 0 comments · Fixed by #22473
Labels
bug Observed behavior contradicts documented or intended behavior frontend Tokenization, parsing, AstGen, Sema, and Liveness.
Milestone

Comments

@xdBronch
Copy link
Contributor

Zig Version

0.14.0-dev.2638+04c9f50ae

Steps to Reproduce and Observed Behavior

test {
    _ = [0:.{}]struct {};
}

non scalar sentinels were removed in #21509 but this still passes. its only when used on slices that it fails

test {
    _ = [:.{}]struct {};
}
a.zig:2:12: error: non-scalar sentinel type 'a.test_0__struct_377'
    _ = [:.{}]struct {};
          ~^~

Expected Behavior

compile error in both examples

@xdBronch xdBronch added the bug Observed behavior contradicts documented or intended behavior label Jan 12, 2025
@mlugg mlugg added the frontend Tokenization, parsing, AstGen, Sema, and Liveness. label Jan 12, 2025
@mlugg mlugg added this to the 0.14.0 milestone Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior frontend Tokenization, parsing, AstGen, Sema, and Liveness.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants