# New Ticket Created by  Sam S. 
# Please include the string:  [perl #131238]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=131238 >


Returning a Str from a custom class's .gist works fine:

    ➜  class A { method gist { "42" } };  say A.new;
    42

But when returning other values, it fails to convert them to Str
automatically, and instead prints an internal-ish error message:

    ➜  class A { method gist { now } };  say A.new;
    This type cannot unbox to a native string: P6opaque, Instant
      in block <unit> at -e line 1

    ➜  class A { method gist { 42 } };  say A.new;
    This type cannot unbox to a native string: P6opaque, Int
      in block <unit> at -e line 1

Reply via email to