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


Consider the following code:

use v6.c;

subset T of List where *[0] eqv 1;

class R {
    multi method f(T:D $xs) { self.f(42) }
    multi method f(Any:D $xs) { say $xs }
}

R.f([1, 2]);
R.f([2, 2]);

It fails with the following output:

42
Type check failed in binding $xs; expected T but got Array
  in method f at /tmp/foo.pm6 line 6
  in block <unit> at /tmp/foo.pm6 line 11

However, when the R.f([1, 2]) call is removed, the program succeeds.

Thanks to masak++ for helping minimizing the example.

Rakudo version:

> This is Rakudo version 2015.12 built on MoarVM version 2015.12 implementing 
> Perl 6.c.

Reply via email to