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


This causes 'for' loops and methods calls on it, to fail:

    ➜  .say for <2 1 3> .sort
    Cannot find method 'map': no method cache and no .^find_method

    ➜  say (<2 1 3> .sort).elems
    Cannot find method 'elems': no method cache and no .^find_method

    ➜  say (<2 1 3> .sort).^methods.perl
    {}

    ➜  say (<2 1 3> .sort).WHAT
    ()

    ➜  say (<2 1 3> .sort).^name
    BOOTArray

Funnily enough, &say and .[] can still handle it:

    ➜  say (<2 1 3> .sort)
    (1 2 3)

    ➜  say (<2 1 3> .sort)[0]
    1

On the other hand when the postfix form of the method call operator is used 
(i.e. no space before the .sort), the problem does not appear:

    ➜  .say for <2 1 3>.sort
    1
    2
    3

    ➜  say (<2 1 3>.sort).WHAT
    (List)

Reply via email to