Skip Menu |
Report information
Id: 127209
Status: new
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: curtis_ovid_poe [at]

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)

From: Ovid <curtis_ovid_poe [...]>
To: Rakudobug <rakudobug [...]>
Date: Thu, 7 Jan 2016 23:31:12 +0000 (UTC)
Subject: Bad error message on constraint violation
Download (untitled)
multipart/alternative 2k

Message body not shown because it is not plain text.

Download (untitled) / with headers
text/plain 547b
This code:

    class Foo { subset Limit of Rat where -10 .. 10; has Limit $.x is rw }; x => 15.0 ); 
Produces the following error:

    Type check failed in assignment to $!x; expected Foo::Limit but got Rat

As a dev, I would like to know that it's the constraint that failed, but the code implies that a Rat is wrong (which is correct, but misleading to me).

IT consulting, training, specializing in Perl, databases, and agile development

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at