Hi, I recently upgraded Moose from 0.98 to 2.0604 and got a deprecation warning for this code (names changed to protect the innocent)
subtype 'A', as 'Str', where { $_ eq 'foo' }; subtype 'B', as 'Str', where { $_ =~ /some regex/ }; subtype 'C', as 'Str', where { $_ =~ /different regex/ }; subtype 'Foo', as 'A|B|C', message { 'Invalid Foo' }; has foo => (is => 'rw', isa => 'Foo', required => 1, coerce => 1); So basically, 'foo' must match one of the three subtypes, or a warning will be issued. Of course all of the checks (there are 6 in the real code) could be combined into a single check, but this was done for legibility. The warning is: "You can't coerce an attribute (foo) unless its type (Foo) has a coercion", introduced in 1.09. If I use Moose::Deprecated with an api_version of 0.98, the code no longer issues a warning and continues to work. Am I using the API wrong here? If so, what would be a better way to do this? Is a workaround available or is there a bug? Cheers, Rich