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


I expect this code to dispatch properly; autoboxing works and :optional 
parameters work, at least separately.  When combined, they appear not to 
work.

.sub 'main' :main
    foo('Hello')
    foo('Goodbye', 2)
    foo(1)
    foo(100, 200)
.end

.sub foo :multi(String)
    .param pmc s
    .param pmc i      :optional
    .param int have_i :opt_flag

    say s
    unless have_i goto done
    say i
  done:
.end

.sub foo :multi(Integer)
    .param pmc x
    .param pmc i      :optional
    .param int have_i :opt_flag

    say x
    unless have_i goto done
    say i
  done:
.end

Where I expect:

        Hello
        Goodbye
        2
        1
        100
        200

I receive:
        No applicable methods.
        current instr.: 'main' pc 8 
(/home/chromatic/dev/parrot/t/pmc/multidispatch_47.pir:3)

-- c

Reply via email to