authorgravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2020-07-11 22:04:38+03:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2020-07-12 00:54:07+03:00
logbe1507a7afe4c8869abdbab67a32ede6afe3d938
tree88be868d2b791d3bd7ab5cbd479b11066ece55d2
parent3e095d8ef32fc93f5050cead708849846d626d1d
signaturelock-open Commit is signed but in an unrecognized format.

update compile error tests and some doc comments


8 files changed, 56 insertions(+), 51 deletions(-)

doc/docgen.zig+6-5
...@@ -212,7 +212,7 @@ const Tokenizer = struct {...@@ -212,7 +212,7 @@ const Tokenizer = struct {
212 }212 }
213};213};
214214
215fn parseError(tokenizer: *Tokenizer, token: Token, comptime fmt: []const u8, args: var) anyerror {215fn parseError(tokenizer: *Tokenizer, token: Token, comptime fmt: []const u8, args: anytype) anyerror {
216 const loc = tokenizer.getTokenLocation(token);216 const loc = tokenizer.getTokenLocation(token);
217 const args_prefix = .{ tokenizer.source_file_name, loc.line + 1, loc.column + 1 };217 const args_prefix = .{ tokenizer.source_file_name, loc.line + 1, loc.column + 1 };
218 warn("{}:{}:{}: error: " ++ fmt ++ "\n", args_prefix ++ args);218 warn("{}:{}:{}: error: " ++ fmt ++ "\n", args_prefix ++ args);
...@@ -634,7 +634,7 @@ fn escapeHtml(allocator: *mem.Allocator, input: []const u8) ![]u8 {...@@ -634,7 +634,7 @@ fn escapeHtml(allocator: *mem.Allocator, input: []const u8) ![]u8 {
634 return buf.toOwnedSlice();634 return buf.toOwnedSlice();
635}635}
636636
637fn writeEscaped(out: var, input: []const u8) !void {637fn writeEscaped(out: anytype, input: []const u8) !void {
638 for (input) |c| {638 for (input) |c| {
639 try switch (c) {639 try switch (c) {
640 '&' => out.writeAll("&amp;"),640 '&' => out.writeAll("&amp;"),
...@@ -765,7 +765,7 @@ fn isType(name: []const u8) bool {...@@ -765,7 +765,7 @@ fn isType(name: []const u8) bool {
765 return false;765 return false;
766}766}
767767
768fn tokenizeAndPrintRaw(docgen_tokenizer: *Tokenizer, out: var, source_token: Token, raw_src: []const u8) !void {768fn tokenizeAndPrintRaw(docgen_tokenizer: *Tokenizer, out: anytype, source_token: Token, raw_src: []const u8) !void {
769 const src = mem.trim(u8, raw_src, " \n");769 const src = mem.trim(u8, raw_src, " \n");
770 try out.writeAll("<code class=\"zig\">");770 try out.writeAll("<code class=\"zig\">");
771 var tokenizer = std.zig.Tokenizer.init(src);771 var tokenizer = std.zig.Tokenizer.init(src);
...@@ -825,6 +825,7 @@ fn tokenizeAndPrintRaw(docgen_tokenizer: *Tokenizer, out: var, source_token: Tok...@@ -825,6 +825,7 @@ fn tokenizeAndPrintRaw(docgen_tokenizer: *Tokenizer, out: var, source_token: Tok
825 .Keyword_volatile,825 .Keyword_volatile,
826 .Keyword_allowzero,826 .Keyword_allowzero,
827 .Keyword_while,827 .Keyword_while,
828 .Keyword_anytype,
828 => {829 => {
829 try out.writeAll("<span class=\"tok-kw\">");830 try out.writeAll("<span class=\"tok-kw\">");
830 try writeEscaped(out, src[token.loc.start..token.loc.end]);831 try writeEscaped(out, src[token.loc.start..token.loc.end]);
...@@ -977,12 +978,12 @@ fn tokenizeAndPrintRaw(docgen_tokenizer: *Tokenizer, out: var, source_token: Tok...@@ -977,12 +978,12 @@ fn tokenizeAndPrintRaw(docgen_tokenizer: *Tokenizer, out: var, source_token: Tok
977 try out.writeAll("</code>");978 try out.writeAll("</code>");
978}979}
979980
980fn tokenizeAndPrint(docgen_tokenizer: *Tokenizer, out: var, source_token: Token) !void {981fn tokenizeAndPrint(docgen_tokenizer: *Tokenizer, out: anytype, source_token: Token) !void {
981 const raw_src = docgen_tokenizer.buffer[source_token.start..source_token.end];982 const raw_src = docgen_tokenizer.buffer[source_token.start..source_token.end];
982 return tokenizeAndPrintRaw(docgen_tokenizer, out, source_token, raw_src);983 return tokenizeAndPrintRaw(docgen_tokenizer, out, source_token, raw_src);
983}984}
984985
985fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var, zig_exe: []const u8) !void {986fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: anytype, zig_exe: []const u8) !void {
986 var code_progress_index: usize = 0;987 var code_progress_index: usize = 0;
987988
988 var env_map = try process.getEnvMap(allocator);989 var env_map = try process.getEnvMap(allocator);
lib/std/fmt.zig+1-1
...@@ -69,7 +69,7 @@ fn peekIsAlign(comptime fmt: []const u8) bool {...@@ -69,7 +69,7 @@ fn peekIsAlign(comptime fmt: []const u8) bool {
69///69///
70/// If a formatted user type contains a function of the type70/// If a formatted user type contains a function of the type
71/// ```71/// ```
72/// pub fn format(value: ?, comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: var) !void72/// pub fn format(value: ?, comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) !void
73/// ```73/// ```
74/// with `?` being the type formatted, this function will be called instead of the default implementation.74/// with `?` being the type formatted, this function will be called instead of the default implementation.
75/// This allows user types to be formatted in a logical manner instead of dumping all fields of the type.75/// This allows user types to be formatted in a logical manner instead of dumping all fields of the type.
lib/std/io/serialization.zig+26-22
...@@ -16,14 +16,16 @@ pub const Packing = enum {...@@ -16,14 +16,16 @@ pub const Packing = enum {
16};16};
1717
18/// Creates a deserializer that deserializes types from any stream.18/// Creates a deserializer that deserializes types from any stream.
19/// If `is_packed` is true, the data stream is treated as bit-packed,19/// If `is_packed` is true, the data stream is treated as bit-packed,
20/// otherwise data is expected to be packed to the smallest byte.20/// otherwise data is expected to be packed to the smallest byte.
21/// Types may implement a custom deserialization routine with a21/// Types may implement a custom deserialization routine with a
22/// function named `deserialize` in the form of:22/// function named `deserialize` in the form of:
23/// pub fn deserialize(self: *Self, deserializer: var) !void23/// ```
24/// which will be called when the deserializer is used to deserialize24/// pub fn deserialize(self: *Self, deserializer: anytype) !void
25/// that type. It will pass a pointer to the type instance to deserialize25/// ```
26/// into and a pointer to the deserializer struct.26/// which will be called when the deserializer is used to deserialize
27/// that type. It will pass a pointer to the type instance to deserialize
28/// into and a pointer to the deserializer struct.
27pub fn Deserializer(comptime endian: builtin.Endian, comptime packing: Packing, comptime ReaderType: type) type {29pub fn Deserializer(comptime endian: builtin.Endian, comptime packing: Packing, comptime ReaderType: type) type {
28 return struct {30 return struct {
29 in_stream: if (packing == .Bit) io.BitReader(endian, ReaderType) else ReaderType,31 in_stream: if (packing == .Bit) io.BitReader(endian, ReaderType) else ReaderType,
...@@ -108,7 +110,7 @@ pub fn Deserializer(comptime endian: builtin.Endian, comptime packing: Packing,...@@ -108,7 +110,7 @@ pub fn Deserializer(comptime endian: builtin.Endian, comptime packing: Packing,
108 const C = comptime meta.Child(T);110 const C = comptime meta.Child(T);
109 const child_type_id = @typeInfo(C);111 const child_type_id = @typeInfo(C);
110112
111 //custom deserializer: fn(self: *Self, deserializer: var) !void113 //custom deserializer: fn(self: *Self, deserializer: anytype) !void
112 if (comptime trait.hasFn("deserialize")(C)) return C.deserialize(ptr, self);114 if (comptime trait.hasFn("deserialize")(C)) return C.deserialize(ptr, self);
113115
114 if (comptime trait.isPacked(C) and packing != .Bit) {116 if (comptime trait.isPacked(C) and packing != .Bit) {
...@@ -196,18 +198,20 @@ pub fn deserializer(...@@ -196,18 +198,20 @@ pub fn deserializer(
196}198}
197199
198/// Creates a serializer that serializes types to any stream.200/// Creates a serializer that serializes types to any stream.
199/// If `is_packed` is true, the data will be bit-packed into the stream.201/// If `is_packed` is true, the data will be bit-packed into the stream.
200/// Note that the you must call `serializer.flush()` when you are done202/// Note that the you must call `serializer.flush()` when you are done
201/// writing bit-packed data in order ensure any unwritten bits are committed.203/// writing bit-packed data in order ensure any unwritten bits are committed.
202/// If `is_packed` is false, data is packed to the smallest byte. In the case204/// If `is_packed` is false, data is packed to the smallest byte. In the case
203/// of packed structs, the struct will written bit-packed and with the specified205/// of packed structs, the struct will written bit-packed and with the specified
204/// endianess, after which data will resume being written at the next byte boundary.206/// endianess, after which data will resume being written at the next byte boundary.
205/// Types may implement a custom serialization routine with a207/// Types may implement a custom serialization routine with a
206/// function named `serialize` in the form of:208/// function named `serialize` in the form of:
207/// pub fn serialize(self: Self, serializer: var) !void209/// ```
208/// which will be called when the serializer is used to serialize that type. It will210/// pub fn serialize(self: Self, serializer: anytype) !void
209/// pass a const pointer to the type instance to be serialized and a pointer211/// ```
210/// to the serializer struct.212/// which will be called when the serializer is used to serialize that type. It will
213/// pass a const pointer to the type instance to be serialized and a pointer
214/// to the serializer struct.
211pub fn Serializer(comptime endian: builtin.Endian, comptime packing: Packing, comptime OutStreamType: type) type {215pub fn Serializer(comptime endian: builtin.Endian, comptime packing: Packing, comptime OutStreamType: type) type {
212 return struct {216 return struct {
213 out_stream: if (packing == .Bit) io.BitOutStream(endian, OutStreamType) else OutStreamType,217 out_stream: if (packing == .Bit) io.BitOutStream(endian, OutStreamType) else OutStreamType,
...@@ -270,7 +274,7 @@ pub fn Serializer(comptime endian: builtin.Endian, comptime packing: Packing, co...@@ -270,7 +274,7 @@ pub fn Serializer(comptime endian: builtin.Endian, comptime packing: Packing, co
270 return;274 return;
271 }275 }
272276
273 //custom serializer: fn(self: Self, serializer: var) !void277 //custom serializer: fn(self: Self, serializer: anytype) !void
274 if (comptime trait.hasFn("serialize")(T)) return T.serialize(value, self);278 if (comptime trait.hasFn("serialize")(T)) return T.serialize(value, self);
275279
276 if (comptime trait.isPacked(T) and packing != .Bit) {280 if (comptime trait.isPacked(T) and packing != .Bit) {
lib/std/log.zig+1-1
...@@ -22,7 +22,7 @@ const root = @import("root");...@@ -22,7 +22,7 @@ const root = @import("root");
22//! comptime level: std.log.Level,22//! comptime level: std.log.Level,
23//! comptime scope: @TypeOf(.EnumLiteral),23//! comptime scope: @TypeOf(.EnumLiteral),
24//! comptime format: []const u8,24//! comptime format: []const u8,
25//! args: var,25//! args: anytype,
26//! ) void {26//! ) void {
27//! // Ignore all non-critical logging from sources other than27//! // Ignore all non-critical logging from sources other than
28//! // .my_project and .nice_library28//! // .my_project and .nice_library
lib/std/zig/ast.zig+2-2
...@@ -1052,12 +1052,12 @@ pub const Node = struct {...@@ -1052,12 +1052,12 @@ pub const Node = struct {
1052 const params_len: usize = if (self.params_len == 0)1052 const params_len: usize = if (self.params_len == 0)
1053 01053 0
1054 else switch (self.paramsConst()[self.params_len - 1].param_type) {1054 else switch (self.paramsConst()[self.params_len - 1].param_type) {
1055 .var_type, .type_expr => self.params_len,1055 .any_type, .type_expr => self.params_len,
1056 .var_args => self.params_len - 1,1056 .var_args => self.params_len - 1,
1057 };1057 };
1058 if (i < params_len) {1058 if (i < params_len) {
1059 switch (self.paramsConst()[i].param_type) {1059 switch (self.paramsConst()[i].param_type) {
1060 .var_type => |n| return n,1060 .any_type => |n| return n,
1061 .var_args => unreachable,1061 .var_args => unreachable,
1062 .type_expr => |n| return n,1062 .type_expr => |n| return n,
1063 }1063 }
src-self-hosted/Module.zig+1-1
...@@ -1132,7 +1132,7 @@ fn astGenAndAnalyzeDecl(self: *Module, decl: *Decl) !bool {...@@ -1132,7 +1132,7 @@ fn astGenAndAnalyzeDecl(self: *Module, decl: *Decl) !bool {
1132 const param_types = try fn_type_scope.arena.alloc(*zir.Inst, param_decls.len);1132 const param_types = try fn_type_scope.arena.alloc(*zir.Inst, param_decls.len);
1133 for (param_decls) |param_decl, i| {1133 for (param_decls) |param_decl, i| {
1134 const param_type_node = switch (param_decl.param_type) {1134 const param_type_node = switch (param_decl.param_type) {
1135 .var_type => |node| return self.failNode(&fn_type_scope.base, node, "TODO implement anytype parameter", .{}),1135 .any_type => |node| return self.failNode(&fn_type_scope.base, node, "TODO implement anytype parameter", .{}),
1136 .var_args => |tok| return self.failTok(&fn_type_scope.base, tok, "TODO implement var args", .{}),1136 .var_args => |tok| return self.failTok(&fn_type_scope.base, tok, "TODO implement var args", .{}),
1137 .type_expr => |node| node,1137 .type_expr => |node| node,
1138 };1138 };
src/analyze.cpp+2-2
...@@ -1511,13 +1511,13 @@ ZigType *get_generic_fn_type(CodeGen *g, FnTypeId *fn_type_id) {...@@ -1511,13 +1511,13 @@ ZigType *get_generic_fn_type(CodeGen *g, FnTypeId *fn_type_id) {
1511 }1511 }
1512 for (; i < fn_type_id->param_count; i += 1) {1512 for (; i < fn_type_id->param_count; i += 1) {
1513 const char *comma_str = (i == 0) ? "" : ",";1513 const char *comma_str = (i == 0) ? "" : ",";
1514 buf_appendf(&fn_type->name, "%svar", comma_str);1514 buf_appendf(&fn_type->name, "%sanytype", comma_str);
1515 }1515 }
1516 buf_append_str(&fn_type->name, ")");1516 buf_append_str(&fn_type->name, ")");
1517 if (fn_type_id->cc != CallingConventionUnspecified) {1517 if (fn_type_id->cc != CallingConventionUnspecified) {
1518 buf_appendf(&fn_type->name, " callconv(.%s)", calling_convention_name(fn_type_id->cc));1518 buf_appendf(&fn_type->name, " callconv(.%s)", calling_convention_name(fn_type_id->cc));
1519 }1519 }
1520 buf_append_str(&fn_type->name, " var");1520 buf_append_str(&fn_type->name, " anytype");
15211521
1522 fn_type->data.fn.fn_type_id = *fn_type_id;1522 fn_type->data.fn.fn_type_id = *fn_type_id;
1523 fn_type->data.fn.is_generic = true;1523 fn_type->data.fn.is_generic = true;
test/compile_errors.zig+17-17
...@@ -42,7 +42,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {...@@ -42,7 +42,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
42 \\fn foo() Foo {42 \\fn foo() Foo {
43 \\ return .{ .x = 42 };43 \\ return .{ .x = 42 };
44 \\}44 \\}
45 \\fn bar(val: var) Foo {45 \\fn bar(val: anytype) Foo {
46 \\ return .{ .x = val };46 \\ return .{ .x = val };
47 \\}47 \\}
48 \\export fn entry() void {48 \\export fn entry() void {
...@@ -1034,7 +1034,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {...@@ -1034,7 +1034,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
1034 \\ storev(&v[i], 42);1034 \\ storev(&v[i], 42);
1035 \\}1035 \\}
1036 \\1036 \\
1037 \\fn storev(ptr: var, val: i32) void {1037 \\fn storev(ptr: anytype, val: i32) void {
1038 \\ ptr.* = val;1038 \\ ptr.* = val;
1039 \\}1039 \\}
1040 , &[_][]const u8{1040 , &[_][]const u8{
...@@ -1049,7 +1049,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {...@@ -1049,7 +1049,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
1049 \\ var x = loadv(&v[i]);1049 \\ var x = loadv(&v[i]);
1050 \\}1050 \\}
1051 \\1051 \\
1052 \\fn loadv(ptr: var) i32 {1052 \\fn loadv(ptr: anytype) i32 {
1053 \\ return ptr.*;1053 \\ return ptr.*;
1054 \\}1054 \\}
1055 , &[_][]const u8{1055 , &[_][]const u8{
...@@ -1832,7 +1832,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {...@@ -1832,7 +1832,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
1832 \\ while (true) {}1832 \\ while (true) {}
1833 \\}1833 \\}
1834 , &[_][]const u8{1834 , &[_][]const u8{
1835 "error: expected type 'fn([]const u8, ?*std.builtin.StackTrace) noreturn', found 'fn([]const u8,var) var'",1835 "error: expected type 'fn([]const u8, ?*std.builtin.StackTrace) noreturn', found 'fn([]const u8,anytype) anytype'",
1836 "note: only one of the functions is generic",1836 "note: only one of the functions is generic",
1837 });1837 });
18381838
...@@ -2032,11 +2032,11 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {...@@ -2032,11 +2032,11 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
2032 });2032 });
20332033
2034 cases.add("export generic function",2034 cases.add("export generic function",
2035 \\export fn foo(num: var) i32 {2035 \\export fn foo(num: anytype) i32 {
2036 \\ return 0;2036 \\ return 0;
2037 \\}2037 \\}
2038 , &[_][]const u8{2038 , &[_][]const u8{
2039 "tmp.zig:1:15: error: parameter of type 'var' not allowed in function with calling convention 'C'",2039 "tmp.zig:1:15: error: parameter of type 'anytype' not allowed in function with calling convention 'C'",
2040 });2040 });
20412041
2042 cases.add("C pointer to c_void",2042 cases.add("C pointer to c_void",
...@@ -2836,7 +2836,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {...@@ -2836,7 +2836,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
2836 });2836 });
28372837
2838 cases.add("missing parameter name of generic function",2838 cases.add("missing parameter name of generic function",
2839 \\fn dump(var) void {}2839 \\fn dump(anytype) void {}
2840 \\export fn entry() void {2840 \\export fn entry() void {
2841 \\ var a: u8 = 9;2841 \\ var a: u8 = 9;
2842 \\ dump(a);2842 \\ dump(a);
...@@ -2859,13 +2859,13 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {...@@ -2859,13 +2859,13 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
2859 });2859 });
28602860
2861 cases.add("generic fn as parameter without comptime keyword",2861 cases.add("generic fn as parameter without comptime keyword",
2862 \\fn f(_: fn (var) void) void {}2862 \\fn f(_: fn (anytype) void) void {}
2863 \\fn g(_: var) void {}2863 \\fn g(_: anytype) void {}
2864 \\export fn entry() void {2864 \\export fn entry() void {
2865 \\ f(g);2865 \\ f(g);
2866 \\}2866 \\}
2867 , &[_][]const u8{2867 , &[_][]const u8{
2868 "tmp.zig:1:9: error: parameter of type 'fn(var) var' must be declared comptime",2868 "tmp.zig:1:9: error: parameter of type 'fn(anytype) anytype' must be declared comptime",
2869 });2869 });
28702870
2871 cases.add("optional pointer to void in extern struct",2871 cases.add("optional pointer to void in extern struct",
...@@ -3165,7 +3165,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {...@@ -3165,7 +3165,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
31653165
3166 cases.add("var makes structs required to be comptime known",3166 cases.add("var makes structs required to be comptime known",
3167 \\export fn entry() void {3167 \\export fn entry() void {
3168 \\ const S = struct{v: var};3168 \\ const S = struct{v: anytype};
3169 \\ var s = S{.v=@as(i32, 10)};3169 \\ var s = S{.v=@as(i32, 10)};
3170 \\}3170 \\}
3171 , &[_][]const u8{3171 , &[_][]const u8{
...@@ -6072,10 +6072,10 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {...@@ -6072,10 +6072,10 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
6072 });6072 });
60736073
6074 cases.add("calling a generic function only known at runtime",6074 cases.add("calling a generic function only known at runtime",
6075 \\var foos = [_]fn(var) void { foo1, foo2 };6075 \\var foos = [_]fn(anytype) void { foo1, foo2 };
6076 \\6076 \\
6077 \\fn foo1(arg: var) void {}6077 \\fn foo1(arg: anytype) void {}
6078 \\fn foo2(arg: var) void {}6078 \\fn foo2(arg: anytype) void {}
6079 \\6079 \\
6080 \\pub fn main() !void {6080 \\pub fn main() !void {
6081 \\ foos[0](true);6081 \\ foos[0](true);
...@@ -6920,12 +6920,12 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {...@@ -6920,12 +6920,12 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
6920 });6920 });
69216921
6922 cases.add("getting return type of generic function",6922 cases.add("getting return type of generic function",
6923 \\fn generic(a: var) void {}6923 \\fn generic(a: anytype) void {}
6924 \\comptime {6924 \\comptime {
6925 \\ _ = @TypeOf(generic).ReturnType;6925 \\ _ = @TypeOf(generic).ReturnType;
6926 \\}6926 \\}
6927 , &[_][]const u8{6927 , &[_][]const u8{
6928 "tmp.zig:3:25: error: ReturnType has not been resolved because 'fn(var) var' is generic",6928 "tmp.zig:3:25: error: ReturnType has not been resolved because 'fn(anytype) anytype' is generic",
6929 });6929 });
69306930
6931 cases.add("unsupported modifier at start of asm output constraint",6931 cases.add("unsupported modifier at start of asm output constraint",
...@@ -7493,7 +7493,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {...@@ -7493,7 +7493,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
7493 });7493 });
74947494
7495 cases.add("issue #5221: invalid struct init type referenced by @typeInfo and passed into function",7495 cases.add("issue #5221: invalid struct init type referenced by @typeInfo and passed into function",
7496 \\fn ignore(comptime param: var) void {}7496 \\fn ignore(comptime param: anytype) void {}
7497 \\7497 \\
7498 \\export fn foo() void {7498 \\export fn foo() void {
7499 \\ const MyStruct = struct {7499 \\ const MyStruct = struct {