test: banner purge + WHY-only comment sweep (rule 8)
Every section banner dies (103 -> 0) across test/lang, the observer suites, the C carriers, and the five comment-heavy corpus fixtures; banner provenance (#N cites, carrier numbers, repair-cluster labels) folded into headers or adjacent WHY comments. Narration deleted; row provenance, ref cites, divergence pins, and layout contracts kept (fwd-ref decl-order guards and bootstrap-gate corpus rationale restored where the sweep over-cut). Comment-only proven: all 3742 wwbuild workdir .s byte-identical before/after; test-commit and test-byteid (161 lang + 1399 data, 0 pinned-divergent) green.
This commit is contained in:
@@ -1,10 +1,7 @@
|
||||
/*
|
||||
* 950_selfcheck — selfhost typechecker emits the same errors the
|
||||
* C-side checker does for tagged-union misuse.
|
||||
*
|
||||
* Each row is a .ww fixture + an expected stderr substring. We run
|
||||
* `wwdump_ww -r` (which invokes the selfhost checker's resolve +
|
||||
* typed passes) and grep for the substring.
|
||||
* Parity pin: the selfhost typechecker must emit the same errors the
|
||||
* C-side checker does for tagged-union misuse. `wwdump_ww -r` is the
|
||||
* probe — it invokes the selfhost checker's resolve + typed passes.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -75,7 +72,6 @@ writefile(const char *path, const char *src)
|
||||
struct row { const char *src; const char *expect; };
|
||||
|
||||
static const struct row rows[] = {
|
||||
/* match: missing variant */
|
||||
{ "fn pick() (i32 | str | bool) = { return 1; };\n"
|
||||
"fn caller() void = {\n"
|
||||
" let v: (i32 | str | bool) = pick();\n"
|
||||
@@ -85,14 +81,12 @@ static const struct row rows[] = {
|
||||
" };\n"
|
||||
"};\n",
|
||||
"match: variant not handled" },
|
||||
/* ?: enclosing not tagged */
|
||||
{ "fn inner() (i32 | str) = { return 1; };\n"
|
||||
"fn caller() i32 = {\n"
|
||||
" let v: i32 = inner()?;\n"
|
||||
" return v;\n"
|
||||
"};\n",
|
||||
"?: enclosing fn return is not tagged" },
|
||||
/* ?: error variant not in enclosing return */
|
||||
{ "fn inner() (i32 | str | bool) = { return 1; };\n"
|
||||
"fn caller() (i32 | str) = {\n"
|
||||
" let v: i32 = inner()?;\n"
|
||||
@@ -117,7 +111,6 @@ static const struct row rows[] = {
|
||||
" return v + 1;\n"
|
||||
"};\n",
|
||||
"?: error variant not in enclosing return" },
|
||||
/* case T => names a non-variant */
|
||||
{ "fn pick() (i32 | str) = { return 1; };\n"
|
||||
"fn caller() void = {\n"
|
||||
" let v: (i32 | str) = pick();\n"
|
||||
@@ -128,19 +121,16 @@ static const struct row rows[] = {
|
||||
" };\n"
|
||||
"};\n",
|
||||
"case: not a variant" },
|
||||
/* is T where T isn't a variant of the operand */
|
||||
{ "fn pick() (i32 | str) = { return 1; };\n"
|
||||
"fn caller() void = {\n"
|
||||
" let v: (i32 | str) = pick();\n"
|
||||
" if (v is f64) { };\n"
|
||||
"};\n",
|
||||
"is/as: not a variant" },
|
||||
/* let init-type mismatch on primitives */
|
||||
{ "fn caller() void = {\n"
|
||||
" let x: bool = 42;\n"
|
||||
"};\n",
|
||||
"let: not assignable" },
|
||||
/* return type mismatch */
|
||||
{ "fn caller() i32 = {\n"
|
||||
" return \"hi\";\n"
|
||||
"};\n",
|
||||
|
||||
Reference in New Issue
Block a user