| ... | @@ -1342,8 +1342,7 @@ fn astGenAndAnalyzeDecl(self: *Module, decl: *Decl) !bool { | ... | @@ -1342,8 +1342,7 @@ fn astGenAndAnalyzeDecl(self: *Module, decl: *Decl) !bool { |
| 1342 | break :rl .{ .ty = var_type }; | 1342 | break :rl .{ .ty = var_type }; |
| 1343 | } else .none; | 1343 | } else .none; |
| 1344 | | 1344 | |
| 1345 | const src = tree.token_locs[init_node.firstToken()].start; | 1345 | const init_inst = try astgen.comptimeExpr(self, &gen_scope.base, init_result_loc, init_node); |
| 1346 | const init_inst = try astgen.expr(self, &gen_scope.base, init_result_loc, init_node); | | |
| 1347 | if (std.builtin.mode == .Debug and self.comp.verbose_ir) { | 1346 | if (std.builtin.mode == .Debug and self.comp.verbose_ir) { |
| 1348 | zir.dumpZir(self.gpa, "var_init", decl.name, gen_scope.instructions.items) catch {}; | 1347 | zir.dumpZir(self.gpa, "var_init", decl.name, gen_scope.instructions.items) catch {}; |
| 1349 | } | 1348 | } |
| ... | @@ -1392,12 +1391,7 @@ fn astGenAndAnalyzeDecl(self: *Module, decl: *Decl) !bool { | ... | @@ -1392,12 +1391,7 @@ fn astGenAndAnalyzeDecl(self: *Module, decl: *Decl) !bool { |
| 1392 | }; | 1391 | }; |
| 1393 | defer type_scope.instructions.deinit(self.gpa); | 1392 | defer type_scope.instructions.deinit(self.gpa); |
| 1394 | | 1393 | |
| 1395 | const src = tree.token_locs[type_node.firstToken()].start; | 1394 | const var_type = try astgen.typeExpr(self, &type_scope.base, type_node); |
| 1396 | const type_type = try astgen.addZIRInstConst(self, &type_scope.base, src, .{ | | |
| 1397 | .ty = Type.initTag(.type), | | |
| 1398 | .val = Value.initTag(.type_type), | | |
| 1399 | }); | | |
| 1400 | const var_type = try astgen.expr(self, &type_scope.base, .{ .ty = type_type }, type_node); | | |
| 1401 | if (std.builtin.mode == .Debug and self.comp.verbose_ir) { | 1395 | if (std.builtin.mode == .Debug and self.comp.verbose_ir) { |
| 1402 | zir.dumpZir(self.gpa, "var_type", decl.name, type_scope.instructions.items) catch {}; | 1396 | zir.dumpZir(self.gpa, "var_type", decl.name, type_scope.instructions.items) catch {}; |
| 1403 | } | 1397 | } |