{"atom":"regression/type-coercion-call","family":"regression","slug":"type-coercion-call","header":{"atom":"regression/type-coercion-call","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/type-coercion-call.raku","counts":{"a":1,"f":0,"d":0,"c":0,"r":0,"n":0},"files":["atoms/regression/type-coercion-call.grid"],"records":[["0001","","# Regression: general `T(x)` type-coercion calls — a known type used as a routine\n# coerces its argument through the argument's `.T` method (Raku's coercion\n# protocol), instead of failing with \"Undefined routine 'T'\" for types outside\n# the Int/Str/... fast-path set.\n# Contract: exit 0 + last line PASS.\nmy @fail;\n\n# the specialized coercers still route correctly\n@fail.push('int-coerce') unless Int('42') == 42;\n@fail.push('str-coerce') unless Str(42) eq '42';\n@fail.push('num-coerce') unless Num('1.5') == 1.5e0;\n\n# Supply($channel) coercion == $channel.Supply (a type outside the fast set)\nmy $c = Channel.new; $c.send(7); $c.send(8); $c.close;\n@fail.push('supply-coerce') unless Supply($c).list eqv (7, 8);\n\n# a user coercion method: `MyT($x)` == `$x.MyT`\nclass Celsius { has $.c; method Str { \"{$!c}C\" } }\n@fail.push('str-of-obj') unless Str(Celsius.new(c => 20)) eq '20C';\n\nif @fail { note \"FAILED: @fail[]\"; say 'FAIL' } else { say 'PASS' }","output PASS","a",["PASS","PASS"],0,[["budget","20s"]]]]}