On Fri, Jan 28, 2011 at 08:23:32PM +0100, Jiří Pavlovský wrote:
> Hello,
>
> I'm trying to apply some processing on an attribute value when it is  
> set. I thought creating custom subtype and a coercion is the way to do  
> it, but cannot figure it out.
> The coersion is not run.
> See my code below.
> What am I doing wrong?
> I need this filtering to appear seamlessly on the subject attribute due  
> to backwards compatibility.
>
>
> subtype 'Subject'
> => as 'Str';

This means that any valid string is a valid Subject. Therefore, when you
pass in some value, it decides that what you passed in already passes
the Subject constraint, so it doesn't need to do any coercing. You
should define exactly what Subject means in your subtype.

-doy

Reply via email to