Skip to content

Support | overload to work better with MooseX::Types#156

Open
colinnewell wants to merge 2 commits into
moose:masterfrom
cv-library:RT98809
Open

Support | overload to work better with MooseX::Types#156
colinnewell wants to merge 2 commits into
moose:masterfrom
cv-library:RT98809

Conversation

@colinnewell

Copy link
Copy Markdown

Copied override from MooseX::Types::TypeDecorator to allow
union from all types. In theory this should mean we can
remove it from MooseX::Types.

Allow:

my $type2 = $type1 | class_type('Bar');

as well as:

my $type1 = HashRef | class_type('Foo');

For RT#98809

Copied override from MooseX::Types::TypeDecorator to allow
union from all types.  In theory this should mean we can
remove it from MooseX::Types.

Allow:

    my $type2 = $type1 | class_type('Bar');

as well as:

    my $type1 = HashRef | class_type('Foo');

For RT#98809.
@haarg

haarg commented Nov 23, 2017

Copy link
Copy Markdown
Member

I don't think I like this as an internal part of Moose.

@haarg

haarg commented Nov 23, 2017

Copy link
Copy Markdown
Member

To clarify, it isn't obvious what value this provides by being built in to the type system. The examples given could be done within the MooseX::Types system without involving the Moose internals. And it isn't providing any new functionality, only syntax sugar.

@karenetheridge

karenetheridge commented Nov 23, 2017 via email

Copy link
Copy Markdown
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants