Open Trevor-Strong opened 5 months ago
This is not a bug, but it's worded reasonably enough for a proposal, so I will label it as such.
FWIW, I personally want to go the other way, by eliminating the coercion *T
-> *[1]T
. This coercion is a pain for RLS, because it makes it far more difficult to provide an appropriate result type to the sub-expression x
in &x
.
Zig Version
0.12.0
Steps to Reproduce and Observed Behavior
run
zig test
on the following fileProduces the compile error:
Expected Behavior
Either both lines should cause a compile error, or neither of them should. Seeing how #3156 was accepted, it should be that both of these pass.
Status quo way to resolve this is
&array_pointer[0]
. This isn't much typing, but the real issue I have with the status quo is that it is unintuitive to require different syntax depending on the direction the conversion is going.All other conversions in I know of are either only 1000% known to be safe in one direction (i.e.
i8
toi32
,*T
to*const T
), or use the same syntax for both directions (uN
toiN
andiN
touN
are both done with@bitCast
).