anchor.diff:  
   update_successors(#b_br{bool=#b_literal{val=true},succ=S}, Ts, D) ->
       update_successor(S, Ts, D);
  -update_successors(#b_br{bool=#b_var{}=Bool,succ=Succ,fail=Fail}, Ts, D0) ->
  -    D = update_successor_bool(Bool, false, Fail, Ts, D0),
  -    SuccTs = infer_types(Bool, Ts, D0),
  -    update_successor_bool(Bool, true, Succ, SuccTs, D);
  -update_successors(#b_switch{arg=#b_var{}=V,fail=Fail,list=List}, Ts, D0) ->
  -    D = update_successor(Fail, Ts, D0),
  -    foldl(fun({Val,S}, A) ->
  -                  T = get_type(Val, Ts),
  -                  update_successor(S, Ts#{V=>T}, A)
  -          end, D, List);
  +update_successors(#b_br{bool=#b_var{}=Bool,succ=Succ,fail=Fail}, Ts0, D0) ->
  +    case cerl_sets:is_element(Bool, D0#d.once) of
  +        true ->
  +            %% This variable is defined in this block and is only
  +            %% referenced by this br terminator. Therefore, there is
  +            %% no need to include the type database passed on to the
  +            %% successors of this block.
  +            Ts = maps:remove(Bool, Ts0),
  +            D = update_successor(Fail, Ts, D0),
  +            SuccTs = infer_types(Bool, Ts, D0),
  +            update_successor(Succ, SuccTs, D);
  +        false ->
  +            D = update_successor_bool(Bool, false, Fail, Ts0, D0),
  +            SuccTs = infer_types(Bool, Ts0, D0),
  +            update_successor_bool(Bool, true, Succ, SuccTs, D)
  +    end;
  +update_successors(#b_switch{arg=#b_var{}=V,fail=Fail,list=List}, Ts0, D0) ->
  +    case cerl_sets:is_element(V, D0#d.once) of
  +        true ->
  +            %% This variable is defined in this block and is only
  +            %% referenced by this switch terminator. Therefore, there is
  +            %% no need to include the type database passed on to the
  +            %% successors of this block.
  +            Ts = maps:remove(V, Ts0),
  +            D = update_successor(Fail, Ts, D0),
  +            F = fun({_Val,S}, A) ->
  +                        update_successor(S, Ts, A)
  +                end,
  +            foldl(F, D, List);
  +        false ->
  +            D = update_successor(Fail, Ts0, D0),
  +            F = fun({Val,S}, A) ->
  +                        T = get_type(Val, Ts0),
  +                        update_successor(S, Ts0#{V=>T}, A)
  +                end,
  +            foldl(F, D, List)
  +        end;
   update_successors(#b_ret{}, _Ts, D) -> D.
   
   update_successor_bool(#b_var{}=Var, BoolValue, S, Ts, D) ->
  
positive.code:             Br0
      end.
  
  get_types(Values, Ts) ->
      [get_type(Val, Ts) || Val <- Values].
  -spec get_type(beam_ssa:value(), type_db()) -> type().
  
negative.code:       Block :: beam_ssa:b_blk().
  
  opt(Linear, Args) ->
      UsedOnce = used_once(Linear, Args),
      Ts = maps:from_list([{V,any} || #b_var{}=V <- Args]),
      FakeCall = #b_set{op=call,args=[#b_remote{mod=#b_literal{val=unknown},
                                                name=#b_literal{val=unknown},
                                                arity=0}]},
      Defs = maps:from_list([{Var,FakeCall#b_set{dst=Var}} ||
                                #b_var{}=Var <- Args]),
      D = #d{ds=Defs,ls=#{0=>Ts,?BADARG_BLOCK=>#{}},
             once=UsedOnce,sub=#{}},
      opt_1(Linear, D).
  
  opt_1([{L,Blk}|Bs], #d{ls=Ls}=D) ->
  