aboutsummaryrefslogtreecommitdiff
path: root/src/stage1/ir.cpp
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2021-06-06 12:26:15 +0200
committerAndrew Kelley <andrew@ziglang.org>2021-06-06 21:21:42 -0400
commitfc8791c133c14fe969b9056d8f0e337094ce1461 (patch)
tree2748fac999f47ea06ba9a892ae3734ca69ace042 /src/stage1/ir.cpp
parentb87c3d5371a277a60e63dc521a44d488f013dbc8 (diff)
downloadzig-fc8791c133c14fe969b9056d8f0e337094ce1461.tar.gz
zig-fc8791c133c14fe969b9056d8f0e337094ce1461.zip
stage1: Allow array-like initialization for tuple types
This small change makes working with tuple types much easier, allowing the use of anonymous (eg. obtained with meta.ArgsTuple) tuples in more places without the need for specifying each (quoted!) field name in the initializer.
Diffstat (limited to 'src/stage1/ir.cpp')
-rw-r--r--src/stage1/ir.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/stage1/ir.cpp b/src/stage1/ir.cpp
index 3604f98ff5..19242a5c42 100644
--- a/src/stage1/ir.cpp
+++ b/src/stage1/ir.cpp
@@ -16694,7 +16694,7 @@ static IrInstGen *ir_analyze_instruction_container_init_list(IrAnalyze *ira,
{
// We're now done inferring the type.
container_type->data.structure.resolve_status = ResolveStatusUnstarted;
- } else if (container_type->id == ZigTypeIdVector) {
+ } else if (container_type->id == ZigTypeIdVector || is_tuple(container_type)) {
// OK
} else {
ir_add_error(ira, &instruction->base.base,