anchor.diff:  unfold_types_in_type(T) ->
       unfold_types_in_type(T, []).
   
  -unfold_types_in_type({app_t, Ann, Id = {id, _, RecName}, Args}, Options) ->
  +unfold_types_in_type({app_t, Ann, Id, Args}, Options) when ?is_type_id(Id) ->
       UnfoldRecords = proplists:get_value(unfold_record_types, Options, false),
  -    case lookup_type(RecName) of
  +    case lookup_type(Id) of
           {Formals, {record_t, Fields}} when UnfoldRecords, length(Formals) == length(Args) ->
               {record_t,
                unfold_types_in_type(
  
positive.code:                | aeso_syntax:con() | aeso_syntax:qcon()  %% contracts
                 | aeso_syntax:tvar()
                 | {uvar, aeso_syntax:ann(), reference()}.
  
  -type why_record() :: aeso_syntax:field(aeso_syntax:expr())
                      | {proj, aeso_syntax:ann(), aeso_syntax:expr(), aeso_syntax:id()}.
  
negative.code:                    pp_loc(hd(Fields)),
                     string:join([ C || C <- Candidates ], ", ")]);
  pp_error({missing_field, Field, Rec}) ->
      io_lib:format("Record type ~s does not have field ~s (at ~s)\n", [pp(Rec), pp(Field), pp_loc(Field)]);
  pp_error({no_records_with_all_fields, Fields}) ->
      S = [ "s" || length(Fields) > 1 ],
      io_lib:format("No record type with field~s ~s (at ~s)\n",
  