{"atom":"regression/is-dynamic-and-sum","family":"regression","slug":"is-dynamic-and-sum","header":{"atom":"regression/is-dynamic-and-sum","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/is-dynamic-and-sum.raku","counts":{"a":1,"f":0,"d":0,"c":0,"r":0,"n":0},"files":["atoms/regression/is-dynamic-and-sum.grid"],"records":[["0001","","# Regression: the `is dynamic` trait was parsed and thrown away.\n#   * skipTraits swallowed every trait it did not special-case, so `dynamic` never\n#     reached the AST and `.dynamic` could only ever answer from a `*` twigil.\n#   * it is recorded per scope at declaration time now, and read back by walking\n#     the scope chain — stopping at the scope that DECLARES the name, so an inner\n#     plain `my $x` shadows an outer dynamic one.\n#   * `$x.VAR.dynamic` asks the same question, so a `.VAR` in front is unwrapped.\n#   * three declaration paths had to record it: the assignment form (`my $x is\n#     dynamic = 3`), the bare form inside a block, and the MAINLINE bare form,\n#     which is hoisted and never evaluated at all.\n# Contract: exit 0 + last line PASS.\nmy @fail;\nsub check($got, $want, $what) { @fail.push(\"$what: got $got want $want\") unless $got eq $want }\n\n# the three declaration paths, at mainline scope\nmy %b is dynamic;\nmy $s is dynamic = 3;\nmy @a is dynamic;\ncheck(%b.dynamic.gist,     'True', 'a bare mainline hash declaration');\ncheck($s.VAR.dynamic.gist, 'True', 'a scalar with an initialiser');\ncheck(@a.dynamic.gist,     'True', 'a bare array declaration');\n# …and inside a block\n{\n    my $inner is dynamic;\n    check($inner.VAR.dynamic.gist, 'True', 'a bare declaration in a block');\n}\n\n# the twigil form is unaffected\nmy $*d = 1;\ncheck($*d.VAR.dynamic.gist, 'True', 'a `*` twigil is dynamic without the trait');\n# and a plain variable is not\nmy $plain = 1;\ncheck($plain.VAR.dynamic.gist, 'False', 'a plain scalar is not');\nmy %q;\ncheck(%q.dynamic.gist, 'False', 'nor a plain hash');\n\nif @fail { note \"FAILED: @fail.join('; ')\"; say 'FAIL' } else { say 'PASS' }","output PASS","a",["PASS","PASS"],0,[["budget","20s"]]]]}