{"atom":"regression/can-on-builtin-dateish","family":"regression","slug":"can-on-builtin-dateish","header":{"atom":"regression/can-on-builtin-dateish","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/can-on-builtin-dateish.raku","counts":{"a":1,"f":0,"d":0,"c":0,"r":0,"n":0},"files":["atoms/regression/can-on-builtin-dateish.grid"],"records":[["0001","","# Regression: a built-in value answers `.can`, 2026-08-04. Found taking\n# Date::Calendar::Strftime through its own suite: it gates its %u and %V\n# specifiers on `$date.can('day-of-week')` / `.can('week-number')`, and with .can\n# answering False for every built-in method it emitted the format specifier\n# instead of the value. The sets below were enumerated from Rakudo's own answers.\n\nmy $ok = True;\nsub ck($got, $want, $l) { unless $got eqv $want { say \"FAIL: $l — {$got.raku} vs {$want.raku}\"; $ok = False } }\n\nmy $d = Date.new(2001, 2, 1);\nmy $t = DateTime.new(:2001year, :2month, :1day);\n\n# the two the module actually gates on\nck(?$d.can('day-of-week'), True, \"Date.can('day-of-week')\");\nck(?$d.can('week-number'), True, \"Date.can('week-number')\");\n\n# and they really do work, which was never in doubt — that was the point\nck(($d.day-of-week, $d.week-number), (4, 5), 'the methods themselves answer');\n\n# a spread of the rest\nck(?$d.can('year') && ?$d.can('is-leap-year') && ?$d.can('truncated-to'), True,\n   'other Dateish methods');\nck(?$d.can('nonesuch'), False, 'and an unknown name is still False');\n\n# the split between the two types is real: succ/pred are Date's, the time\n# accessors are DateTime's\nck((?$d.can('succ'), ?$t.can('succ')),   (True, False), 'succ is Date-only');\nck((?$d.can('hour'), ?$t.can('hour')),   (False, True), 'hour is DateTime-only');\nck((?$d.can('utc'),  ?$t.can('utc')),    (False, True), 'so is utc');\n\n# .can hands back something callable, not merely a truthy flag\n{\n    my $m = $d.can('day-of-week');\n    ck($m.elems >= 1, True, '.can returns a list of methods');\n}\n\nsay $ok ?? 'PASS' !! 'FAIL';","output PASS","a",["PASS","PASS"],0,[["budget","20s"]]]]}