Skip to content

Commit 5c25e26

Browse files
committed
do not allow vector literals
<andrewrk> tomorrow, end of day, ziglang#3580 will be closed and ziglang#3575 will be closed, and dimenus's examples will work (except for vector literals which is not happening, see ziglang#208)
1 parent 5205a50 commit 5c25e26

File tree

2 files changed

+1
-11
lines changed

2 files changed

+1
-11
lines changed

src/ir.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20077,7 +20077,7 @@ static IrInstruction *ir_analyze_instruction_container_init_list(IrAnalyze *ira,
2007720077
return ir_analyze_container_init_fields(ira, &instruction->base, container_type, 0, nullptr, result_loc);
2007820078
}
2007920079

20080-
if (container_type->id != ZigTypeIdArray && container_type->id != ZigTypeIdVector) {
20080+
if (container_type->id != ZigTypeIdArray) {
2008120081
ir_add_error_node(ira, instruction->base.source_node,
2008220082
buf_sprintf("type '%s' does not support array initialization",
2008320083
buf_ptr(&container_type->name)));

test/stage1/behavior/vector.zig

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -233,16 +233,6 @@ test "vector access elements - store" {
233233
}
234234
}
235235

236-
test "vector literal" {
237-
const S = struct {
238-
fn doTheTest() void {
239-
var foo = @Vector(4, f32) { 1, 2, 3, 4 };
240-
}
241-
};
242-
S.doTheTest();
243-
comptime S.doTheTest();
244-
}
245-
246236
const Vec4Obj = struct {
247237
data: @Vector(4, f32),
248238
};

0 commit comments

Comments
 (0)