ww: finish initialization validation parity
This commit is contained in:
@@ -1,7 +1,12 @@
|
||||
//ww:error "repeat with nested-array elements"
|
||||
// #156/rule-7 carrier: a `...` repeat marker with a nested-array element must
|
||||
// REJECT on both stages (no consumer needs it; powers_of_ten is fully
|
||||
// enumerated). From test/wcc/919_array_static_init_run.c nested_ellipsis_reject.
|
||||
//ww:run
|
||||
// A fixed outer array gives the nested-row repeat an exact target length.
|
||||
// Package initialization evaluates the row once and fills every remaining row.
|
||||
package main;
|
||||
let A: [4][2]u64 = [[1u64, 2u64]...];
|
||||
export fn main() i32 = { return 0; };
|
||||
export fn main() i32 = {
|
||||
if (A[0][0] != 1 || A[0][1] != 2) { return 1; };
|
||||
if (A[1][0] != 1 || A[1][1] != 2) { return 2; };
|
||||
if (A[2][0] != 1 || A[2][1] != 2) { return 3; };
|
||||
if (A[3][0] != 1 || A[3][1] != 2) { return 4; };
|
||||
return 0;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user