| ... | ... | @@ -2127,4 +2127,30 @@ pub fn addCases(cases: &tests.CompileErrorContext) { |
| 2127 | 2127 | , |
| 2128 | 2128 | ".tmp_source.zig:2:33: error: expected type 'GlobalLinkage', found 'u32'"); |
| 2129 | 2129 | |
| 2130 | cases.add("struct with invalid field", |
| 2131 | \\const std = @import("std"); |
| 2132 | \\const Allocator = std.mem.Allocator; |
| 2133 | \\const ArrayList = std.ArrayList; |
| 2134 | \\ |
| 2135 | \\const HeaderWeight = enum { |
| 2136 | \\ H1, H2, H3, H4, H5, H6, |
| 2137 | \\}; |
| 2138 | \\ |
| 2139 | \\const MdText = ArrayList(u8); |
| 2140 | \\ |
| 2141 | \\const MdNode = enum { |
| 2142 | \\ Header: struct { |
| 2143 | \\ text: MdText, |
| 2144 | \\ weight: HeaderValue, |
| 2145 | \\ }, |
| 2146 | \\}; |
| 2147 | \\ |
| 2148 | \\export fn entry() { |
| 2149 | \\ const a = MdNode.Header { |
| 2150 | \\ .text = MdText.init(&std.debug.global_allocator), |
| 2151 | \\ .weight = HeaderWeight.H1, |
| 2152 | \\ }; |
| 2153 | \\} |
| 2154 | , |
| 2155 | ".tmp_source.zig:14:17: error: use of undeclared identifier 'HeaderValue'"); |
| 2130 | 2156 | } |