Delphi: why complain about missing method implementation?

Viewed 1472

I'd like to use IEnumerator<T> instead of IEnumerator for a list I'm building. I've tried the following

IMyList = interface(IEnumerator<TElement>)
  procedure Add(Element: TElement);
end;

TMyList = class(TInterfacedObject, IMyList )
private
  function GetCurrent: TElement;
  function MoveNext: Boolean;
  procedure Reset;
public
  property Current: TElement read GetCurrent;
  procedure Add(Element: TElement);
end;

but to my amazement I'm being told that TMyList doesn't implement GetCurrent. Why is the compiler telling me that GetCurrent is missing when it is clearly not? (For the record, GetCurrent is implemented, only omitted here for brevity.) Thanks!

1 Answers
Related