{"atom":"regression/cro-live-cluster","family":"regression","slug":"cro-live-cluster","header":{"atom":"regression/cro-live-cluster","kind":"whole-program — a minimal repro, not yet reduced to an atom","source":"curated"},"axes":null,"cols":null,"engines":["rakudo-2026.07","rakupp-3.14.0"],"kinds":["ref","pp"],"defFrom":"rakupp:t/regression/cro-live-cluster.raku","counts":{"a":1,"f":0,"d":0,"c":0,"r":0,"n":0},"files":["atoms/regression/cro-live-cluster.grid"],"records":[["0001","","# Regression: the Cro live-server cluster (batch 9) — fixes surfaced by running\n# an actual Cro::HTTP::Router + Server app under rakupp.\n#  1. `is export` subs inside a BRACED module publish even when the name\n#     collides with a builtin (Router exports `get`/`put`/…).\n#  2. A pointy block is a listop argument (`get -> { … }`) outside statement\n#     conditions; `for @a -> $x { }` still binds the statement's own block.\n#  3. Dynamic vars cross METHOD frames (route -> definition-complete -> plugin).\n#  4. A public @./%. attr assigns through its accessor without `is rw`.\n#  5. `only method` declarator; `state => v` is a pair, not a declaration;\n#     `my (:@a, :@b) := %h` named destructuring.\n#  6. Parameter introspection: .constraints (literal params), .type as a TYPE\n#     OBJECT, .named_names.\nmy $ok = 0; my $n = 0;\nsub ck($got, $want, $desc) {\n    $n++;\n    if $got eqv $want { $ok++ }\n    else { say \"FAIL: $desc — {$got.raku} vs {$want.raku}\" }\n}\n\n# 2. pointy block as listop arg\nmulti taker(&handler, Str :$name --> Nil) { handler() }\nmy $ran = 0;\ntaker -> { $ran = 1 };\nck($ran, 1, 'listop with pointy-block argument');\nmy @collected;\nfor <a b> -> $x { @collected.push($x) }\nck(@collected.join(','), 'a,b', 'for -> $x block still owned by the statement');\n\n# 3. dynamics through method frames\nsub plugin-probe() { $*RSET // 'UNSET' }\nclass RS3 { method complete() { self!gen }; method !gen() { plugin-probe() } }\nsub routish() { my $*RSET = 'the-set'; RS3.new.complete() }\nck(routish(), 'the-set', 'dynamic var visible through method frames');\n\n# 4. accessor assignment on @-attrs without is rw (Cro's exact shape:\n# `.body-parsers = @!body-parsers` — an array RHS)\nclass H4 { has @.body-parsers; has $.x }\nmy $h = H4.new;\nmy @src = 1, 2, 3;\n$h.body-parsers = @src;\nck($h.body-parsers.elems, 3, 'public @.attr assigns through accessor');\nmy $died = False;\ntry { $h.x = 5; CATCH { default { $died = True } } }\nck($died, True, 'public $.attr without is rw still refuses');\n\n# 5a. only method\nclass C5 { only method new() { self.bless } }\nck(C5.new.^name, 'C5', 'only method declarator');\n# 5b. state as pair key\nclass S5 { has $.state; has $.sid }\nck(S5.new(sid => 1, state => 'hi').state, 'hi', 'state => v is a pair');\n# 5c. named destructuring\nmy @things = 1, 'a', 2, 'b';\nmy (:@odd, :@even) := @things.classify: { $_ ~~ Int ?? 'even' !! 'odd' };\nck(@even.join(','), '1,2', 'named destructuring := classify (even)');\nck(@odd.join(','), 'a,b', 'named destructuring := classify (odd)');\n\n# 6. Parameter introspection\nmy &r6 = sub ('greet', $name, Int :$port) { };\nmy @params = &r6.signature.params;\nck(@params[0].constraints, 'greet', 'literal param .constraints');\nck((@params[1].type =:= Any), True, 'untyped param .type is Any');\nck((@params[2].type =:= Int), True, 'typed named param .type object');\nck(@params[2].named_names.join(','), 'port', '.named_names');\n\nsay $ok == $n ?? 'PASS' !! \"FAIL ($ok/$n)\";","output PASS","a",["PASS","PASS"],0,[["budget","20s"]]]]}