$right->_mods_cache,
);
- if (@$common) {
+ my $has_different_layers;
+ for (@$only_left) {
+ if ($_->type eq 'layer') {
+ $has_different_layers = 1;
+ last;
+ }
+ }
+ unless ($has_different_layers) {
+ for (@$only_right) {
+ if ($_->type eq 'layer') {
+ $has_different_layers = 1;
+ last;
+ }
+ }
+ }
+
+ if (!$has_different_layers and @$common) {
my $x = $left->new
->mod(@$only_left)
->body($left->_body);