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


use MONKEY_TYPING;
augment class Mu {
    method FOO(Mu:U:) {
        say 'Mu.FOO';
    }
}

augment class Str {
    method FOO(Str:D:) {
        say 'Str.FOO';
    }
}

('a' & 'b').FOO();

Output:
Parameter '' requires a type object, but an object instance was passed
  in method FOO at dispatch.pl:3
  in block <anon> at dispatch.pl:14
  in <anon> at dispatch.pl:1

I'd argue that since the FOO method in class Mu fails to type-check
against the argument list, the other candidate should be considered for
autothreading.

I believe (though I can't prove it) that this is the real problem behind
https://rt.perl.org/rt3/Ticket/Display.html?id=103106 (regex-matching on
a junction fails)

Reply via email to