Add compile error test for comptime slice-of-struct copy
Closes #6305. In the C++ implementation this hit a compiler assertion. It is handled properly in the self-hosted version.
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
const MyStruct = struct { x: bool = false };
|
||||
|
||||
comptime {
|
||||
const x = &[_]MyStruct{ .{}, .{} };
|
||||
const y = x[0..1] ++ &[_]MyStruct{};
|
||||
_ = y;
|
||||
}
|
||||
|
||||
// error
|
||||
// backend=stage2
|
||||
// target=native
|
||||
//
|
||||
// :5:16: error: comptime dereference requires '[1]tmp.MyStruct' to have a well-defined layout, but it does not.
|
||||
Reference in New Issue
Block a user