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: -import(elixir_errors, [form_error/4]).
  -include("elixir.hrl").
  
  expand(Meta, Args, E, RequireSize) ->
    case ?key(E, context) of
      match ->
        {EArgs, Alignment, EE} =
          expand(Meta, fun elixir_expand:expand/2, Args, [], E, E, 0, RequireSize),
  
        case find_match(EArgs) of
          false ->
            {{'<<>>', [{alignment, Alignment} | Meta], EArgs}, EE};
          Match ->
            form_error(Meta, EE, ?MODULE, {nested_match, Match})
        end;
      _ ->
        PairE = {elixir_env:prepare_write(E), E},
        {EArgs, Alignment, {EA, _}} =
          expand(Meta, fun elixir_expand:expand_arg/2, Args, [], PairE, E, 0, RequireSize),
        {{'<<>>', [{alignment, Alignment} | Meta], EArgs}, elixir_env:close_write(EA, E)}
    end.
  
  expand(_BitstrMeta, _Fun, [], Acc, E, _OriginalE, Alignment, _RequireSize) ->
    {lists:reverse(Acc), Alignment, E};
  expand(BitstrMeta, Fun, [{'::', Meta, [Left, Right]} | T], Acc, E, OriginalE, Alignment, RequireSize) ->
    {ELeft, EL} = expand_expr(Meta, Left, Fun, E),
  
    %% Variables defined outside the binary can be accounted
    %% on subparts, however we can't assign new variables.
    {EM, MatchSize} =
      case EL of
        %% expand_arg, no assigns
        {EC1, EV1} -> {elixir_env:reset_read(EC1, EV1), false};
  
        %% expand, revert assigns
        _ -> {EL#{context := nil, prematch_vars := raise}, T /= []}
      end,
  
    EType = expr_type(ELeft),
    {ERight, EAlignment, ES} = expand_specs(EType, Meta, Right, EM, OriginalE, RequireSize or MatchSize),
  
    EE =
      case EL of
        %% no assigns, vars are kept separately
        {_EC2, EV2} -> {ES, EV2};
  
        %% restart EL state
        _ -> ES#{context := match, prematch_vars := ?key(EL, prematch_vars)}
      end,
  
    EAcc =
      %% If the Etype is a bitstring (which implies a literal <<>>)
  
negative.code: 
  do_expand_expr(Meta, Component, Fun, E) ->
    case Fun(Component, E) of
      {EComponent, {ErrorE, _}} when is_list(EComponent); is_atom(EComponent) ->
        form_error(Meta, ErrorE, ?MODULE, {invalid_literal, EComponent});
      {_, _} = Expanded ->
        Expanded
    end.
  
  %% Expands and normalizes types of a bitstring.
  
  