anchor.diff:      Result := TItemType(inherited FindItem(AName));
   end;
   
  -function TGNamedCollection.EnsureItem(const AName: String): TItem;
  +function TGNamedCollection.EnsureItem(const AName: String): TItemType;
   begin
     Result := FindItem(AName);
     if Result = nil then
  
positive.code: 
    { TGNamedCollection }
  
    generic TGNamedCollection <TItem> = class (THashedCollection, INamedCollection)
    private
      function GetItems(const Idx: Integer): TItem;
      procedure SetItems(const Idx: Integer; AValue: TItem);
    public
      type
        TItemType = TItem;
      constructor Create;
  
      function Add: TItem;
  
      property Items[const Idx: Integer]: TItem read GetItems write SetItems; default;
  
      function FindItem(const AName: String): TItem;
      function EnsureItem(const AName: String): TItem;
    end;
  
    { TObjectMap }
  
    generic TObjectMap <TKey, TValue> = class (specialize TFPGMap<TKey, TValue>)
    protected
      procedure Deref(Item: Pointer); override;
    end;
  
negative.code: 
  { TGNamedCollection }
  
  function TGNamedCollection.GetItems(const Idx: Integer): TItemType;
  begin
    Result := TItemType( inherited Items[Idx]);
  end;
  
  procedure TGNamedCollection.SetItems(const Idx: Integer; AValue: TItemType);
  begin
    inherited Items[Idx] := AValue;
  end;
  
  constructor TGNamedCollection.Create;
  begin
    inherited Create(TItemType);
  end;
  
  function TGNamedCollection.Add: TItemType;
  begin
     Result := TItemType(inherited Add);
  end;
  
  function TGNamedCollection.FindItem(const AName: String): TItemType;
  begin
    if AName = '' then
      Result := nil
  