[fpc-pascal] TFPGMapObject duplicate errors

Ryan Joseph genericptr at gmail.com
Fri Oct 2 02:24:27 CEST 2020


I expected to get an assertion when I added the duplicate key "foo". What am I doing wrong?

type
  TSomeMap = specialize TFPGMapObject<String, TObject>;
var
  map: TSomeMap;
begin
  map := TSomeMap.Create(true);
  map.Duplicates := dupError;
  map.Add('foo', TObject.Create);
  map.Add('foo', TObject.Create);

Regards,
	Ryan Joseph



More information about the fpc-pascal mailing list