{"atom":"regression/enum-numify","family":"regression","slug":"enum-numify","header":{"atom":"regression/enum-numify","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/enum-numify.raku","counts":{"a":1,"f":0,"d":0,"c":0,"r":0,"n":0},"files":["atoms/regression/enum-numify.grid"],"records":[["0001","","# Regression: an ENUM VALUE numifies to a PLAIN Int.\n#\n# `.Numeric` and prefix `+` returned the value UNCHANGED when it was already\n# numeric — which for an enum value meant handing back something still carrying\n# its enumName, so it rendered as `b` rather than 1. `.Int` and `.value` build a\n# fresh Int and were right all along, so one value answered three ways.\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\nenum E <a b c>;\ncheck(b.Numeric.gist, '1', '.Numeric on an enum value is a plain Int');\ncheck(b.Int.gist,     '1', '.Int agrees');\ncheck(b.value.gist,   '1', '.value agrees');\ncheck((+b).gist,      '1', 'prefix + agrees');\ncheck(b.gist,         'b', 'the value itself still gists as its name');\ncheck((b.Numeric + 1).gist, '2', 'the numified value does arithmetic');\n\nenum Endian (NativeEndian => 0, LittleEndian => 1);\ncheck(LittleEndian.Numeric.gist, '1', 'an explicitly-valued enum too');\ncheck(NativeEndian.Numeric.gist, '0', 'including zero');\n\n# a plain number is still ITSELF, not forced through Num — the reason the\n# `return inv` shortcut existed in the first place\ncheck(3.Numeric.gist,      '3',      'an Int stays an Int');\ncheck((-4/3).Real.raku,    '<-4/3>', 'a Rat stays a Rat');\n\nif @fail { note \"FAILED: @fail.join('; ')\"; say 'FAIL' } else { say 'PASS' }","output PASS","a",["PASS","PASS"],0,[["budget","20s"]]]]}