| ... | @@ -1164,6 +1164,10 @@ fn fnProtoExpr( | ... | @@ -1164,6 +1164,10 @@ fn fnProtoExpr( |
| 1164 | const tree = astgen.tree; | 1164 | const tree = astgen.tree; |
| 1165 | const token_tags = tree.tokens.items(.tag); | 1165 | const token_tags = tree.tokens.items(.tag); |
| 1166 | | 1166 | |
| | 1167 | if (fn_proto.name_token) |some| { |
| | 1168 | return astgen.failTok(some, "function type cannot have a name", .{}); |
| | 1169 | } |
| | 1170 | |
| 1167 | const is_extern = blk: { | 1171 | const is_extern = blk: { |
| 1168 | const maybe_extern_token = fn_proto.extern_export_inline_token orelse break :blk false; | 1172 | const maybe_extern_token = fn_proto.extern_export_inline_token orelse break :blk false; |
| 1169 | break :blk token_tags[maybe_extern_token] == .keyword_extern; | 1173 | break :blk token_tags[maybe_extern_token] == .keyword_extern; |