wcc/check: #25 reject overlong array-lit in a tuple return (wwstage)
This commit is contained in:
@@ -25,6 +25,8 @@
|
||||
* tuple_arr_over | let t:([2]int,i32)=([1,2,3],5) | b. FAIL
|
||||
* tuple_nested_arr | let t:([2][3]int,i32)=([[..],[..],[..]],5) | b. FAIL
|
||||
* tuple_in_tuple | let t:([2]int,([2]int,i32))=([..],([1,2,3],.))| #26 FAIL
|
||||
* tuple_return_over | fn()([2]int,i32){return([1,2,3],5)} | #25 FAIL
|
||||
* tuple_return_nested| fn()([2]int,([2]int,i32)){return(..,([..3],.))| #25 FAIL
|
||||
*
|
||||
* pos row | shape | want
|
||||
* -------------------+----------------------------------------------+------
|
||||
@@ -116,6 +118,25 @@ static const char *neg[] = {
|
||||
"\tlet t: ([2]int, ([2]int, i32)) = ([1, 2], ([3, 4, 5], 6));\n"
|
||||
"\treturn t.0[0]: i32;\n"
|
||||
"};\n",
|
||||
/* tuple_return_over (#25) — overlong [2]int in a tuple RETURN. */
|
||||
"package main;\n"
|
||||
"fn f() ([2]int, i32) = {\n"
|
||||
"\treturn ([1, 2, 3], 5);\n"
|
||||
"};\n"
|
||||
"export fn main() i32 = {\n"
|
||||
"\tlet t = f();\n"
|
||||
"\treturn t.1;\n"
|
||||
"};\n",
|
||||
/* tuple_return_nested (#25 path × #26 recursion) — nested tuple in a
|
||||
* RETURN, inner [2]int over-filled. */
|
||||
"package main;\n"
|
||||
"fn f() ([2]int, ([2]int, i32)) = {\n"
|
||||
"\treturn ([1, 2], ([3, 4, 5], 6));\n"
|
||||
"};\n"
|
||||
"export fn main() i32 = {\n"
|
||||
"\tlet t = f();\n"
|
||||
"\treturn t.0[0]: i32;\n"
|
||||
"};\n",
|
||||
};
|
||||
|
||||
static int
|
||||
|
||||
Reference in New Issue
Block a user