@methods = (@_ == 1 && ref($_[0]) eq 'ARRAY') ? @{$_[0]} : @_;
# DuckType
- return _create_type 'type', $name => (
+ return _create_type 'subtype', $name => (
+ as => 'Object',
optimized_as => Mouse::Util::generate_can_predicate_for(\@methods),
);
}
%valid = map{ $_ => undef } (@_ == 1 && ref($_[0]) eq 'ARRAY' ? @{$_[0]} : @_);
# EnumType
- return _create_type 'type', $name => (
+ return _create_type 'subtype', $name => (
+ as => 'Str',
optimized_as => sub{ defined($_[0]) && !ref($_[0]) && exists $valid{$_[0]} },
);
}