| author | |
| committer | |
| log | 3ce857d0543780e96bfd50d75d53d870ff308fef |
| tree | 25ed83292cde880900700a6239dac455a3ffe357 |
| parent | f01f1e33c96f0b00db8e036a654c1b3bf8531cd8 |
| signature |
Resolves: #214362 files changed, 13 insertions(+), 1 deletions(-)
src/InternPool.zig+1-1| ... | ... | @@ -4011,7 +4011,7 @@ pub const LoadedStructType = struct { |
| 4011 | 4011 | |
| 4012 | 4012 | pub fn haveFieldTypes(s: LoadedStructType, ip: *const InternPool) bool { |
| 4013 | 4013 | const types = s.field_types.get(ip); |
| 4014 | return types.len == 0 or types[0] != .none; | |
| 4014 | return types.len == 0 or types[types.len - 1] != .none; | |
| 4015 | 4015 | } |
| 4016 | 4016 | |
| 4017 | 4017 | pub fn haveFieldInits(s: LoadedStructType, ip: *const InternPool) bool { |
test/cases/compile_errors/struct_depends_on_itself_via_non_initial_field.zig created+12| ... | ... | @@ -0,0 +1,12 @@ |
| 1 | const A = struct { | |
| 2 | a: u8, | |
| 3 | bytes: [@sizeOf(A)]u8, | |
| 4 | }; | |
| 5 | ||
| 6 | comptime { | |
| 7 | _ = A; | |
| 8 | } | |
| 9 | ||
| 10 | // error | |
| 11 | // | |
| 12 | // :1:11: error: struct 'tmp.A' depends on itself |