| ... | @@ -5433,6 +5433,7 @@ static IrInstruction *ir_gen_array_type(IrBuilder *irb, Scope *scope, AstNode *n | ... | @@ -5433,6 +5433,7 @@ static IrInstruction *ir_gen_array_type(IrBuilder *irb, Scope *scope, AstNode *n |
| 5433 | bool is_volatile = node->data.array_type.is_volatile; | 5433 | bool is_volatile = node->data.array_type.is_volatile; |
| 5434 | AstNode *align_expr = node->data.array_type.align_expr; | 5434 | AstNode *align_expr = node->data.array_type.align_expr; |
| 5435 | | 5435 | |
| | 5436 | Scope *comptime_scope = create_comptime_scope(irb->codegen, node, scope); |
| 5436 | if (size_node) { | 5437 | if (size_node) { |
| 5437 | if (is_const) { | 5438 | if (is_const) { |
| 5438 | add_node_error(irb->codegen, node, buf_create_from_str("const qualifier invalid on array type")); | 5439 | add_node_error(irb->codegen, node, buf_create_from_str("const qualifier invalid on array type")); |
| ... | @@ -5447,11 +5448,11 @@ static IrInstruction *ir_gen_array_type(IrBuilder *irb, Scope *scope, AstNode *n | ... | @@ -5447,11 +5448,11 @@ static IrInstruction *ir_gen_array_type(IrBuilder *irb, Scope *scope, AstNode *n |
| 5447 | return irb->codegen->invalid_instruction; | 5448 | return irb->codegen->invalid_instruction; |
| 5448 | } | 5449 | } |
| 5449 | | 5450 | |
| 5450 | IrInstruction *size_value = ir_gen_node(irb, size_node, scope); | 5451 | IrInstruction *size_value = ir_gen_node(irb, size_node, comptime_scope); |
| 5451 | if (size_value == irb->codegen->invalid_instruction) | 5452 | if (size_value == irb->codegen->invalid_instruction) |
| 5452 | return size_value; | 5453 | return size_value; |
| 5453 | | 5454 | |
| 5454 | IrInstruction *child_type = ir_gen_node(irb, child_type_node, scope); | 5455 | IrInstruction *child_type = ir_gen_node(irb, child_type_node, comptime_scope); |
| 5455 | if (child_type == irb->codegen->invalid_instruction) | 5456 | if (child_type == irb->codegen->invalid_instruction) |
| 5456 | return child_type; | 5457 | return child_type; |
| 5457 | | 5458 | |
| ... | @@ -5459,14 +5460,14 @@ static IrInstruction *ir_gen_array_type(IrBuilder *irb, Scope *scope, AstNode *n | ... | @@ -5459,14 +5460,14 @@ static IrInstruction *ir_gen_array_type(IrBuilder *irb, Scope *scope, AstNode *n |
| 5459 | } else { | 5460 | } else { |
| 5460 | IrInstruction *align_value; | 5461 | IrInstruction *align_value; |
| 5461 | if (align_expr != nullptr) { | 5462 | if (align_expr != nullptr) { |
| 5462 | align_value = ir_gen_node(irb, align_expr, scope); | 5463 | align_value = ir_gen_node(irb, align_expr, comptime_scope); |
| 5463 | if (align_value == irb->codegen->invalid_instruction) | 5464 | if (align_value == irb->codegen->invalid_instruction) |
| 5464 | return align_value; | 5465 | return align_value; |
| 5465 | } else { | 5466 | } else { |
| 5466 | align_value = nullptr; | 5467 | align_value = nullptr; |
| 5467 | } | 5468 | } |
| 5468 | | 5469 | |
| 5469 | IrInstruction *child_type = ir_gen_node(irb, child_type_node, scope); | 5470 | IrInstruction *child_type = ir_gen_node(irb, child_type_node, comptime_scope); |
| 5470 | if (child_type == irb->codegen->invalid_instruction) | 5471 | if (child_type == irb->codegen->invalid_instruction) |
| 5471 | return child_type; | 5472 | return child_type; |
| 5472 | | 5473 | |