# New Ticket Created by  Patrick R. Michaud 
# Please include the string:  [perl #59250]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=59250 >


The .sort method on FixedPMCArray fails with "no applicable methods"
when given a MultiSub PMC as a comparison function.  Here's a sample
PIR program:

$ cat x.pir
.sub 'main'
    .local pmc arr
    arr = new 'FixedPMCArray'
    arr = 4
    arr[0] = 'just'
    arr[1] = 'another'
    arr[2] = 'perl'
    arr[3] = 'hacker'

    ## called with normal Sub, works
    $P0 = get_global 'cmpfn1'
    arr.'sort'($P0)
    $S0 = join ' ', arr
    say $S0

    ## called with MultiSub, fails
    $P0 = get_global 'cmpfn2'
    arr.'sort'($P0)
    $S0 = join ' ', arr
    say $S0
.end

.sub 'cmpfn1'
    .param pmc a
    .param pmc b
    $I0 = cmp_str a, b
    .return ($I0)
.end

.sub 'cmpfn2' :multi(_, _)
    .param pmc a
    .param pmc b
    $I0 = cmp_str a, b
    .return ($I0)
.end
$ ./parrot x.pir
another hacker just perl
No applicable methods.

current instr.: 'main' pc -34072556 ((unknown file):-1)
called from Sub 'main' pc 49 (x.pir:18)
$

See also some of the analysis I did on the parrot-dev 
mailing list (subject: "References to multis (at PIR level)")--
I can repost that to the ticket if it would be helpful.

Pm

Reply via email to