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


#!/usr/bin/env perl6

# rakudo version: f99d081ea493399656a66f766e2c4d3fff57f548
# parrot version: e4bebcddff747fcfc156310334b78c309add17b2

# In this test case, second `is' fails.

use v6;

use Test;
plan 2;

my %allowed = :a<0>;
my $expected = q{Constraint type check failed for parameter '$x'};

sub s(Str $x where %allowed) { }

s('a');
try
{
         s('b');
}
is $!, $expected;

class Buggy
{
         multi method new(Str $x where %allowed) { self.bless(*); }
}

Buggy.new('a');
try
{
         Buggy.new('b');
}
is $!, $expected;

# Hiroki Horiuchi from Japan.

Reply via email to