+ - don't pass 'handles' down when doing 'has +' to avoid unDWIMmy explosions
- throw a useful exception when typemap doesn't return a value
- avoid localising @_ when not required for Sub::Quote
- successfully inflate a metaclass for attributeless classes (RT#86415)
sub _bar { 'extended' }
has '+_barrer' => ( is => 'rw' );
+
+ package D;
+
+ use Moo;
+ extends 'ConsumesDelegateToBar';
+
+ sub _bar { 'extended' }
+
+ has '+_barrer' => (
+ is => 'rw',
+ handles => { _baz => 'bar' },
+ );
+ package C;
+
+ use Moo;
+ extends 'ConsumesDelegateToBar';
+ with 'Does::OverrideDelegate';
+
+ has '+_barrer' => (
+ is => 'rw',
+ handles => { _baz => 'bar' },
+ );
}
is(A->new->_bar, 'extended', 'overriding delegate method with role works');
+is(D->new->_bar, 'extended', '... even when you specify other delegates in subclass');
+is(D->new->_baz, 'unextended!', '... and said other delegate still works');
is(B->new->_bar, 'extended', 'overriding delegate method directly works');
+is(C->new->_bar, 'extended', '... even when you specify other delegates in subclass');
+is(C->new->_baz, 'unextended!', '... and said other delegate still works');
done_testing;