anchor.diff:        {binary, _, []} when EType == bitstring  ->
           case byte_parts(ELeft) of
             {ok, Parts} -> lists:reverse(Parts, Acc);
  -          error -> prepend_unless_bitstring_in_match(EType, Meta, ELeft, ERight, Acc, E)
  +          error -> prepend_unless_bitstring_in_match(EType, Meta, ELeft, ERight, Acc, OriginalE)
           end;
         {bitstring, _, []} when EType == bitstring ->
           lists:reverse(element(3, ELeft), Acc);
         _ ->
  -        prepend_unless_bitstring_in_match(EType, Meta, ELeft, ERight, Acc, E)
  +        prepend_unless_bitstring_in_match(EType, Meta, ELeft, ERight, Acc, OriginalE)
       end,
   
  -  expand(BitstrMeta, Fun, T, EAcc, EE, OriginalE, alignment(Alignment, EAlignment), RequireSize);
  -expand(BitstrMeta, Fun, [{_, Meta, _} = H | T], Acc, E, OriginalE, Alignment, RequireSize) ->
  +  expand(BitstrMeta, Fun, T, EAcc, EE, alignment(Alignment, EAlignment), RequireSize);
  +expand(BitstrMeta, Fun, [{_, Meta, _} = H | T], Acc, E, Alignment, RequireSize) ->
     {Expr, ES} = expand_expr(Meta, H, Fun, E),
     {EAcc, EAlignment} = wrap_expr(Expr, Acc),
  -  expand(BitstrMeta, Fun, T, EAcc, ES, OriginalE, alignment(Alignment, EAlignment), RequireSize);
  -expand(Meta, Fun, [H | T], Acc, E, OriginalE, Alignment, RequireSize) ->
  +  expand(BitstrMeta, Fun, T, EAcc, ES, alignment(Alignment, EAlignment), RequireSize);
  +expand(Meta, Fun, [H | T], Acc, E, Alignment, RequireSize) ->
     {Expr, ES} = expand_expr(Meta, H, Fun, E),
     {EAcc, EAlignment} = wrap_expr(Expr, Acc),
  -  expand(Meta, Fun, T, EAcc, ES, OriginalE, alignment(Alignment, EAlignment), RequireSize).
  +  expand(Meta, Fun, T, EAcc, ES, alignment(Alignment, EAlignment), RequireSize).
   
   prepend_unless_bitstring_in_match(Type, Meta, Left, Right, Acc, E) ->
     Expr = {'::', Meta, [Left, Right]},
  
positive.code: 
  do_expand_expr(Meta, Component, Fun, E) ->
    case Fun(Component, E) of
      {EComponent, _} when is_list(EComponent); is_atom(EComponent) ->
        ErrorE = env_for_error(E),
        form_error(Meta, ErrorE, ?MODULE, {invalid_literal, EComponent});
      {_, _} = Expanded ->
        Expanded
    end.
  
  env_for_error({E, _}) -> E;
  env_for_error(E) -> E.
  
  %% Expands and normalizes types of a bitstring.
  
  
negative.code:   case E of
      #{context := match} when Type == bitstring ->
        form_error(Meta, E, ?MODULE, {unaligned_bitstring_in_match, Expr});
      #{} ->
        [Expr | Acc]
    end.
  
  