| author | |
| committer | |
| log | 16dcefaca5956af747c29d6ab1915cc955f81af9 |
| tree | 1d9eccf190b7a65a9ab9e78f1dd799de6ea55b4f |
| parent | 6bba5a39e4a4eb2262052a6d218cf71795a9d704 |
Closes #6305. In the C++ implementation this hit a compiler assertion.
It is handled properly in the self-hosted version.1 files changed, 13 insertions(+), 0 deletions(-)
test/cases/compile_errors/comptime_dereference_slice_of_struct.zig created+13| ... | ... | @@ -0,0 +1,13 @@ |
| 1 | const MyStruct = struct { x: bool = false }; | |
| 2 | ||
| 3 | comptime { | |
| 4 | const x = &[_]MyStruct{ .{}, .{} }; | |
| 5 | const y = x[0..1] ++ &[_]MyStruct{}; | |
| 6 | _ = y; | |
| 7 | } | |
| 8 | ||
| 9 | // error | |
| 10 | // backend=stage2 | |
| 11 | // target=native | |
| 12 | // | |
| 13 | // :5:16: error: comptime dereference requires '[1]tmp.MyStruct' to have a well-defined layout, but it does not. |